21

SLOC is the shittiest metric to exist.

If you're in software management, know that any of the numbers you've ever received (from me or anyone) for SLOC count are totally worthless.

"How many lines of code do you think you'll need to write to finish those features"?

"100000000000000"

Comments
  • 10
    A: it depends only on the following variables: the Programing language, the team size, the feature, the average intelligence of the customer, the weather, my horoscope, how many candles i need to make a 1:1 copy of the titanic. That would be the ones i can remember.
  • 2
    SLOC is still a thing somewhere? I last heard of it, no joke, in 1995 when I was in college learning all the theories of software development. In the real world, nobody ever mentioned it ever again
  • 1
    @stackodev 100% still is. Always told it's for a "quick and easy" metric to determine progress, but it ends up being the only metric.
  • 0
    I know LOC is lines of code, but what is the S?
  • 0
    @iam13islucky source lines of code
  • 1
    @DaveKram That seems needlessly specific, what other lines of code are there lol
  • 0
    @iam13islucky Just 2 acronyms for the same thing.
  • 4
    Ah yeah! What a metric. In the early days we were evaluated on our SLOC count, and the number if bugs we found in our code. I mean, we would get monetary compensation for each bug we found and fixed. And that, boys and girls, is why so much of the old code is spaghetti code.
  • 1
    Well, here in Brazil the standard metric used by the government to measure software is function points. It's pretty fair.
  • 2
    sloc rewards inefficient devs, and code generation tools. the most usefull metric I use is bugs per lines of code.
  • 2
    @magicMirror so is a "nothing works" bug with 10000 LOC better than a few typos in a 100 LOC codebase?
    @runfrodorun so should I convert my loops to recursion or vice versa? Should I make more or less functions? Should I create more similar functions or reuse more generic ones?

    All the metrics are crap. The only good metric is peer review but people don't like to rate their colleagues so the best way is to have a team leader who also codes a bit so he will know how to interact with his team's code and he will review them.
  • 0
    @solocoder I never said it was a good metric, only that it was better then sloc. Also, for your specific case "does not work" is not a bug measurement, unless it was fixed and then all was perfect. In the best case scenario bugs per lines is a negative number.
  • 0
    @magicMirror "where the bug is" is subjective. You are advocating programmers to throw blame around and say that their code is perfect and the issue is with the one who called them or the one they called. Also many bugs are design flaws, who will take responsibility for them?
    Also, taking responsibility for riskier and trickier code is discouraged by that matric and monotonous bolierplate is encouraged, plus if you have a bug, just write a few more lines of code and you're fine... Bugs/LOC means nothing...
Add Comment