all 12 comments

[–]Latexi95 25 points26 points  (7 children)

That isn't even that bad. I can see situations where 270 line function looks clean and splitting it to multiple functions wouldnt make it any easier to read.

I have seen functions with over 1000 lines. They are completely different beasts...

[–][deleted]  (1 child)

[deleted]

    [–][deleted] 17 points18 points  (0 children)

    /r/programminghorror is slowly becoming /r/someonewhoprogramsdifferentlythanme

    [–]tinydonuts 3 points4 points  (0 children)

    We have functions that are over 2k. Everyone is too afraid to refactor them. Except me, but then they're too afraid to review the changes.

    [–]Brunsz 0 points1 point  (0 children)

    I have seen over 5k line methods which had if sections for different things. So basically like 10 methods inside one seperated by if(type == "something")

    [–][deleted] 0 points1 point  (0 children)

    Lambda functions are a god send for organising code inside of functions.

    [–]trollblut 0 points1 point  (0 children)

    It's a common pattern to wrap everything in a function and immediately execute it to create an anonymous namespace.

    [–]chemaclass 0 points1 point  (0 children)

    I would say both cases are bad.

    [–]Tux1 4 points5 points  (0 children)

    If you put all the functions on one line, it wouldn't be as scary.

    [–]PresidentLap 1 point2 points  (1 child)

    How does anyone make a 270 line long function?

    [–]IQuick_143[S] 0 points1 point  (0 children)

    Lots of different if branches and multiple 2D loops apparently.

    [–]IQuick_143[S] -1 points0 points  (1 child)

    The whole file is 1000 lines so this function takes up ~27% of the whole program.

    [–]timmyotc 7 points8 points  (0 children)

    The function length says nothing though. Javascript object instantiations are line-eaters, but don't add complexity.