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.
TerrariaClone – An incomprehensible hellscape of spaghetti code
271–280 of 289 posts
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#272Dear Author, at least you know while and for.. it can be worser.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#273This 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"…
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#274Earlier 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.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#275Earlier 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 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
#276This 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…
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#277Earlier 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…
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
#278Earlier 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…
Well, that's actually impressive :D
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#279Earlier 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.
Re: TerrariaClone – An incomprehensible hellscape of spaghetti code
#280Earlier 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.
If all you can do is not enforce some poor coding standards then you are defacto not a lead.