38

In a project I worked on, there was an 800 line method!! :/

Comments
  • 10
    I recently worked on an Android project that had a class of 2000 lines and 4 methods in it... I got to refactor the crap out of it and it was glorious!
  • 6
    Recently I worked in a project that had all the persistence layer in one class.
    To use it, they'd call from wherever a "new DataManager().GetSomething()".

    The class had 8000 lines of code.
    Btw, it was a one-class project in VS, fml
  • 2
    Kill me now... existence is pain!

    But seriously, that's way too much code. Time to sit down and refactor!
  • 0
    800 line-methods... I mean, I've got a project going on with a total number of lines of 5000 or something but everything is beautifully split up (and for the most part, the code is self-explainatory. For the other parts, there are comments).
  • 0
    In my previous company the core functionality was implemented in a ~1400 lines method(the class had more)...this is about 30 word document pages.... Strangely enough the company was making too much money of this method!
  • 0
    Kill it before it breeds
  • 1
    I've seen 3000 line classes. Also methods with regions in as well. Whenever you are writing a region you should create a method...
  • 1
    That's cute. I've seen an 8000-line class with its longest method counting 1800 lines. Still have nightmares about that one.
    It also had random function calls.
  • 0
    I think everyone has such a method tucked somewhere in their nightmares. Mine was in VB.
  • 1
    I've seen classes with 8000+ lines of code. I am pretty sure some functions where roughly 1000-1200 if not more. I didn't really pay attention. The utility classes had over 7000 lines.
  • 1
    @ryanmhoffman it became your class
  • 0
    So much for DRY and SRP!!!
  • 1
    And this was in Ruby!! You write much less code for the same things as compared to Java!! So if you compare to java, make it 1600 lines!! ;)
  • 2
    @TomBombadill I puked a little thinking about a 1600 line method in java.
  • 1
    @dalastTomCruise Just imagine my disgust when i Looked at the code!!
  • 0
    What if I tell you I work on legacy code which has 30000 line code Class with 10-12 methods highest method being 8000 lines !
Add Comment