Live data from Hacker News

Norris Numbers

teamten.com

11–20 of 28 posts

Re: Norris Numbers

#11
Wait, nobody has gone "Chuck Norris's Norris Number is 2.2 million!"? (I clicked on the title just because of Norris, I was thinking it was another Chuck reference.)

I can see the steps. I have and can crank out 2,000 lines of code. We see this all the time in hack-a-thons.

20K lines means a team and tools and some level of software control. Maybe a nod to architecture.

200K lines is a good sized project with a starting level of architecture first (maybe proceeded by throwaway prototypes) and then some serious software development methodology.

While the author writing 200K lines of code is cool, in today's business environment, that's not really going to happen. The cycle of prototype, code, build, test, (x2) then pivot and then repeat everything isn't a single programmer.

I've done 3GL / 4GL for a long time (Burroughs LINC!!) that promised that. And while it did turn 50 lines of LINC into 1000 lines of COBOL, there was a lot of though in those 50 lines. So I look at the current "10 lines of code in XYZ" I think "and I need 100,000 lines of libraries too".

Large code bases are not for the faint of heart of for cowperson coders. You may be able to write 200K of code, but it it can't be checked in and not break my build I can't use you.

Re: Norris Numbers

#12
More than 200,000 lines of kernel code support some little program, but I pretend they don't exist. For that reason, I think having a good abstraction or architecture is the key to breaking the 200K barrier.

Re: Norris Numbers

#13
At 2.000+ lines of code, you need abstractions. Picking good abstractions is hard. Experience teaches you which are good or not.

Above that, you need architecture. Picking a good architecture is hard...

Re: Norris Numbers

#14

Earlier quoted context omitted.

The traditional wisdom (backed by multiple studies starting decades ago) is that the language used doesn't statistically change the number of debugged lines of code per day, but may often change the number of machine instructions executed per line of high level code written. We are digressing here, yes? I read the article quickly, admittedly, but I didn't notice him doing language advocacy.

Yes, I'm digressing. Guilty as charged. Nevertheless, I think it's a somewhat-on-topic digression. If there's a wall at 2,000 lines, almost all language-advocacy examples are below that wall. That's the first wall. But language choice doesn't get interesting until you ask what the language does at the 20,000-line wall or the 200,000-line wall. Nobody talks about this when they advocate a language (except, as I said,…

It's worth noting that a big part of the Common Lisp spiel was that it was suitable for very large applications which needed to be maintained for a long time. So the two (terseness and large-scale development) need not be mutually exclusive.

