Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Keep in mind the org stuff makes that config file look much bigger than it really is.

Though, 186 does sound surprisingly low if this is truly just 186 lines applied to vanilla Emacs.

My bindings file is a little over 200 (one binding per line). custom-set-variables block is 170. Total across a few files is around 3-4k. But some of that is config code, patches/modified versions of functions from other packages and simple wrappers. It accrues rather easily. Actual original code that does something non-trivial is probably below 1k.



sort by: page size:

Much depend on what you call "program", in "scripting" terms I've written very many, countless, most buggy limited wrapper but very useful time-savers, an example (witch was derived by many others similar, I can't remember them all, this is my version) http://ix.io/3Vbk like this I have around 20+ in use, some written years ago and left almost untouched, some evolved. In "config-as-programs" terms my Emacs config, witch is actually an elisp program is around 4800 lines, my NixOS config, witch is in Nix language, so another program, is a bit more than 1500 SLoC etc. If you means large WebApps, GUIs etc no, I've write some small GUIs and very few WebUIs for some relatives/friends but not for my own personal use...

We have an in-house configuration system that generates configurations for about ~14k heterogeneously configured applications (1-3x 3-20 line config file per app) and that system is has about 451k lines in it.

Of course not all lines are code. About 140k lines are flat file database of configurations, and the other ~300k lines is code/templates.

300k lines of code to manage 14k applications. lol.

------------------

Actually did a more thorough analysis cleaning out comments and what not. The database is more manageable ~86k lines and template generation code is around ~47k lines. There's a crap ton of whitespace and comments.


It's 10 lines here, 10 lines there. But they're not really 10 - in practice that's going to be 100 once you get past the most trivial use case and add good error handling. Then there are tests to make sure it works. Once you write all of those bits you need properly and start sharing it with your next web app and add some generalisation/config... you've created half a custom framework.

From the link:

> huge 3 GB file (3M 1K lines)

So, somewhat long lines, but not unreasonably huge.

For me, working on a nasty legacy codebase with 10-15k LOC classes - VS Code is slow enough with syntax highlighting that I pretty much need to use something else.


Not that much. Sorry if it sounded like a snide remark. I just thought the number was big and was trying to understand what those 80 modules of 10000 lines would be.

For comparison, Python 2.7.4 seems to have 400K lines of Python code.

    C:\Users\me\Desktop\Python-2.7.4>cloc .
        4233 text files.
        4130 unique files.
        1424 files ignored.
    
    http://cloc.sourceforge.net v 1.58  T=23.0 s (134.3 files/s, 54205.3 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Python                        2086          86198         107060         414941
    C                              548          50019          36839         369130
    C/C++ Header                   254           6514           9919          64470
    Bourne Shell                    39           6109           6235          38030
    m4                              19           1585            191          15172
    Assembly                        47           3659           4474          13733
    make                            12            500            360           3043
    HTML                            14            393             11           2336
    Teamcenter def                   9            173            162           2104
    Objective C                      7            102             70            635
    Expect                           7            115            178            545
    DOS Batch                       30             90            102            426
    CSS                              1             97             19            323
    C++                              2             27             18            134
    vim script                       1             36              7            106
    Javascript                       2             15             10             97
    XML                              4             57              2             73
    NAnt scripts                     2              1              0             30
    IDL                              1              0              0             24
    Visual Basic                     2              1              1             12
    YAML                             1              2              0              6
    -------------------------------------------------------------------------------
    SUM:                          3088         155693         165658         925370
    -------------------------------------------------------------------------------

Actually, it's just about 800MB of source code with 150MB of external dependencies. I never counted the lines of code until today but apparently just for the main language there are over 9 MLOC.

Of course, this doesn't actually matter as I don't touch most of the code and the "recently active" part seems to measure only about 275 KLOC. But when a bug arrives it might take me anywhere; even so, I don't think I've visited more than 35% of the codebase.


Some numbers: there are ~120kloc of Elisp in Emacs proper. I have nearly 500kloc of Elisp in my `.emacs.d`. Granted, some of it are reimplementations and wrappers around what is in the core, and some are plugins I downloaded, tried out and forgot to delete, but still, that's a huge amount of code. That's 136 man-years, according to sloccount:

    Total Physical Source Lines of Code (SLOC)                = 499,088
    Development Effort Estimate, Person-Years (Person-Months) = 136.18 (1,634.17)
     (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
    Schedule Estimate, Years (Months)                         = 3.47 (41.59)
     (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
    Estimated Average Number of Developers (Effort/Schedule)  = 39.29
    Total Estimated Cost to Develop                           = $ 18,396,178
     (average salary = $56,286/year, overhead = 2.40).
    SLOCCount, Copyright (C) 2001-2004 David A. Wheeler

Over 20 million lines of code even. But you only run 1.5 to 3 million.

800,000 new lines of code. No matter how you count them that’s a lot of typing.

My main project has 95 libraries and is nowhere near that massive.


62022 lines of code in a single file... is that a joke? :)

You must not forget that thanks to the preprocessor, what looks like 2000 lines may in fact be around 200k lines

E.g. I have a very innocent 2000-line MainWindow.cpp that weighs 244419 lines when measured with gcc -E -o - | wc -l


Quite a few of those ~1 million lines seem to be in libc-type wrappers, which is roughly analogous to libc for C (which also isn't included).

If I remove those the line count is about 100k, which is about the same as sudo.


A typical well-designed class will usually be a few hundred lines of code, tops. Often less than 100 lines.

9k classes * 100-300 == 900k-2.7m LOC

Not TOO crazy for the most complete standard library ever developed, for a language meant from the beginning to take over enterprise business computing.

How many LOC are in whatever meme language is hype this year? Hell, I feel like I see nearly that many lines of console output, when I run NPM to pull in dependencies, lol.


The size of a single module with say 50,000 automatically generated functions 3 to 10 lines each. You want to try it? ;)

> codebase of ~250k lines

In the same file? Holy crap...


8272 lines of code in a single file.

I guess you could talk about coding standards and code smells all day, but let's not. I'm impressed.


Is that all code or just the diff, though? 100k lines of code in diffs seems like a lot, all code - not so much.

The size of a code file doesn’t matter. What matters is the amount of state the code in the file manipulates. For example, a 100k line code file with 500 pure functions not using any global state is fine. It is simple. However a 100k line code file with 500 functions that all manipulate 1000+ global variables is extremely complex and hard to maintain because of the undocumented global state invariants and hidden side effects.

Really interesting story, approximately how many lines of code were in that codebase?

It's hard for me to imagine someone grokking a 10M+ line codebase without external help, but I've never tried it. I do agree with the assertion that most codebases are not as _special_ as they like to think.

next

Legal | privacy