Live data from Hacker News

TerrariaClone – An incomprehensible hellscape of spaghetti code

github.com

271–280 of 289 posts

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#271

The real Terraria code isn't much better. Here's their 3MB [decompiled] NPC.cs: https://raw.githubusercontent.com/csnxs/Terraria/67de21a27e1... They had serious problems implementing multiplayer because they had to synchronize objects with 50KB of state every frame.

Oh wow. That might explain a lot of my lag I’ve had when multiplaying on large maps (on LAN).

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#273
post #187

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…

Earlier today I wrote a ruby script to go through a JavaScript file, find all ocurrences where a method was written in a certain way, and convert it to a new format. I realized before writing it that there I would never use this script after today, no one ever had to see it, and it would never get version controlled. So i just wrote it in the quickest "get it functional for 95% of cases and throw an error otherwise"…

.. the next day, my boss called- and he had the exact same problem, so i used the script, so its a tool at our company now, and several collagues added to it.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#274

Earlier quoted context omitted.

> On the other hand, joint code ownership leads to endless discussions about proper whitespace formating, variables naming and accessors. It leads to never-enforced style rules that no one likes nor follows. Seems less a problem with joint ownership and more a problem with poor leadership.

Only a broken peasant, reduced to a mere Automaton, garants the quality and innovation- that this company is so proud to produce. Seriously- i hate it when Hackers try to reduce theire co-workers to machines and enforce there personal taste as "programs". If you are unable to deal with humans, to accept unimportant differences, why do you try to define the interfaces for humans on a project.

I think the same thing could be said of those who refuse to follow the coding standards.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#275

Earlier quoted context omitted.

This looks as if this was a compile target, not the source code. HitEffect is a quite the function. This reminds me of working on CDDA[1] before many of the refactors hit. CDDA is an interesting case, it stemmed from a situation similar to the original post (one person project, embarked upon it before knowing how to do so). It was a complete mess of macros, spaghetti code and data and code living happily side by side…

It was, or still is? Also, are you still working on it? I'm currently having lots and lots of fun playing this game (experimental builds). It's pretty much halfway there to Dwarf Fortress...

I stopped many years ago. I was working on it in between sending out job applications, I was happy to gain experience working on a code base larger than I felt comfortable reading and one that is ugly but a rewrite is not an option.

I didn't add too many features, I was mostly reducing the amount of compiler noise and fixing any bugs I ran across.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#276
post #108

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…

As I had to work more with teams and then supervising teams I changed the abstractions I value from when I was programming solo: Now I care less about my project's function than the structure of the team. There is a saying that any complex project will end up mimicking the communication structure of your organization. I must confess I thought it was silly until I realized it happened to us. I now favor code that has…

Project managers usually shouldn't define interfaces between code modules. That's a design lead or architect responsibility.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#277
post #108

Earlier quoted context omitted.

As I had to work more with teams and then supervising teams I changed the abstractions I value from when I was programming solo: Now I care less about my project's function than the structure of the team. There is a saying that any complex project will end up mimicking the communication structure of your organization. I must confess I thought it was silly until I realized it happened to us. I now favor code that has…

> allows programmers, these very territorial beasts, to have their own little realms they control My 25 years of programming experience says otherwise. The only place where this works is with good(ish) programmers who are assholes and must have their huge, fragile egos stroked or they'll throw a diva fit. I don't hire or work with those people anymore. Neither should you. Joint code ownership produces better code bec…

Yes collective code ownership generally produces the best overall outcomes. Individual developers or small agile teams need to be able to work through an entire vertical slice of the application to deliver a complete feature that has actual value to users. When you divide up the work by code module rather than by application functionality then the user's needs stop being the primary focus.

But with collective code ownership it's still useful to designate a couple of developers as "stewards" for each major component. They don't own the component, but they take responsibility for training other developers on the internal design, making suggestions on refactoring, and reviewing design proposals and code diffs.

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#278
post #269
post #144

Earlier quoted context omitted.

Not GP but probably: “ Here be dragons ”

I actually did that once. It was a wordpress site for a company written by some 16 year old intern. Terribly fun. No version management. The main folder had multiple older copies of itself in seemingly random subfolders. It went deep. The CSS was stored partially in CSS files, of which there were 20 (!) loaded from the theme folder, partially in one of the 40+ plugins used (not an exageration). But there was also ple…

> "The favicon was 20MB large"

Well, that's actually impressive :D

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#279
post #190

Earlier quoted context omitted.

Re: 0 sometimes I wish I could just be paid to read and understand code.

Are you being paid per written line of code or something? I just can't think of a reason to believe as a programmer that your job responsibilities don't include reading and understanding code.

They definitely do, but there's so many other things, and they come with all sorts of distractions. (I love my job, don't get me wrong)

Re: TerrariaClone – An incomprehensible hellscape of spaghetti code

#280

Earlier quoted context omitted.

> On the other hand, joint code ownership leads to endless discussions about proper whitespace formating, variables naming and accessors. It leads to never-enforced style rules that no one likes nor follows. Seems less a problem with joint ownership and more a problem with poor leadership.

Only a broken peasant, reduced to a mere Automaton, garants the quality and innovation- that this company is so proud to produce. Seriously- i hate it when Hackers try to reduce theire co-workers to machines and enforce there personal taste as "programs". If you are unable to deal with humans, to accept unimportant differences, why do you try to define the interfaces for humans on a project.

The point was if you’re trying to make joint code ownership work through those things you are already doing it wrong. Want everyone to run with their own style? Fine. You need to make the style sensitive parts of the process work. Whether that’s to adopt local style or something more complex.

If all you can do is not enforce some poor coding standards then you are defacto not a lead.

Post reply on HN