Live data from Hacker News

Anyone who looks at this code instantly becomes insane

github.com

31–40 of 81 posts

Re: Anyone who looks at this code instantly becomes insane

#31

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.

> 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

#36
post #16
post #14

Honestly the only insane thing is that it's all in one file. Could've also been broken up into more functions (it seems like this person didn't actually want to be using Java), but it's reasonably named and formatted and they did a decent job separating out static data at the top instead of littering it throughout the code. Oh, and that stream of comments by polytomous. That's... something.

This kind of thing in particular is really interesting: public static void print(String text) { System.out.println(text); } This person cares enough about brevity to make little wrapper functions like this, but at the same time everything is very procedural and monolithic. This gives a vague, weird sense of refined taste, despite some obvious problems with the artifact as a whole. I'm going to go out on a limb and gu…

totally should have been called p(...)

Re: Anyone who looks at this code instantly becomes insane

#37
post #16
post #14

Honestly the only insane thing is that it's all in one file. Could've also been broken up into more functions (it seems like this person didn't actually want to be using Java), but it's reasonably named and formatted and they did a decent job separating out static data at the top instead of littering it throughout the code. Oh, and that stream of comments by polytomous. That's... something.

This kind of thing in particular is really interesting: public static void print(String text) { System.out.println(text); } This person cares enough about brevity to make little wrapper functions like this, but at the same time everything is very procedural and monolithic. This gives a vague, weird sense of refined taste, despite some obvious problems with the artifact as a whole. I'm going to go out on a limb and gu…

I'd bet they made that function so they had a single place to intervene on text being written, not necessarily for the brevity/aesthetics.

Re: Anyone who looks at this code instantly becomes insane

#38
post #24

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.

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.

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

#40
post #24

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.

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.

https://intuitiveexplanations.com/assets/Resume.pdf - author's resume is pretty impressive. Glad to see he's doing well.
Post reply on HN