How could the early Unix OS comprise so few lines of code?
It&#x27;s unsurprising when you consider that there are often several magnitudes of difference in code between what code grows to when you have the capacity and time and compounding user requests, and what a meaningful starting point that provides useful functionality above and beyond what you had without it looks like.<p>As an extreme example here[1] is an article by Brian Kernighan about a basic regexp matcher by Rob Pike.  The code, with comments, is 35 lines of C.<p>Meanwhile, the regexp engine in Ruby 3.2.2, not even including the Regexp class visible to the language, is ~20597 lines excluding the headers.<p>They are not reasonably comparable, of course. Pike&#x27;s code provides a very basic syntax which doesn&#x27;t even support character classes, and does nothing to speed up the matching. The latter supports a very much more complex syntax, <i>and</i> is far faster for repeated or long matches.<p>But while Ruby&#x27;s regexp engine is 588 times large than Pike&#x27;s code, you of course get a vastly higher boost in overall system capability from those first 35 lines of code (from no regexp matching to some regexp matching) than the last 35 lines of code, or indeed the second 35 lines.<p>So if you have a small system and a small team, you work with that and start small and it won&#x27;t be that surprising when you get a lot done in few lines of code, even though you have a long list of things you&#x27;ll add when you can justify the extra resources (like those missing language classes, and a billion other features)<p>(Then you get a larger system, and you&#x27;ll very soon find yourself wondering how you could manage with so little)<p>I think it&#x27;s mostly surprising because most developers today aren&#x27;t <i>used</i> to thinking about capacity constraints of small systems, and so starts designing for lots of features from the start (can&#x27;t have regexps without character classes, and capture groups, and back-references, and ...).<p>[1] <a href="https:&#x2F;&#x2F;www.cs.princeton.edu&#x2F;courses&#x2F;archive&#x2F;spr09&#x2F;cos333&#x2F;beautiful.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.cs.princeton.edu&#x2F;courses&#x2F;archive&#x2F;spr09&#x2F;cos333&#x2F;be...</a>