Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Adhemar
Jan 21, 2004

Kellner, da ist ein scheussliches Biest in meiner Suppe.
Opa also means grandpa in Dutch.

It's so easy, even your grandpa can code in it!

Adbot
ADBOT LOVES YOU

mobby_6kl
Aug 9, 2009

by Fluffdaddy

Blue Footed Booby posted:

public bool puppy;

Edit: my scrolling thumb is tired and I'm nowhere near the bottom. This class is amazing.

Not going to quote the code exactly as opening the github page fucks up my browser for a while with its sheer size, but my favorite part were the hardcoded player objects.

code:
player6.puppy = true;
player70.runAcceleration = player70.runAcceleration * 3.5f;
Or whatever. But they use getters and setters for properties, so everything must be great in this well thought out design.

Also I had no idea what this game was until I just saw it in the Games forum - apparently it's something that people actually play???

Jewel
May 2, 2009

mobby_6kl posted:

Also I had no idea what this game was until I just saw it in the Games forum - apparently it's something that people actually play???



And a new patch recently brought back a lot of players.

Also I still wonder how much of the code is bad by design and how much is bad because of decompilation but it's still horrifying!

Jewel fucked around with this message at 02:27 on Jul 13, 2015

KernelSlanders
May 27, 2013

Rogue operating systems on occasion spread lies and rumors about me.

SupSuper posted:

HTML emails are a shitshow all around so the norm is pretty much to just embed as much of your content as possible into an image to avoid it getting mangled (with a "view in browser" link just in case).

We have a toolkit that takes react templates and renders them to HTML server-side in an email-client compatible way. I thought it was open sourced but it looks like the repo still isn't public yet. I'll check and see what's up.

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Jewel posted:

Also I still wonder how much of the code is bad by design and how much is bad because of decompilation but it's still horrifying!

I imagine it's one of those things where someone working with that class thought "man, I could really use X here... oh gently caress it, I'll just add it!" and so it slowly built and built until someone noticed its size and went "Wow, this is not sustainable, but I really need this property here, and we can't refactor it now... oh gently caress it, I'll just add it!". And so on, and so on.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



SupSuper posted:

aaaaaaaaaaaaaaaaaaaaaaaaaaa

Seems appropriate to me, but then "Opa" is a sound I associate with someone breaking things in a way that produces a lot of sharp shrapnel, sooo

Jewel posted:

Also I still wonder how much of the code is bad by design and how much is bad because of decompilation but it's still horrifying!

.Net decompilation is really good/accurate/reliable/whatver and I doubt there's an obfuscater out there that can take a well-architected program and turn it into a god-class abomination, so I'm going to go with bad design.

dwazegek
Feb 11, 2005

WE CAN USE THIS :byodood:

Munkeymon posted:

.Net decompilation is really good/accurate/reliable/whatver and I doubt there's an obfuscater out there that can take a well-architected program and turn it into a god-class abomination, so I'm going to go with bad design.

If an obfuscater mangled a bunch of smaller classes into some unholy amalgam, then it would also break a ton of stuff that relies on reflection. So yeah, this is definitely bad design.

Maybe in the original source files the class is divided into a bunch of partial classes, which could make working with it manageable, but that doesn't make it less of a horror.

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



I think we can be confident in saying that indie game devs working by themselves don't tend to follow the best designs, let's not bring the C# decompilers in to this.

ToxicFrog
Apr 26, 2008


This is the same game that inferred weapon bounding boxes from the size of the sprite, and trusted the client when it reported that information to the server, so you could locally replace the 16x64 sword sprite with a 16x8192 one and gib people from several screens away in multiplayer.

That was eventually fixed, but Terraria, while a fun game, absolutely belongs in this thread.

Soricidus
Oct 21, 2010
freedom-hating statist shill

ToxicFrog posted:

trusted the client

babby's first network security flaw

Impotence
Nov 8, 2010
Lipstick Apathy

ToxicFrog posted:

This is the same game that inferred weapon bounding boxes from the size of the sprite, and trusted the client when it reported that information to the server, so you could locally replace the 16x64 sword sprite with a 16x8192 one and gib people from several screens away in multiplayer.

That was eventually fixed, but Terraria, while a fun game, absolutely belongs in this thread.

Doesn't it still trust the player on things like inventory and whatever, just open character viewer tool, edit your local files, and connect to a server with your edited character?

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Soricidus posted:

babby's first network security flaw

Most games nowadays trust the client way too much. Lag compensation and clientside hit detection is the worst offender, but there's other ones as well. Mostly things like limited server-visibility-culling, allowing for radar programs.

pseudorandom name
May 6, 2007

Soricidus posted:

babby's first network security flaw

Followed by baby's second network security flaw, trusting the server.

Soricidus
Oct 21, 2010
freedom-hating statist shill

pseudorandom name posted:

Followed by baby's second network security flaw, trusting the server.

nah, i'm sure this well-written game's networking code has been carefully audited to make sure there's no way for a malicious server to gain local code executiopfffffhahaha

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Harik posted:

