Talk:Source lines of code

Unnamed section
When discussing the comparison of quality of code produced by different programmers, the term "productivity" is used where another term, e.g. "efficiency", may be more appropriate. This assumes that the definition of "productivity" skews towards quantity, i.e. to be more productive simply means to produce more output, whereas the context skews towards efficiency, quality or some analogue which suggests the concept of "doing more with less". Then again, the discussion actually considers two aspects: two different code artifacts written to do the same task, and the different qualities of the respective programmers who produce the code artifacts. What is a good term to describe a worker who is good at producing higher quality products or tools? More specifically, what is a word for the measure of said ability? "Productive" is not a good word for that measure.

Perhaps the distinctions between using SLOC to estimate software complexity, the measure of software quality in general, and the measure of programmer capability should be made more explicit.

-

for (i=0; i<100; ++i) {printf("hello");} /* How many lines of code is this? */

Why is that ambiguous? Because it has more than one semicolon? -from a non-programmer


 * I would say one line of code. When counting lines in a large program it is usually done mechanically (i.e. by a program), so it isn't going to think it the way a person would.  If it were reformatted it would count as two lines.  That is why SLOC is a rough estimate.  The question is whether the above sample line conforms to the formatting standards used by the shop it was written in.  Since printf("hello"); is pretty simple I think it would be OK, but since it is so simple this is a somewhat contrived example. (sigh...I just realized I hedge so much that I nevger actually said anything...) RJFJR 01:37, August 10, 2005 (UTC)

