Earlier quoted context omitted.
I'm a second-year CS student that is still learning in this realm. Is there a general way that most developers would rewrite lines 5261-5284? My assumption is I would look to find some rules I can apply to simplify the code but I'm also aware a CS course is a bit of a bubble and what I've learnt so far might not be the way things are handled in industry. For example, line 5284 has a 8 inequality operators checking ev…
As mindfulgeek mentions, doing some sort of extract method refactor to slop a name onto it can be a good first step. Then do some sleuthing thru other number name pairings, inserting names in place of the numbers, until you have a solid grasp of what the names should actually be. Feathers in Working Effectively With Legacy Code brings up a concept called seams... u can insert a seam to map to objects and then do obje…
Anyone who looks at this code instantly becomes insane
71–80 of 81 posts
Re: Anyone who looks at this code instantly becomes insane
#72Re: Anyone who looks at this code instantly becomes insane
#73> it does not encourage meaningful / non-ableist dialog with the work Is it really ableist to think that sanity is objectively better than insanity? > ins*ne This is peak wokeness. We can’t even spell out the word “insane” for fear of offending someone.
Re: Anyone who looks at this code instantly becomes insane
#74I wouldn’t ever want to work with this code, but there’s a level of persistence here that I kind of respect. Sure, the code sucks, but I can’t help but feel like I couldn’t have written this even if I wanted to. There’s usually a point when I’m too deep in a nested conditional to remember all the variables, and that’s usually before 23 tabs in.
Re: Anyone who looks at this code instantly becomes insane
#75Earlier quoted context omitted.
I'm a second-year CS student that is still learning in this realm. Is there a general way that most developers would rewrite lines 5261-5284? My assumption is I would look to find some rules I can apply to simplify the code but I'm also aware a CS course is a bit of a bubble and what I've learnt so far might not be the way things are handled in industry. For example, line 5284 has a 8 inequality operators checking ev…
> A second question: Why is there no comments? Is this common? Man I remember being this naive once :(
Re: Anyone who looks at this code instantly becomes insane
#76> The TerrariaClone.init() method, which is over 1,300 lines long, actually grew so large that the Java compiler started running out of memory trying to compile it! The solution? Copy half of the init() code into a new method, called codeTooLarge(), and call that from init() I found this in the readme, hilarious (not in a mean way).
Didn't Facebook and other major app developers run into issues with having too many classes for Android's JVM?
Re: Anyone who looks at this code instantly becomes insane
#77> The TerrariaClone.init() method, which is over 1,300 lines long, actually grew so large that the Java compiler started running out of memory trying to compile it! The solution? Copy half of the init() code into a new method, called codeTooLarge(), and call that from init() I found this in the readme, hilarious (not in a mean way).
Modern problems require modern solutions! Didn't Facebook and other major app developers run into issues with having too many classes for Android's JVM?
Don't do that kids
Re: Anyone who looks at this code instantly becomes insane
#78- 9.5k lines of code
- 333 bugs
- 2 vulnerabilities
- 6 security hotspots
- 56 days of technical debt
- 2172 code smells
- 0.0% coverage
- 21.5% duplications
- 117 duplicated blocks
I might be masochistic enough to try to fix these issues with a merge request.
Re: Anyone who looks at this code instantly becomes insane
#79Re: Anyone who looks at this code instantly becomes insane
#80About 12 years ago I was working at a company in which a developer had recently left, and left behind some code that had a bug in it that needed fixing, the code was processing some XML and I knew a lot about XML so I was called over to look at this code. The code was actually very simple, it consisted of for loops over a bunch of element nodes in which child nodes had to be compared with child nodes in other element…
Reminded of a time I took the code of our Data Scientists (2 physicists that "coded". They decided to make their own ORM in Ruby (called "Mondongo") instead of using one available. No wonder, the code was a real mess... For example, they needed to get a numeric value from a dropdown box that got several text options. The way they did it was: fieldVal = textField.gsub('text string 1',0).gsub('another string 2',1).gsub…
There was a requirement that we had to deliver all validation code in VBScript that would run in the ASP but also should handle possible future changes to the request, and I had examples of all valid possible requests (which as I said had just been changed a couple days before), so I wrote an XSLT that went over all the XML templates and generated a bunch of VBScript if statements and for loops for each possible valid request and if it didn't find it returned an error message that it was invalid.
So anyway based on the theory that I can understand any stupid coding wtf I myself have done - if the wtf code is generated by some other better code I understand why the code is so awful, but if it is handwritten I still don't understand. And my guy handwrote his code. I'm guessing yours too. crazy.