28

Functions should not be 374 lines.

Comments
  • 1
    Does that go along the lines of database queries should not be 1000 lines long?

    Coz man do I do things wrong 😅

    Mind you it's quicker then collecting the data separately in different queries and doing the calculations 🤷‍♂️
  • 2
    @C0D4 ya know, at least that's a legitimate reason. I'm dealing with a case of the previous dev on this project never having heard the term "Object Oriented" in their life.
  • 3
    @OmgItBurns oh one of those.
    Yea those projects can be "fun" especially when the dev barely graduated to reusable code let alone OOP.
  • 13
    I write my entire application in one file in the main function. Fuck you!
  • 2
    Ok I'll remove all the line breaks
  • 1
    374 lines isn't bad provided that the control structures including if/else don't stretch out that much.

    My functions often have that length, but including comments , { and } on lines of their own, line break after variable declaration also within blocks, and line breaks between small blocks that are a bit like a paragraph.
  • 0
    Yeah... Wish my teammates read this someday...
  • 1
    at least split it into 10 functions that each one specialices in doing one thing right.
  • 3
    And here I am reading a class with more than 2k lines
  • 2
    Had debug a vb legacy function with +2k lines the other day
    If condition Then
    '1k+ lines
    Else
    ' the very freaking 1k+ lines with 1 extra line somewhere in the middle
    End If

    Ffs!
Add Comment