The SLOC table for Windows appears to be very wrong (see this comment on Larry Osterman's blog):

"That wikipedia page is kinda funny. According to it, "Windows NT 5.0", released in 2000, contains 20M lines of code, whereas "Windows 2000", released in 2001, contains 35M.  ::scratches head::

In fact, all of the "years" are completely wrong. Windows 3.1 in 1990? No, 3.0 was 1990. 3.1 was 1991 or 1992 I think. "Windows NT" (no version) in 1995, Windows 95 in 1997, NT4 in 1998, and so on. The table is prefixed "According to Gary McGraw." Wonder where that guy got his info from? I'd hardly believe his LOC counts if he can't even get the years right."


 * I've changed the table to use the values from Andrew Tanenbaum's "Modern Operating Systems" book. Unfortunately, this only covers the NT line, not the Win 3.1/9x products. Does anyone have accurate figures for these? Bakery2k 11:48, 25 March 2006 (UTC)

Quote: "With the advent of GUI-based languages/tools such as Visual Basic, much of development work is done by drag-and-drops and a few mouse clicks, where the programmer virtually writes no piece of code, most of the time." - that is one of the most asinine things I have ever read. It sounds like a hippy ideal from the mid-70s of 4GL languages. Where is my jetpack? They promised me one by now!!!

Programs for counting lines of code
I think this section deserves to be removed. This is an uncommented collection of links that does not provide any help and does not belong into wikipedia. 84.191.231.103 21:17, 10 November 2006 (UTC)

I agree. Vorratt 01:10, 31 December 2006 (UTC)

I'm uncertain why you think this is inappropriate for Wikipedia (and I'm not sure I understand Wikipedia's goals and rules well enough to judge that) -- but it'd be a shame, as this kind of information is awfully useful for researchers who want to study this subject. -- Terry Hancock

The section probably should be split out into a separate topic, since (using the recent change by Dinker Charak as an example), it has turned into a list of links to programs written by people who want to advertise their work. If it were only that, I'd join the mob and add a link to c_count, for instance. There are many such programs Tedickey 12:22, 8 September 2007 (UTC)

COBOL
The COBOL article has a much shorter Hello World, so what's the deal with that 17-line beast in this SLOC article? -j.engelh (talk) 21:39, 28 January 2008 (UTC)
 * There's a discussion of this at Talk:COBOL. The 17 line version is a particular dialect of COBOL once used on CP/M. (I think similar variants are not uncommon; when I briefly touched on COBOL many years ago at school, I'm pretty sure we were told all the division declarations are mandatory even if they are empty, just as seems to be done here.) Since the point of the example is to show that languages can differ greatly in verbosity, it seems perfectly reasonable to use an especially verbose variant so long as it isn't contrived -- although perhaps we should label it with the actual dialect name, to avoid pointless offence to much put-upon COBOL supporters. Actually, I think a strong argument can be made that the "short" example is far too long; after all, there are plenty of quite common languages in which "Hello World" is a one-liner.


 * Having said all that, I think "Hello, world!" is not a good example. In nearly all high-level languages the core functionality of "Hello, world!" is a single statement, so any statement count over 1 is actually a measure of the amount of syntactical cruft required to get a program up and running at all, which is not necessarily a good measure of verbosity for particular tasks. It might be better to use an example which actually highlights the strengths and / or domain impedance mismatches of particular languages. (And to avoid someone complaining, "yes that's hard using built-ins, but company X sells a library extension which solves it in one command!", we might specify no libraries outside the standard distribution.)


 * From a real-world task in which I have personally seen massive difference in verbosity of seriously proposed solutions, I would suggest something like parsing a web server log file in Common Log Format to count how many unique IP addresses have hit the server during the life of that log file (i.e., how many unique values are found in the first field of each line.) Hopefully this would be short enough to fit into a readable example whilst still being a reasonable, not-too-contrived example. Perhaps if someone could try this in Visual Basic (a practical and popular language, but one I've found rather impedance mismatched for this sort of task) and we can compare it with my rather simple example in a language optimised for line-oriented text processing. -- 203.20.101.203 (talk) 06:52, 7 July 2009 (UTC)

Hi Everyone. I love COBOL and I created an account to edit this page. This program compiles under GnuCOBOL. The 17 line example is a terrible example of this modern and enjoyable language

identification division. program-id. hello. procedure division. display "hello wolrd" goback. end program hello. — Preceding unsigned comment added by HalfMadDad (talk • contribs) 18:44, 23 April 2017 (UTC)


 * the last line is unnecessary as nothing is executed after goback 2A02:1406:F:86D5:0:0:3A07:E564 (talk) 12:17, 28 September 2023 (UTC)

Bill Gate's citation
Is there any source for Bill Gate's citation? 130.232.32.155 (talk) 13:21, 21 January 2009 (UTC)


 * apparently (I googled it a while back, and iirc it was attributed to Business @ the Speed of Thought - but I don't have a copy to verify that) Tedickey (talk) 13:31, 21 January 2009 (UTC)


 * I found this plain text transcription, and if it is faithful and complete, the citation is apocryphal http://www.managementparadise.com/uploads_blog/43000/42898/0_9550.pdf — Preceding unsigned comment added by 89.2.141.30 (talk) 11:18, 5 November 2018 (UTC)


 * Someone also asked about this phrase on Wikiquote: en:wikiquote:Talk:Bill Gates. I searched Gates' book (1, 2, 3, 4), but I did not find the phrase or anything similar to it. Cheers, Manifestation (talk) 14:23, 7 July 2020 (UTC)

Geer quote
The page doesn't have much to do with source size (or even security). Just a rambling rant. TEDickey (talk) 20:59, 27 August 2010 (UTC)


 * I agree with the relevance of the statement. In general, the higher the complexity the system, the more things that can go wrong.   However, I also agree that more citation is needed.  A good quality software development and defect reduction process can do wonders if applied effectively.   This is merely a rule of thumb.   It seems logical, but SLOC doesn't necessarily translate to quality.--74.107.74.39 (talk) 01:55, 12 April 2011 (UTC)

KLoC disambiguation page needed?
The related term, KLoC, used to redirect to this article, but now it sends one to Poland :), and KLOC sends one to a radio station. I've added disambiguation links including this article and the third on both pages, i.e. However, I didn't feel comfortable adding parallel links to this page, as the main heading is SLoC, not KLoC. Therefore, my question is: do these three kloc pages deserve a disambiguation page yet?

q.v. Talk:KLOC Pdebonte (talk) 13:33, 1 September 2010 (UTC)

Relation with security faults
"A number of experts have claimed a relationship between the number of lines of code in a program and the number of bugs that it contains" -- IIRC D.J. Bernstein is a notable example, HTH anyone willing to dig a bit (somewhat busy right now). --Gvy (talk) 13:06, 8 July 2011 (UTC)

Uninformative introduction

 * Software projects can vary between 1 to 100,000,000 or more lines of code.

...doesn't say anything, does it? Andreas Lundblad (talk) 15:45, 19 April 2012 (UTC)

As a veteran programmer, I find the statement useful even though it indulges in a bit of hyperbole. I mean, really?? One line of code for a project? The lower limit might be very hard to define, but I guess it must start somewhere and I guess it is not impossible to start a project with one line of code. A 10$9$ to 10$10$ SLOC dynamic range seems reasonable. The only reason I even saw this article is that I am taking on a program I estimate at 10$4$ SLOC, and I want to estimate how much time I am committing to. Loyalgadfly (talk) 14:55, 27 February 2019 (UTC)

Subjective language
I take issue with this sentence:

"Using lines of code to compare a 10,000 line project to a 100,000 line project is far more useful than when comparing a 20,000 line project with a 21,000 line project"

It goes without saying that the ranges between these examples are on a different scale. But does that really relate to usefulness at all? If so, "useful" to whom?

What is "useful" is completely subjective. For example, someone working on a purposefully minimal codebase probably couldn't care less about the considerations of a larger project that they aren't working on.

Also does this sentence provide any kind of value or insight into the concept of SLOC? I don't think it does. It has very little surrounding context or relavence.

Consensus to remove/clean up/make less subjective?... — Preceding unsigned comment added by 81.157.211.54 (talk) 09:26, 4 June 2012 (UTC)

If there is anything this article could benefit from more, it would be a section on how LOC relates to different languages. It is a relative term, so relating "apples" and "oranges" is idiotic. But, used as a tool for relating relative efforts, it sometimes has its place. That said, programming is very much like writing prose. One can be succinct and say a lot in just a few words, as well as beating around the bush and never getting to the point. As in, "being paid to write by the 'pound'." Loyalgadfly (talk) 14:55, 27 February 2019 (UTC)

Debian LOC
Are there any updates for Debian 6 with respect to LOC. For Debian 7, wheezy, there seem to be some people who did the count in February 2012 http://blog.james.rcpt.to/2012/02/13/debian-wheezy-us19-billion-your-price-free/ which could be incorporated into the article. Greetings --hroest 13:54, 23 April 2013 (UTC)

Blank Lines
In the "Measurement Methods" section, there is a paragraph stating that blank lines are counted in physical SLOC. This, to my knowledge, is incorrect; I use Code Count at work and it doesn't count whitespace at all. — Preceding unsigned comment added by 199.209.144.220 (talk) 15:12, 22 January 2015 (UTC)

External links modified
Hello fellow Wikipedians,

I have just modified 3 one external links on Source lines of code. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
 * Added archive https://web.archive.org/web/20140223013701/http://blog.james.rcpt.to/2012/02/13/debian-wheezy-us19-billion-your-price-free/ to http://blog.james.rcpt.to/2012/02/13/debian-wheezy-us19-billion-your-price-free/
 * Corrected formatting/usage for http://www.h-online.com/open/features/What-s-new-in-Linux-2-6-32-872271.html?view=print
 * Corrected formatting/usage for http://www.h-online.com/open/features/What-s-new-in-Linux-3-6-1714690.html?page=3

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).

Cheers.— InternetArchiveBot  (Report bug) 05:07, 9 November 2016 (UTC)

Steve Ballmer Quote
In the "Disadvantages" section, the use of Steve Ballmer as an authority on writing code is like using Marie Antoinette as an authority on baking bread. I find it ironic that someone who knows so little about writing code makes such an insightful comment. But to use him as an authority totally discredits the article in the eyes of anyone who knows anything about the subject. Loyalgadfly (talk) 14:55, 27 February 2019 (UTC)