MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/t43uai/found_this_monstrosity_in_the_wild/
r/badcode • u/OpaMilfSohn • Mar 01 '22
5 comments sorted by
19
It feels like that was a wierd hack that had to be done because something wasn't accessible and nobody noticed that it wasn't necessary anymore
2 u/Ambitious_Ad8841 Mar 02 '22 This kind of thing happens over time as multiple people contribute changes. They get so focused on the task at hand, they don't look at the surrounding code and see that there is an easier way
2
This kind of thing happens over time as multiple people contribute changes. They get so focused on the task at hand, they don't look at the surrounding code and see that there is an easier way
4
we gotta up the enterprise on that code
This looks like someone looked up an online tutorial but skipped the first 700 pages
1
Image Transcription: Code
valueAppHome = (bool) _cpm.GetType().GetField(Enum.GetName(typeof(CPM.DataType), CPM.DataType.AppHome)).GetValue(_cpm); valueAppBusy = (bool) _cpm.GetType().GetField(Enum.GetName(typeof(CPM.DataType), CPM.DataType.AppBusy)).GetValue(_cpm); // Functionally the same valueAppBusy = _cpm.AppBusy; valueAppHome = _cpm.AppHome;
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
19
u/MattiDragon Mar 01 '22
It feels like that was a wierd hack that had to be done because something wasn't accessible and nobody noticed that it wasn't necessary anymore
4
u/g_hi3 Mar 01 '22
we gotta up the enterprise on that code
2
u/[deleted] Mar 05 '22
This looks like someone looked up an online tutorial but skipped the first 700 pages
1
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Mar 01 '22
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!