Is there any convention in the programming community on how the weight of a piece of code must be measured?
I keep seeing in various places such phrases like "This code is 3000 lines!", "That game is already over 5000 lines!", etc.
What kind of lines are those precisely? Does that normally include empty lines and comment lines (in AHK it will be like lines that start with ";" or multiple lines between "/*" and "*/") or does that number account for only the valid working lines of the code (the ones that can perform some action)?
If empty lines and comment lines are included, than it seems like the phrase "A code that is consisted of 5000 lines!" can mean merely a code of, say, only a hundred of lines with the rest of the code being merely comments, in which case the phrase would be almost meaningless to me.
How is the "weight" of a code measured? Topic is solved
Re: How is the "weight" of a code measured? Topic is solved
I count the total number of lines, including blank lines and lines containing comments.
In my opinion, the line count should not be used to define the worth/value of a project.
A SQL script can be written on multiple lines for better readability, however the same code can also be written on a single line. The code would produce the same result, yet one could be 30 lines while the other is only 1 line.
Clean code with proper indentation, formatting, and great readability should ultimately be the goal of a passionate developer.
Highly optimized code! Now that's something to boast about!
It's still impressive when a developer can optimize their code and use shortcuts to use the least amount of lines as possible.
"A full project, and it only took 55 lines of code! WOW! Awesome!"
If the code is already optimized, and still manages to be 5000+ lines, that's equally impressive!
In my opinion, the line count should not be used to define the worth/value of a project.
A SQL script can be written on multiple lines for better readability, however the same code can also be written on a single line. The code would produce the same result, yet one could be 30 lines while the other is only 1 line.
Clean code with proper indentation, formatting, and great readability should ultimately be the goal of a passionate developer.
Highly optimized code! Now that's something to boast about!
It's still impressive when a developer can optimize their code and use shortcuts to use the least amount of lines as possible.
"A full project, and it only took 55 lines of code! WOW! Awesome!"
If the code is already optimized, and still manages to be 5000+ lines, that's equally impressive!
Re: How is the "weight" of a code measured?
I see. Thank you for your reply!
Re: How is the "weight" of a code measured?
I would also include other files you might have to carry around with your script in the definition.
Recommends AHK Studio
Return to “Off-topic Discussion”
Who is online
Users browsing this forum: No registered users and 77 guests