News for hackers. Stuff that matters.
Re:Anyone who looks at this code instantly becomes insane by Bukhmanizer on Thursday August 01, 2019 @02:54PM (#20587087)
I 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 by _bxg1 on Thursday August 01, 2019 @03:04PM (#20587173)
Yeah. This is the code of a very smart person who didn't take the time to make abstractions, either through laziness or naivete. I've seen much more deeply-wrong code that would be much harder to refactor into something maintainable than this would be.
Re:Anyone who looks at this code instantly becomes insane by mntmoss on Thursday August 01, 2019 @06:00PM (#20588786)
Yes, this kind of "naive coding technique" occasionally pops up, and I think it's a good discussion topic, because its mere existence demonstrates that you can get extremely far in terms of delivering features with a minimal amount of abstraction: "sometimes all you need is a function."

Further, that the code probably would not really be hideously miserable for a more experienced coder to refactor(it's just very duplicated) shows that copy-paste is reasonable for deferring some kinds of architectural decisions. It's not what you would bias towards if you have a whole team pounding away at the same file and rapidly evolving it, but as a solo practitioner who wants to get the feature out and put it away for the day, this style is convenient for letting the code as a whole develop some maturity and functionality before it gets refactored with abstraction.

Re:Anyone who looks at this code instantly becomes insane by realSlavojTrump on Thursday August 01, 2019 @06:58PM (#20589151)
Give refactoring this code a go! Its sublimely fun!!!
Re:Anyone who looks at this code instantly becomes insane by kehphin on Thursday August 01, 2019 @03:27PM (#20587373)
https://intuitiveexplanations.com/assets/Resume.pdf - author's resume is pretty impressive. Glad to see he's doing well.
Re:Anyone who looks at this code instantly becomes insane by stirfrykitty on Thursday August 01, 2019 @03:25PM (#20587347)
But isn't this the beauty of programming to begin with. Barring certain things like medical devices, cars, etc., where it has to be very orthodox, for stuff like Web back/frontends, and even gaming, this is how people learn, I guess. Sure, that code could be re-factored for speed, cleaner in appearance, etc.

Reminds me of the video driver (forget card) some Linux developers wrote that was ~30k lines of code. OpenBSD wanted to use it because the HW manufacturer wouldn't release the specs, but because the Linux code was GPL, the OpenBSD guys re-wrote it from scratch in less than 1/4 of the code.

Re:Anyone who looks at this code instantly becomes insane by shoo on Thursday August 01, 2019 @03:16PM (#20587282)
> there’s a level of persistence here that I kind of respect

yup. reminds me of: "Write Code Like You Just Learned How to Program" -- https://prog21.dadgum.com/87.html

Re:Anyone who looks at this code instantly becomes insane by overkalix on Friday August 02, 2019 @01:35AM (#20590836)
This was written by a 14 year old kid. If anything it is an impressive testament of precocity and ingenuity.
Re:Anyone who looks at this code instantly becomes insane by jschwartzi on Thursday August 01, 2019 @02:57PM (#20587106)
It seems like you could use all the extra whitespace to embed another program within the program.