18
votes
How much "boilerplate tax" different languages have: a 400M LOC analysis
Link information
This data is scraped automatically and may be incorrect.
- Title
- Boilerplate Tax - Ranking popular programming languages by density | Ben E. C. Boyter
- Word count
- 1762 words
I feel like C#/C++/C are unfairly penalized by this metric
Most style guides put the opening and closing curly braces on new lines. That is a pretty hefty amount of the number of lines, but hard to call "boilerplate" at least as I use the term.
They explicitly mention not counting closing braces, so maybe...
I've really come to dislike the term "boilerplate code". I honestly have come to believe that most of the people who talk about it are greenhorns that don't know why it exists and write terribly buggy code that someone else has to fix.
To be clear though, I don't get that impression from this author. Now that I think about it, since I got off of reddit and the cesspool that was /r/programming I haven't really seen anyone use the term pejoratively....
I don't think unique lines of code is great for measuring boiler plate. Often boilerplate includes the name of the function, or class, or similar, making it not unique, but still almost copy paste. Also, is e.g. the try: statement in a try-catch boilerplate? I would say no, but it will be counted by this metric.
Right? I feel like
#include <stdio.h>could be considered boilerplate butreturn(true)should not be. Also some javascript weirdos like to do:if (true) { doSomeFunction(); }That's 75% "boilerplate" when it's functionally one unique line so long as
doSomeFunctionis a unique name.Judging this based on percentage of LoC is a terrible metric, and I'm not even sure ML tools are capable of knowing the difference.