(On the line of your point, though, maybe it's a shame that relatively-verbose languages like Ada and Modula-3 became social pariahs because their virtues are hard to demonstrate in the small.)

Re: Norris Numbers

#15

More than 200,000 lines of kernel code support some little program, but I pretend they don't exist. For that reason, I think having a good abstraction or architecture is the key to breaking the 200K barrier.

To rephrase: Maybe the key is how many of the 200K lines I can completely ignore. Even more, how many can I ignore while still depending on them.

Re: Norris Numbers

#16
Those order of magnitude milestones feel about right to me. They sound a lot like memory access patterns on a computer (L1 cache, L2 cache, L3 cache, RAM, disc, network), and I think it's for about the same reason: controlling the time to load something into the CPU. Except, in this case the CPU is your brain.

2k is the cache size of your brain. You can fit an entire program in your head. It doesn't matter how it's organized because you'll just load the whole thing.

At 20k, you can only fit part of the program in your head. But, it's small enough that you can be familiar with the whole thing. You need modularity so that making a change only requires loading a single 2k-sized chunk of the program, but you don't need much else to help you find the right chunk.

At 200k, you probably have multiple people working on it and you may often have to deal with "cold" code that you've never seen in your life. You need additional architecture and documentation to help you find where to make a change before you can even start learning the part of the code that needs to change.

You need the codebase to be organized defensively to prevent you from adding redundant features, or doing things that break the architecture. In other words, you need to be able to get work done with only a partial knowledge of the code.

At 2M, you have lots of people working on it, and the team has changed over time. The team is large enough that tribal knowledge is constantly being shed through turnover or forgetfulness. There are parts of the program that no one understands.

The code is likely old enough that it reflects multiple different architectural and process visions. It is no longer feasible for it to be entirely internally consistent. The idea of a global clean-up is off the table because it's too risky. At this point, it is like owning a castle. You work mostly as a caretaker of it. Instead of adding value, your job is to preserve the value it has accumulated over time. Additions are often at the edges: interfacing with new systems, etc.

Personally, I find ~20k programs the most fun. Big enough to do something interesting bug small enough to be clean and consistent.

Re: Norris Numbers

#17

Earlier quoted context omitted.

And that's exactly what's wrong with all the syntactic-sugar-based language marketing. "Write your code using X, and you go from 10 ugly lines of C++ down to 3 beautiful (if syntactically weird) lines of X!" Great. Now tell me how X scales on a 200,000 line project. One of the places people make this mistake is with Go. Go isn't designed to make your 2,000-line project shorter or easier. It's designed to make Google'…

The traditional wisdom (backed by multiple studies starting decades ago) is that the language used doesn't statistically change the number of debugged lines of code per day, but may often change the number of machine instructions executed per line of high level code written. We are digressing here, yes? I read the article quickly, admittedly, but I didn't notice him doing language advocacy.

The traditional wisdom and this article are mostly orthogonal.

To hit one of the complexity walls in this article you need to be consistently doing certain things right until your project becomes large enough that you hit new types of scaling problems. That isn't a day to day productivity issue. That's a project lifecycle issue.

That said, there are claims about how language features and project scale interact. People have strong opinions, but I do not think that anyone has studied this rigorously. That said, I know plenty of successful 2+ million line projects that exist in C. I've seen data suggestive that projects written in scripting languages fall apart at that scale.

So the traditional wisdom suggests that a 100k project written in Python will cost the same as 100k lines of C, and does more. However there are projects that you don't want to write in Python. Really.

Re: Norris Numbers

#18
Curious. I teach a second year undergraduate class in Australia, in which I put the whole class onto a single codebase, typically growing it from 1,500 lines at the start to usually around 60,000 lines by the end of term. (Possibly slightly less this term -- I've moved universities from UQ to UNE and it's a smaller class this time around)

I haven't noticed students hitting a wall in that process -- the code isn't always very good (they're students) but the groups generally get there with the code, and struggle instead with large merges, group dynamics, writing tests, etc.

This could be because I've already put the general architecture and build system in place before they start, but I wonder if there might be something else at play too.

(Well, or maybe they are hitting the wall, but as they need to do this to get through the unit, they scrabble frantically over the top of it...)

Re: Norris Numbers

#19

Curious. I teach a second year undergraduate class in Australia, in which I put the whole class onto a single codebase, typically growing it from 1,500 lines at the start to usually around 60,000 lines by the end of term. (Possibly slightly less this term -- I've moved universities from UQ to UNE and it's a smaller class this time around) I haven't noticed students hitting a wall in that process -- the code isn't alw…

Sounds like a good way to teach programming :) I would suggest that it's because you are putting the architecture in place. I work professionally in a code base that is hitting a Norris number and is suffering from little to no architectural direction in the past and some parts are very difficult to work in.

Re: Norris Numbers

#20

Those order of magnitude milestones feel about right to me. They sound a lot like memory access patterns on a computer (L1 cache, L2 cache, L3 cache, RAM, disc, network), and I think it's for about the same reason: controlling the time to load something into the CPU. Except, in this case the CPU is your brain. 2k is the cache size of your brain. You can fit an entire program in your head. It doesn't matter how it's o…

I've personally worked on code bases at these thresholds. Here is my resulting opinion.

A junior programmer can do A mid-level developer can do A 200k system is small enough for a senior developer to navigate and understand without significant documentation, and can be created by a small team. The architecture has to be clear, but you don't need specialized documentation. When it comes time to add or find something, the overall architecture and patterns will tell you where to look. You may land in unfamiliar code, but you will know that it has to be there, and roughly what it has to be. As for size, a small to medium company can run on this much code. For example I was at Rent.com when we were sold to eBay for over $400 million in 2004. This was about how much code we had.

At 2M, there are a lot of teams. You may have specific tooling just to help you maintain sanity. You definitely have documentation. There are so many people doing so many things that you cannot rely on people following key conventions, instead you are likely to try to enforce them. Examples of projects at this general size would be a browser like Chrome, a compiler like gcc, and so on.

What about 20 million lines of code? These are large projects carried out by large organizations over many years. Examples that I have seen include the current Linux kernel, Windows NT 4.0, and eBay circa 2006. The specialized tooling that was being considered for a 2 million line project is now required, and there is a lot of it. Documentation is extensive. Figuring out who to talk to to find out about something can be a struggle. And so on.

What about larger than that? There are few examples that have turned out well. The only person who I personally believe has done it well is http://research.google.com/people/jeff/, and I'm firmly of the belief that without him Google could not have become what they did.

As for what is fun, I personally like the 200k project size best. It isn't fun until you have the skills to contribute well. But once you do, you have the complexity while still having a team small enough that you can personally know everyone who is involved. But YMMV.

Post reply on HN