This is at least obvious and easy to explain badness... And the lesson was learned. Some people don't learn it or are forced to ignore it all the time by middle management.
(This is how you go grey haired from stress.)
11–20 of 81 posts
This is at least obvious and easy to explain badness... And the lesson was learned. Some people don't learn it or are forced to ignore it all the time by middle management.
(This is how you go grey haired from stress.)
https://github.com/raxod502/TerrariaClone/blob/master/src/Te... You may not like it, but this is peak programming. A level of perfection attainable only by undergoing the rite of writing a single if statement with 100+ conditions.
No, this is peak coding. A coder strives to write the longest and most impressive code. A programmer strives to write the code that solvers the problem at hand at the simplest and most reliable way.
as an aside, i have never seen short used in java code until today after like 10 years
Oh, and that stream of comments by polytomous. That's... something.
Earlier quoted context omitted.
No, this is peak coding. A coder strives to write the longest and most impressive code. A programmer strives to write the code that solvers the problem at hand at the simplest and most reliable way.
"You may not like it, but this is peak X" is an internet meme, usually sarcastic in nature.
Certainly, a great meme to use but also indicative of the divisive nature of some discussions, often without any sarcasm.
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.
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 guess that the programmer came from a C background (where brevity tends to be valued and abstractions tend not to be) and used Java because it's cross-platform.
In my estimation, the sin is the cyclomatic complexity.
"Back when I was first learning to program in Java, I decided to try to make a clone of the excellent PC game Terraria. Of course, I was convinced that my version would have many more features than the official one.
But before I realized how silly that idea was, I produced 11,000 lines of, to date, the most atrocious code I have ever seen in my life. I make it available here mostly as a cautionary tale of what can happen if you don't pay attention to the quality of your code. (Lesson learned, in my case!) Here are some of the highlights..."
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.