4
fuego
37d

For a little background on the sort of stuff I'm dealing with, check out my last rant.

Anyways, I'm testing this pipeline at work and was just reminded of the fucktarded way a "software engineer", who had a bachelor's biology degree, decided to handle a json file.

The script is question is loading a json file containing an array of objects. The script is written in perl. There's a JSON module. Use that? Fuck no! Let's rather perform an in-place sed command on the file substituting the commas separating objects in the array with newlines, then proceed to read the file line-by-line and parse out the tokens manually. Mind you, in the process of adding the newlines he didn't keep the commas, so now all of these json files his bullshit handled are invalid json that cannot be parsed.

The dumb ass was lucky the data in the file is always output upstream as a single line and the tokens for each object are always in the same order, so that never led to problems. But now, months later after I fixed his stupidity I am being reminded of it again as I'm testing and debugging some old projects as part of regression testing new changes I'm making.

TL;DR Fuck dumbwit motherfuckers who can't even google search "parsing a json file" and doing literally anything that is less fucktarded than manually parsing a json file

Comments
  • 0
    Why do you insult the guy who first wrote the code. Do you expect everyone to have the same knowledge level as you have in you specific domain? The guy didn't even study in your field...

    Put yourself in his shoes. Maybe he didn't even want to do that but had to in order to make the project work. Maybe performance or resilience of his code wasn't even a cirteria back when he worte the file.

    The bottom line is important...
    Does it work: yes.
    Is it performant enough: yes
    Is it possible for someone to read the thing and understand: yes, you did it.

    good enough for me.
  • 0
    @wonwon0 I'm glad it's good enough for you, but it isn't for me. That's the sort of software development practice that leads to systems breaking down the road for the simple reason of not following standards (or even googling how to read/parse a specific file format...).

    Also, let me clarify. Yes, this guy has a biology degree. However, at the time he wrote this bit of code he had been working at this company for 4+ years as a software engineer. He was responsible for writing and maintaining numerous pieces of software here. Sure, he was not trained in computer science, software engineering, or related for his education, but he became a software engineer by trade.

    Now, if this were some junior that did not know better and had not been responsible for so much development I would understand better. But he wasn't.

    Did it work? Sure.
    Did he have to do it this way for it to work? Hell no.
    Was it a ticking time bomb? 100%
    Was he a dumb ass? Fuck yes
Add Comment