78
DP1306
6y

A method that contains over 9000 lines of code.....
Are there really production codebases out there with stuff like that? If yes I am scared as hell because I don't want to work with that kind of code once I graduate
Tell your stories!

Comments
  • 5
    Think of it this way what an opportunity for you to improve the code :)
  • 17
    Yes there are.
    Yes they are mostly uncommented.
    Yes the code in production has a good chance of not being in the repo, if there is a repo.

    And these are Fortune 100 companies.
  • 7
    I've never seen one quite that large but yes they definitely exist. I worked on an Android project several months ago that had a class with 4 methods in it and it was well over 1000 lines. All it needed to do was retrieve JSON from an api and convert it into usable objects. I was like seriously? There are libraries for this but you would rather do it yourself in the worst way possible? I fixed it and moved on.
  • 2
    At least it's in an own class
  • 0
    One method being that long is kinda rare but a lot of our stuff is in 7k line to 15k line files with that file doing the heavy lifting
  • 8
    Yes.
    And most likely they were written by some dude 10 years ago who has since left and all the documentation he left behind was a brief verbal overview to another dude, who also left 4 years ago.

    So basically working with these files goes like this:
    1) get a JIRA ticket on it
    2) open the file
    3) close the file
    4) close the ticket: won't fix.
  • 14
    Sorry , I had to...
  • 1
    @azous BRILLIANT 😂
  • 1
    Ye its still common but it is degrading..
  • 0
    Welcome to reality 😅
  • 1
    Because it was made for php?
  • 1
    @harrizsb
    I could write the same thing in c# to be just as long.

    The language isn’t the issue here.
    You will probably find this function has a shit load of switches dropped in via the array of args to determine what the PDF outputs.
  • 1
    Gah, there's even a closing php tag. 😬

    #BurnIt #KillWithFire
  • 2
    @T3hbeowulf closing tag?
    What is wrong with a closing tag?

    Only bad thing i can remotely think of is old editors that add new lines that could create header errors, surely your not using notepad to do php files?
  • 1
    Biggest seen here was a C++ function comprising 2800 lines. It read a file and saved data 🙂🙂🙂

    The funniest thing is since the data structures used made no sense and were totally random, it needed a 300 lines wrapper class with functions to correct the shit that dude made.

    It's still kept that way because atm no one has time to do that.
  • 1
    I have yet to see an implementation of java web services that wasn't a massive copy pasted uncommented memory leaking CPU eating hair-filled ball of shit. But holy shit those devs love them.

    Literally every job I've ever had was supporting systems that run this garbage. Java may have some good use on some faraway moon of planet Happy, but here on earth, it sucks my asshole with spicy mayo.
  • 1
    @C0D4 with php closing tags are really useless in an all phones file. Not only that but sometimes it can actually break applications (MVC frameworks for example)
  • 0
    @Froot wait your allowed to 'won't fix' the ticket?.. Damn if I would do that some people surely would get mad at me
  • 1
    @incognito Well not really 😄
    I was just being satirical 😄
    I think I have "won't fix"-ed one ticket but that needed some discussion with the PO aswell.
Add Comment