Two hundred and eighty thousand
Yesterday I had occasion to implement a clone of an existing piece of software. It took me about 20 minutes, just by bolting together pieces of code I'd already written. This struck me as odd, not because it's unusual, but precisely because it isn't; I increasingly seem to be finding that when I want to write a program I usually have quite a few already-written bits and pieces that I can use to make the job easier. That's bits I've written, not including any third-party libraries.
Last week, someone told me that when he writes new programs, he often finds himself reaching for bits of code I've written which happen to be the right tool for the job. So I got to thinking: I must have written quite a lot of code in my time for this to happen so often.
So I've now gone through my source code directory on my main computer, catalogued everything in it, and counted how much there is. The result is a rather staggering two hundred and eighty thousand lines of code. That's around 280,000 lines of code that I've not only written, but still have and can re-use at need; it doesn't count stuff I wrote on Spectrums, BBCs, Amigas, strange CP/M machines my dad brought home from work, and suchlike.
280,000 is a hell of a number. I recently wrote 3000 lines of good working code in three days (while on holiday from work, so that was full time rather than evenings), and at the end of that time I could tell I'd achieved a peak of coding performance which I rarely hit at all, and I could also tell that I couldn't have sustained that rate for much longer than those three days. So 280,000 lines of code would have taken me the best part of a year to write, even if I'd been coding at that flat-out rate constantly! In fact this stuff is code I've written over about the last ten years, which makes it a believable figure; but even then, I have to take into account the fact that this is only code I've written on my own time, and doesn't count stuff I was employed to do or did as part of a university course. The bottom line is, I wonder how I ever managed to have a social life at all! :-)
Of those 280,000 lines of code, 150,000 are in programs I've actually released. A further 71,000 are in programs that are basically usable, perhaps lacking a little polish and full documentation or (in one case) unpublishable for copyright reasons, but not too far off being release-quality. That accounts for nearly 4/5 of the total, which is a rather satisfying thought; only about a fifth of my free-time coding output is seriously unfinished, flawed, abandoned or otherwise unusable. I call that a pretty good percentage: I was expecting a far higher proportion of write-offs.
Of course, now I find myself wondering whether I ought to polish up the 71,000 lines of nearly-releasable code for publication, just in case anyone might find it useful for something. Perhaps I should at least make a list of all the things I could publish if there were a sudden need for me to do so.
no subject
no subject
(Oh, and "hello", by the way. Very long time, no see.)
no subject
No, I haven't got the password file, at least not that I can find. However, I do still have all the tools we used to get hold of it :-) And I've also done a PS2 Linux conversion of the son-of-Tron game we played when we weren't doing that, which has been good for a few laughs round here.
no subject
For the past few years I've kept bumping into people on the periphery of the Cambridge crowd who've claimed to know you (I stumbled onto your LJ via
(That and my brain immediately said "I know this person" when I was downloading PuTTY - for which thank you very much, by the way.)
Can you still do the "lob a cage backwards over your shoulder" trick on a PS/2 controller?
no subject
I think you mean PS2, not PS/2 :-)
And yes, good grief, of course you can do that trick. It'd be a pretty poor conversion if you couldn't!
(The PS2 version makes use of the ludicrous number of buttons available on the controller to allow you to have multiple weapons and special functions available at one time, rather than only one of each as on the Beeb - there's a configuration screen where each player gets to independently bind weapons and functions to all eight of the fire buttons. This alters the game balance quite a lot if you allow unrestricted choice by both players - suddenly you have to start thinking hard about which weapons are better than other ones, rather than just giving both players the same one and trusting that the intrinsic symmetry will ensure fairness. On the other hand, cloaking and teleportation and extend-range can be a devastating combination...)
no subject
no subject
"I tend to break up a subprogram when there are too many local variables. Another clue is [too many] levels of indentation. I rarely look at length." -- Ken Thompson
This sprang to mind because your code is obviously very modular, if you can just reach for it and re-use it. Which is a good thing - I'm sure a lot of my code is crap, because I'm a sysadmin at heart and not a developer. I develop for fun, not as a career, so I don't get much time to develop anyway. :-(
The quote also reminds me that LOC is a poor quantifier of code quality. In a program of mine, I recently replaced ten lines of code with five (or thereabouts) - and it became not only faster, but also far simpler to maintain in the future. If my code can be tuned like that and remain functional, then your code must be quite phenomenally functional by comparison. And the fact that you're re-using it would suggest that its functionality is far more impressive than its LOC count.
That gave me a thought which brought me onto the second quote, really:
"One of my most productive days was throwing away 1000 lines of code." -- Ken Thompson
You must have had some phenomenaly productive days and weeks, just throwing away code you've long since forgotten about so that you can re-write it. That'll bump up your total a bit, too.
Hmm. The accolade of "Best developer I ever met" used to go to a Director at a company I worked for. But now I think about it, you're at least as strong a candidate as he is...
(Don't get that excited. I don't meet many developers. *grins*)
Saint-Exupéry put it best
Re: Saint-Exupéry put it best
no subject
no subject
The biggest two contributions I can think of are the basic structure of PSCP and the Unicode enhancements, each of which is in the region of one or two thousand lines.
Oh, and there's the Mac port, which weighs in at nearly 10,000 lines that I didn't write any of; but that isn't working yet :-)