Most games nowadays trust the client way too much. Lag compensation and clientside hit detection is the worst offender, but there's other ones as well. Mostly things like limited server-visibility-culling, allowing for radar programs.

The Jackbox Party pack games are like this. From simple things like using simple HTML attributes on the name input box to block how long your name can be (which you can just remove and put one in as long as you want), or more complex ones. For example, when you submit an answer in, say, fibbage, the game strips all special characters out of your response. So if you wanted to, say, send HTML over to the other player, you can't. But all of those checks are done client side in Javascript. So you can just skip over it and send whatever you want. And in Drawful, the canvas you draw in is just an HTML canvas. You can set whatever image you want in that canvas and it'll accept it, no problem.

From them, it was probably a case of "Who is going to be doing this during a party." so they didn't care. But considering how the games became big on streaming sites... yeah, it became a slightly bigger deal then.

ToxicFrog
Apr 26, 2008


Biowarfare posted:

Doesn't it still trust the player on things like inventory and whatever, just open character viewer tool, edit your local files, and connect to a server with your edited character?

Yes, although there isn't much way around that, since you need to be able to move characters from server to server and there's no central infrastructure to store characters on in a trusted manner. Even if the character file couldn't be edited (hah!), the decentralized nature of hosting means that there's nothing stopping someone from bringing up a server with a custom world file containing huge amounts of loot and no enemies, fully kitting out their character there, and then jumping to whatever server they want to play on.

Someone will probably prove me wrong in a few posts, but I can't actually think of a way to have more than two of: decentralized server hosting, character migration between servers, and no cheating, and the Terraria devs explicitly chose #1 and #2 as their priorities.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

ToxicFrog posted:

Someone will probably prove me wrong in a few posts, but I can't actually think of a way to have more than two of: decentralized server hosting, character migration between servers, and no cheating, and the Terraria devs explicitly chose #1 and #2 as their priorities.

I think that has a direct correlation to the CAP theorem. Terraria is basically MongoDB.

Impotence
Nov 8, 2010
Lipstick Apathy

Bognar posted:

I think that has a direct correlation to the CAP theorem. Terraria is basically MongoDB.

i'm pretty sure mongodb is more consistent and available than terraria considering the amount of ddos public servers get after a character editor gets banned

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Drastic Actions posted:

The Jackbox Party pack games are like this. From simple things like using simple HTML attributes on the name input box to block how long your name can be (which you can just remove and put one in as long as you want), or more complex ones. For example, when you submit an answer in, say, fibbage, the game strips all special characters out of your response. So if you wanted to, say, send HTML over to the other player, you can't. But all of those checks are done client side in Javascript. So you can just skip over it and send whatever you want. And in Drawful, the canvas you draw in is just an HTML canvas. You can set whatever image you want in that canvas and it'll accept it, no problem.

From them, it was probably a case of "Who is going to be doing this during a party." so they didn't care. But considering how the games became big on streaming sites... yeah, it became a slightly bigger deal then.

What quality game was it that implemented the level editor by opening a SQL database to the internet and putting the connection info in the client?

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Harik posted:

What quality game was it that implemented the level editor by opening a SQL database to the internet and putting the connection info in the client?

I believe that was Super Meat Boy in this very thread.

The developers were even told about it and did nothing.

Jewel
May 2, 2009

Harik posted:

What quality game was it that implemented the level editor by opening a SQL database to the internet and putting the connection info in the client?

Super Meat Boy which was quality "no! shut up!! its not a problem!!! no!!!!" until people wrecked it so hard they had to fix it

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

piratepilates posted:

I believe that was Super Meat Boy in this very thread.

The developers were even told about it and did nothing.

I thought that was just for the leaderboard, not for level editor. But yeah, there were just SQL credentials embedded in the game and it would connect to the actual SQL instance to query the leaderboard. Totally nuts.

[edit]
Yeah, here we go: http://forums.somethingawful.com/showthread.php?noseen=0&threadid=2803713&pagenumber=258#post398884189

[edit 2]
Oh lordy, it was the leaderboard AND the user submitted levels. Wow, that's even worse than I remember.

New Yorp New Yorp fucked around with this message at 23:28 on Jul 13, 2015

Hughlander
May 11, 2005

piratepilates posted:

I believe that was Super Meat Boy in this very thread.

The developers were even told about it and did nothing.

No that was just the leaderboard not the editor.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Hughlander posted:

No that was just the leaderboard not the editor.

Besides the part where it had the table smb_editor_levelinfo.

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Jewel posted:

Super Meat Boy which was quality "no! shut up!! its not a problem!!! no!!!!" until people wrecked it so hard they had to fix it
If by "fix it" you mean "remove the feature and never speak of it again".

Captain Capacitor
Jan 21, 2008

The code you say?
A new higher-level-than-I developer was brought in some months ago. I was working on a web project at the time that had an established codebase. He started his own version of the project, ignored any of my attempts to unify or set some standards and practices. Or even do a consult with the users to hash out the different features and milestones.

