3 ms·
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 lik
by Bukhmanizer 7y ago
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.
- jschwartzi 7y agoIt seems like you could use all the extra whitespace to embed another program within the program.
- _bxg1 7y agoYeah. 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.
- stirfrykitty 7y agoBut 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.
- kehphin 7y agohttps://intuitiveexplanations.com/assets/Resume.pdf https://intuitiveexplanations.com/assets/Resume.pdf - author's resume is pretty impressive. Glad to see he's doing well.
- mntmoss 7y agoYes, 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.
- realSlavojTrump 7y agoGive refactoring this code a go! Its sublimely fun!!!
- shoo 7y ago> 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 https://prog21.dadgum.com/87.html
- overkalix 7y agoThis was written by a 14 year old kid. If anything it is an impressive testament of precocity and ingenuity.