# “A single individual” (Unix story)



## ProphetOfDoom (Nov 10, 2022)

_View: https://youtu.be/2oU6zEZafnQ_


This video came up on my YouTube feed recently. There was a quote that surprised me a bit: (at 8:20 ish):



> It has often been suggested that 1,000 lines of code represents the practical limit in size for a program which is to be understood and maintained by a single individual.


- John Lions

(Sorry, I cant figure out how to do the attribution on my phone.)

Question: _whose code are we talking about_? If we’re talking about _someone else’s code_, I think it’s a bit optimistic; I struggle enormously with other people’s code. In fact I’d say I have a phobia of other people’s code (real world code; examples in books I’m fine with).
But if he means _one’s own code_, I think it’s actually pessimistic, as I’m quite able to understand tens of thousands of lines of code I wrote myself.
I am totally in awe of how people manage to write filesystems and kernels etc., where they’re constantly dealing with other people’s code.
Also, isnt it a bit worrying if we’re all using software that nobody actually fully understands?
Related: how do you overcome a fear of “other people’s code” and how do you quickly get an understanding of some big project that’s split over dozens of large source files? I feel if I can’t break through this barrier I’ll never be a programmer.
(Thanks if you’ve read this far )


----------



## _al (Nov 10, 2022)

ProphetOfDoom said:


> ... how do you overcome a fear of “other people’s code” and how do you quickly get an understanding of some big project that’s split over dozens of large source files? I feel if I can’t break through this barrier I’ll never be a programmer.


When I exploring my own (or  other people's) sources in C/C++, I do :
`cd ~/the_project
exctags -R --langmap=c++:.cpp.c.h .`
and then "Ctrl-] / Ctrl-T" in gvim


----------



## kpedersen (Nov 10, 2022)

For code written by others, I actually find object oriented C code easiest to understand. Yes, the codebase can often be larger but it is "basic". Nothing can be hidden behind inheritance, no hidden code running in constructors, etc. I like objects but I don't like some of the (convenient) fluff that languages seem to include with them.

Tools like Doxygen, ctags, cscope and some custom scripts can be useful to get an overall topology of code, however sometimes just finding main() and tracing it to the nearest "while loop" is the best way to work out how an i.e game / simulation is designed.

Understanding code is difficult because personal bias and assumption often cloud the facts. However what I find to be the largest challenge is understanding someones shitty overengineered build system. That one is often the first I simply need to rewrite and / or personally maintain whilst I work on a project. Yes, Scons or waf might be "soooo coool" but just please use the same sodding current build system as the rest of the industry.


----------



## _al (Nov 10, 2022)

kpedersen said:


> ...However what I find to be the largest challenge is understanding someones shitty overengineered build system. That one is often the first I simply need to rewrite and / or personally maintain whilst I work on a project. Yes, Scons or waf might be "soooo coool" but just please use the same sodding current build system as the rest of the industry.


I almost always rewrite someone else's build system from scratch (I use gnu make with GMSL). If my developers are used to working in Visual Studio, for them I generate vcxproj/sln files from my makefiles using my own perl scripts to do this...


----------