I really, really wish I could share some of his code, but I'm afraid you all will have to live with a short list of the most egregious horrors. This developer is primarily a JavaScript developer.

  • Took the contents of an XML file and converted it into a JS variable in a file.
  • Took the contents of a CSV file and converted it into a JS array of strings, one line per string
  • Looked down on me for wanting to use something like Angular, Backbone or Knockout to organize the very complex project
  • Uses manual DOM manipulation / jQuery for everything.
  • Loads the entire dataset from the server first (starting at multiple megabytes), because making multiple requests isn't "responsive"
  • Decided to write the server entirely as a console app, by hand. Was and continues to be stuck on how to do GZIP compression so he's given up on that for now.
  • Wrote said server in a single file that's topping out at 2000 some-odd lines long

Now some of this might be unfamiliarity but I can't help but be completely enraged that this guy wasted so much time reinventing so many wheels. When I had the gall to demand that I do a user survey or at least think about the usability about a feature that I'm making for him he became very clearly frustrated that I wasn't working on it immediately as demanded.

FlapYoJacks
Feb 12, 2009
I love the unenumerated case statements in that Terriara code. :allears:

nielsm
Jun 1, 2009



Reinventing the wheel, drive shaft, gearbox and gas engine. But the wheels are made from super soft rubber and don't keep their shape, the drive shaft can't handle steering while being in motion, the gearbox can't shift out safely, and the gas engine requires manual ignition on every cycle.

Soricidus
Oct 21, 2010
freedom-hating statist shill

nielsm posted:

Reinventing the wheel, drive shaft, gearbox and gas engine, but with javascript

b0lt
Apr 29, 2005

ratbert90 posted:

I love the unenumerated case statements in that Terriara code. :allears:

That's almost definitely an artifact of it being the result of decompilation. I don't know this to be a fact for C#, but javac will do inlining of constants to save the JIT a bit of effort.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



b0lt posted:

That's almost definitely an artifact of it being the result of decompilation. I don't know this to be a fact for C#, but javac will do inlining of constants to save the JIT a bit of effort.

I can't get the Microsoft compiler to do it, but maybe Mono does?

Captain Capacitor
Jan 21, 2008

The code you say?
My fury and frustration continues. This new developer has been here since January and has produced the equivalent of undergrad work. Yes, he has a lot of experience, but from over a decade ago. He hasn't updated his knowledge at all, and anything new to him is just heinous. Every moment this guy continues on this project leads to exponentially more amounts of technical debt.

I'm told that if I take this higher up they'll look at his experience compared to mine then just side with him.

:sigh:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Captain Capacitor posted:

My fury and frustration continues. This new developer has been here since January and has produced the equivalent of undergrad work. Yes, he has a lot of experience, but from over a decade ago. He hasn't updated his knowledge at all, and anything new to him is just heinous. Every moment this guy continues on this project leads to exponentially more amounts of technical debt.

I'm told that if I take this higher up they'll look at his experience compared to mine then just side with him.

:sigh:

Then your whole org is rotten, and you should probably get out while the getting is good.

brap
Aug 23, 2004

Grimey Drawer
Express your concerns in a direct and professional way. Start putting in resumes at other places. If they don't take your concerns seriously then take a hike.

Captain Capacitor
Jan 21, 2008

The code you say?
I tried one more time to reason with him. I thought my request was simple. All I wanted was to get a PM involved in this project so it can have a sense of direction. Maybe some user input.

His response was to insist that he doesn't want anyone else involved in the project. Or want me to send out a code review.

Code is verbatim aside from renaming to protect the innocent.

code:
MyLib.ValueLocationInList = function(mylist, theval) {
    var idx = -1;

    for (var i = 0; i < mylist.length; i++) {
        if (mylist[i] == theval) {
            idx = i;
            break;
        }
    }
    
    return idx;
};

Captain Capacitor fucked around with this message at 03:06 on Jul 15, 2015

baquerd
Jul 2, 2007

by FactsAreUseless

Captain Capacitor posted:

Code is verbatim aside from renaming to protect the innocent.

code:
MyLib.ValueLocationInList = function(mylist, theval) {
    var idx = -1;

    for (var i = 0; i < mylist.length; i++) {
        if (mylist[i] == theval) {
            idx = i;
            break;
        }
    }
    
    return idx;
};

Well, that is basically how you would get the index of an object in an array?

brap
Aug 23, 2004

Grimey Drawer
it's a goofy rear end reinvention of the wheel that a project manager shouldn't be spending time on.

Captain Capacitor
Jan 21, 2008

The code you say?
The entire library and project that he has produced is reinvention. He doesn't trust any sort of framework that he hasn't hand crafted. And there's no PM at all, that's the thing. I was asking for anybody else at all to take a look at the project.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Captain Capacitor posted:

Or want me to send out a code review.

If your organization doesn't immediately take him to task for not wanting to perform code reviews, you really need to get out immediately regardless. Do you guys not use source control either?

Adbot
ADBOT LOVES YOU

Captain Capacitor
Jan 21, 2008

The code you say?
He checked in for the first time since March to his "private" branch in Git. He says that as long as he's not checking in to the main branch he's not subject to code reviews.

Yup.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply