4 ms·
If he had that insight in 2011 then he was pretty late to the party. By then the 1K to 2K line limit for 'beginner programmers' was very well established. To g
by jacquesm 9y ago
If he had that insight in 2011 then he was pretty late to the party. By then the 1K to 2K line limit for 'beginner programmers' was very well established.
To go beyond that you need a few tricks of the trade, mostly structured programming and avoiding global scope will get you to 10K and up.
After 50K or so you will need even more tricks: version control will become a must, naming conventions matter and you're probably well into modularization territory. Some actual high level documentation would also not be a bad idea.
By the time you hit 100's of thousands of lines you are probably looking at a life-time's worth of achievement by a single programmer, or more likely you are looking at teamwork. And so you'll need yet more infrastructure around your project to keep it afloat.
You can see quite a bit of this at work when you browse through open source repositories at github, those are roughly the points at which plenty of projects and up being abandoned, as often as not through lack of insight in how to organize a larger project as through the demotivation that comes from lack of adoption.
- sasa_buklijas 9y agoagree, but it also depends on programing language. I do not see how 1K of C and Python lines are same.
- jacquesm 9y agoThat's true, and for languages even more dense the limits might be lower but it's 'order of magnitude' correct in all cases.
- fapjacks 9y ago... And then there's embedded programming, which flips this whole thing on its head, and a programmer's skill seems to be measured in how much smaller (more efficient) you can make your code while also keeping and improving clarity, security, maintainability, etc.
- jacquesm 9y agoThat's one reason why I love embedded stuff. I see all phone software as embedded stuff by the way, but the lessons do not seem to apply at all!
- fapjacks 9y agoPhone software as in, like, smartphone software? The phone in my pocket is literally more powerful than the PS4 I bought last year. 8GB of RAM, 128GB of flash storage, 8-core 2.45GHz 64-bit ARM processor. Meanwhile, a couple of weeks ago, I had to add a new feature to firmware that was already using just under 900 of the total available 1024 bytes of program space.
- jacquesm 9y agoYes, and you need to charge it daily because it uses as much power as it does.
- photojosh 9y agoBefore smartphones, we didn't use to spend hours a day with our phones on. They're not big phones, they're mini computers.
- fapjacks 9y agoYeah, historically I have tended to agree with the parent's posts on HN, but here I couldn't disagree more. Our phones are definitely closer to small workstations than embedded devices. Not only because of the available resources, but because of things like application portability. I can take an apk for my phone and run it on every other Android device on the market running a compatible API. The fact that it runs Android in the first place makes it too general purpose to be an embedded device. Now, if the parent had said our old-style brick phones were embedded devices, I would agree with him there. But not smartphones.
- photojosh 9y ago
- lmm 9y agoAs I understand it the evidence is, surprisingly, just the opposite: defect rate per line of code is the same, independent of which language you use.
- a1369209993 9y agoI don't think that's particularly surprising, and in fact that's the other half of the point: a 2K 'beginner program' in haskell or lisp could do all the work of a 50K C or java program, but because it's so much smaller, you have/need much less support structures and, yes, much fewer total defects.
- lmm 9y agoMy intuition is that code with 2kloc "worth" of language constructs would have the same defect rate across languages (and you can get a lot more done in n constructs in some languages than others), but that code using shorter identifiers or symbolic operators should have the same defect rate per "construct" i.e. a higher defect rate per line. But AIUI the evidence doesn't bear this out, and the per-line defect rate in APL or Perl is the same as in other languages.
- Joeri 9y agoAs programmers we like our lines to have a given level of cognitive load, depending on personal taste, so regardless of the language you’ll end up with on average the same number of language constructs per line. In high level languages those constructs do more than in lower level languages, but since they are already debugged the defect rate per construct is not higher, ergo the defect rate per line is also stable across languages.
- lmm 9y ago> regardless of the language you’ll end up with on average the same number of language constructs per line I'm saying this isn't true. APL is the extreme example, but languages vary quite a lot in how many constructs you can and do cram onto a single line.
- DougN7 9y agoIn my younger years I wouldn't have believed this, but after having shepherded a project from 0 to 500K lines over 15 years, it's amazing how accurate you are :)
- Joeri 9y agoSame here. I learned on the go how to grow a project from 10k lines to 1 million lines, and the insights of how to scale largely had to do with team dev practices and modularization. Eventually I learned to decompose back into multiple independent code bases developed by separate teams communicating through documentation and bug trackers and now I would avoid growing a codebase up to 1 million lines.
- cousin_it 9y agoI think you need only one trick to develop projects of any size: find big chunks with narrow stable interfaces and split them off as libraries. Unfortunately many developers prefer to use a slightly different trick: find similarities between different chunks and extract them as common interfaces. It makes you feel smart, and sometimes even works well, but usually it leads to framework disease. Library style is simpler and scales better than framework style.