Live data from Hacker News

TerrariaClone – An incomprehensible hellscape of spaghetti code

github.com

71–80 of 289 posts

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#71
As Ive gotten older, I have severely relaxed my dogma on coding standards. I agree that code should be maintainable, legible and logically formed. Sometimes though, you just need to get things done, and architecting a large solution of abstractions and frameworks, just doesn't seem like a good use of time.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#72

This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…

It is often impossible to write code the first time anyways, just do it, realize your technical debt, and come back and refactor it when the better abstraction is more obvious (if any).

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#73
Reminds me of a rather insightful comment from a Hackernews a few years ago [1]:

> People write MLOC monstrosities in Java because they can. You get some boring financial topic and some sub-par programmers and they'll write as much garbage as the language can possibly sustain.

> These things are a testament to how safe and simple Java is as a language.

> Not having massive crappy code bases is a negative sign in terms of how reliable and easy to understand a language is.

[1] https://news.ycombinator.com/item?id=7653762

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#74
post #33

I had to see for myself. Yep, that's bad. What's not bad is the author's attitude about learning and improving. It also looks like this was a stop on the way to Harvey Mudd CS. [1] So, a happy ending, perhaps. [1] https://github.com/raxod502

With one exception I've never looked back at code I've written and thought "well that's well designed."

Typically every few months I've improved enough to notice the quality difference.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#75

This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…

By the time this happens you’ll be “overqualified” and “unlikely to be happy”, and therefore unemployable.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#76
post #63
post #25

I think true spaghetti code requires teamwork. I mean that seriously. You need at least 3 people all with different incomplete and incorrect mental models trying to modify the same codebase at the same time.

I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work…

One of the things it took me a while to intellectualize is that 'you' a year ago is a very different person from 'you' today.

Given enough time, maintaining a much larger body of code than a single person can reasonably handle, you're going to have disagreements with yourself without even realizing it.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#77
post #63
post #25

I think true spaghetti code requires teamwork. I mean that seriously. You need at least 3 people all with different incomplete and incorrect mental models trying to modify the same codebase at the same time.

I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work…

I should add that I volunteered to maintain this project, in exchange for free stuff from said organization (not money), before I knew what I was volunteering for (heh, lesson learned).

3 years (of occasional work, maybe 1-4 hours a week) later and I've got a layer on top that can interact with all of the slightly different data models of the four apps and I'm gradually replacing the legacy code with new code and migrating them all back into a single database/app.

Since I'm not working for money, I maintain sole ownership of the code, and I hope to eventually turn it into a passive income source, since it will be useful to other, similar organizations who have it even worse as far as their web applications go.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#78

This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…

Premature abstraction is generally worse than immature abstraction. Write the most straightforward thing you can, and wait for that feeling that it won't work out.

Then, ignore that feeling until you get proof. If you've kept your code simple and clean reacting to a lack of abstraction is relatively easy, at least compared to what digging yourself out of the wrong abstraction is like.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#79

This makes me miss my early days of programming, where no code was too verbose or horrible to stop me from progressing towards my goal, no matter how misguided I was. Nowadays I'm distracted by the first hint that there might be some better way, and all progress stops. I think I'm just beginning to recognize this, and maybe one of these years I'll learn to recognize when the right abstraction is really important and…

watching the creator of The Witness do some live stream coding made me realize this too. he just typed the convenient thing he needed at each moment and didn't try to abstract away the mess. just forged ahead.

Thinking of video game, I think this is a good analogy: a lot of what you write in the beginning are just tools to your own program.

I'm really talking about the lines in your code, they're structured so well that they will help forge more code in the middle and later parts of your code life.

Like any good video game, if you produce good tools in the beginning to produce levels, modes, multi-player games, etc... then you will produce something great.

If you don't care about what you're writing, then it will become a huge mess and you will either give up or your users will give up. Or once in a life time, the mess you created will still be fun enough that everyone will start playing it, deadmau5 will make a tattoo of it and Microsoft will buy you out and you will have the most expensive house in the world/LA.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#80
post #76
post #63

Earlier quoted context omitted.

I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work…

One of the things it took me a while to intellectualize is that 'you' a year ago is a very different person from 'you' today. Given enough time, maintaining a much larger body of code than a single person can reasonably handle, you're going to have disagreements with yourself without even realizing it.

Absolutely. When I stumble upon some code in my full time codebase that I find distasteful, my first thought is "what idiot did this". git blame and sure enough, it's me.

Past me has been and always will be an idiot as far as present me is concerned (with some infrequent exceptions).

Post reply on HN