Musings on programming [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Mon 2006-05-15 14:10
Musings on programming

There's a thing I've always wondered about programming, which is what exactly it takes to do it.

I know a great many people who self-identify as computer geeks, many of whom have a formal computer science education and/or a lot of self-acquired knowledge. A lot of them know very large amounts about computer languages, about algorithms and data structures, about principles of software architecture, about testing and debugging, error handling strategies, and so on. But as far as I'm aware, quite a few of those people have never actually put their money where their mouth is, sat down and written a big useful program from the ground up. A lot of people are competent to fix bugs in other people's programs, to submit small patches, to analyse, criticise and compare, to script and to sysadmin, and to write small utilities, but very few seem to actually write programs in any serious fashion. So I ask myself, what is the quality which separates those of us who do do that from those of us who don't?

Because it's not anything in the above list. I'm pretty good with the detailed corners of the C language, for example, but there are people who know more about them than I do, and yet I write big C programs and they don't. There are people whose formal education in program design, architecture and development methodology vastly outstrips mine, and who profess shock and horror at the idea that (for example) I might leave any significant aspect of a program's design undecided until I get to actually writing that part of the program; but I write big things that work, and to the best of my knowledge they don't. I am forced to the conclusion that the quality which separates me and my fellow big-program-authors from these people cannot be that we have more skill than them in any specific aspect of the art and craft of coding so far mentioned.

So what is it?

Desire is one obvious explanation: that it's not a question of whether people can do the job, but rather a question of whether they want to. Perhaps many geek types haven't written any big programs simply because they haven't happened to come across a problem which needs a big program to solve it, which hasn't been solved satisfactorily already, and which they want solved badly enough to go to all that considerable effort. Me, I enjoy writing big programs, so it doesn't take all that much desire for a particular problem to be solved to motivate me to do so.

Willpower is another possibility: determination and staying power. Perhaps many people start large jobs, but not everybody manages to get to the other end of a long and hard piece of work without losing confidence and/or motivation and/or energy, and giving up.

Neither of those hypotheses is at all specific to programming; either would apply just as well to other fields of lengthy creative endeavour such as writing a novel. (In fact, the second one rather reminds me of NaNoWriMo, which I've known many people to start and very few to complete.) So now I'll list some possible programming-related explanations.

Perfectionism is a thought brought to my mind precisely by the fact that many people who don't write big programs know more than me about the theory of how to do so. Perhaps there's a sweet spot for the amount of perfectionism that it's good to have if you're going to write large programs. Too much, and your rate of code output drops too far and you can't write anything big at all; too little, and your code is unreliable and buggy and it becomes impossible to add more features to it because every time you add a new thing all the existing bits break. Perhaps somewhere in between there's a happy medium, much like the theoretical optimum taxation rate, and people who are able to write big programs are those people who happen to hit just the right degree of perfectionism.

Design is something I've alluded to above. If you don't design at all before you start, you'll run into dead ends a lot of the time and have to go back and do a big rewrite, and every time you do that you're taking a motivation hit and putting further strain on your limited staying power. So doing enough design in advance to avoid most serious-rewrite incidents is likely to maximise your chance of getting the thing finished, but at the same time doing too much can easily mean (and I speak from experience) that you never even get started on the actual coding. Perhaps there's a sweet spot to be hit here as well.

Method might have effects on the willpower issue as well. When I write a big program, for example, I tend to start with a lot of foundation and infrastructure layers which don't have much in the way of visible or tangible functionality, so often I can sit there and write code for weeks before I see so much as a ‘hello, world’; that's a stage that I need a lot of willpower to persevere with. At some point I move into a stage where I'm writing code that adds clear and obvious functionality to the program; this stage typically goes very fast because a lot of the functionality was there in the infrastructure layers and merely needs enabling or invoking, meaning that this stage is particularly easy, and also particularly motivating and fun.

One of my contemporaries at school thought this was odd. ‘When I write a program,’ he said, ‘it starts off doing nothing and gradually does more and more as I keep typing. But your programs do nothing for weeks and weeks and then suddenly they do everything!’ I've learned through the years that my approach works well for me, but it seems likely that if that guy had tried the same approach he might well have lost motivation long before reaching the point of seeing any worthwhile results. So I wonder if picking an approach that works for you is important, which in turn hints that self-education might have a natural advantage over externally applied training.

Memory is the last of the options I've thought of. There are two things you have to be expert on when writing a big program. One is all the fixed stuff you learned in computer science (or wherever else you picked it up from): the details of the language and OS you're using, how to write efficient algorithms, not forgetting that testing is a good idea, that kind of thing. The other is just as big a body of knowledge, but you invent it all yourself. This is the knowledge of how your particular program fits together: what modules or objects exist, what their relationships are, how many copies of each one there might be, whether there are threads, how control flows … Anyone writing a large program has to essentially create an entire field of study, an entire thing that you can be an expert or a novice in, from the ground up. And if you don't have the mental capacity to be an expert in that field, you cannot do expert-level work on your own program; so this hypothesis would imply that there's a limit to how big a program any given person is usefully capable of writing, and that limit is set by the amount of state they can hold in their head about stuff they've just made up.

Of course, you can work to reduce the amount of state you have to maintain in your head; this is a large part of what things like modular design are all about. So perhaps by careful modular design you reduce the amount of stuff you have to keep track of to O(log N) rather than O(N). It's still the case that a 20,000-line program could require you to store five or ten times as much mental state as a 200-line program; that's not nearly as bad as one hundred times as much, but it still leaves plenty of scope for going over your personal limit.

So with this many explanations, it should be clear that my problem is not a shortage of possible answers (although if anyone has a plausible one I've omitted, I'd be interested to hear it). My problem is that I have so many of them that I don't know which is right! It could, of course, very well be that all of the things I've mentioned are true to some extent; but I'd really like to know whether that's the case, or whether one is more significant than the others, or whether half (or all) of the things I've listed are complete drivel.

Because after I find out the answer to that, what I want to know next is how you teach the ability to write a big program that works properly. It seems to me that knowledge of specific things like Unix or C is widespread, the ability to tinker with an existing code base is reasonably common, and the ability to talk endlessly about the theoretical basis of programming is in plentiful supply from the graduate pool of any half-decent university; but the skill and/or will to bring all those things together and get an entire job done is regrettably rare, and the world could do with more people who could do it.

I apologise, incidentally, for the somewhat self-congratulatory note in this entire piece of writing. I've hesitated to write any of it down for a while, because it smacks so much of ‘I'm great, and nobody else is’; but I think it is undeniably true that I am capable of doing a particular type of useful thing, and that many other people are not, and I am curious to know why. It doesn't make me or people like me better than everyone else, of course; many of those other people can do things I can't. (Some of them even manage to be attractive to women once in a while, for example. :-)

So I'm interested in comments from anyone who's still reading. If you consider yourself to be somebody who can and does originate large software projects which succeed, then do you have any idea what might be the key skill that makes you able to do that and other people not? If you've tried to do so and failed, what was difficult about it? If you've shied away from trying (for anything other than a really obvious reason like not actually knowing how to program at all), why?

LinkReply
[identity profile] ex-lark-asc.livejournal.comMon 2006-05-15 13:21
My 2p as a non-hacker outside observer is that you're very pragmatic - so you don't get caught up and immobilised by theoretical arguments - and you're motivated by a Cause, so you have the initial energy to overcome laziness. You write useful programs for the sme reason Ross volunteers at the airfield or does pretty hardcore DIY jobs round our flat: you get a kick out of knowing you're being useful.
Link Reply to this | Thread
[identity profile] crazyscot.livejournal.comMon 2006-05-15 18:27
s/volunteers/gets paid minimum wage/, but that's so close to moral equivalence...
Link Reply to this | Parent
[identity profile] naath.livejournal.comMon 2006-05-15 13:26
I'm not very good at programming, I'm certainly much much worse at it than you. I feel that with effort, willpower and a good manual I could write giant programmes - I'm learning so it'd take a lot longer for me to do that it would someone competent and the result would be full of stupid bugs but I could probably have a go at it. The main reason that I never *have* decided to have a go at it is that there is nothing that jumps up and down at me and says 'write me' - it would need to be something I want a solution to not something someone else wanted (because I'd take forever over it and my solution would suck) but something that was sufficiently motivating to get me to direct Time And Effort at it.
Link Reply to this | Thread
[personal profile] simontMon 2006-05-15 13:31
*nods* Yes, I'd certainly agree that a problem you personally want to have solved is a lot more motivating than one that somebody else would quite like to see sorted out.

I'm not entirely sure where writing-for-pay comes into all of this, come to think of it; I've mostly been thinking about it with my free software hat on, in which motivation versus time and effort and hassle are about the only factors. Presumably there are people who find that they're quite capable of originating large projects when being paid to spend seven hours a day doing so, and just don't feel like doing it again when they get home.
Link Reply to this | Parent | Thread
[personal profile] sparrowsionMon 2006-05-15 13:46
Writing-for-pay definitely makes a big difference for me. Programming is what I do for a living. I want to do something different as a hobby, so pretty much all the programming I do not-for-pay is one-off scripts to solve a specific problem, and work don't pay me to write entire programs from the ground up.
Link Reply to this | Parent | Thread
[identity profile] beckyc.livejournal.comMon 2006-05-15 14:06
Yup, same here.
Link Reply to this | Parent | Thread
[identity profile] dennyd.livejournal.comMon 2006-05-15 14:27
A tentative third for this line of reasoning - could this be 'need for variety' maybe? The more interesting my work coding is, the less desire I feel to hack on my own projects in the evenings - I'd rather spend the time juggling, spinning poi, or other activities that are quite different to what I spent the day doing.

However, coding is quite probably my favourite hobby - so if work is being dull then I start to need to do something interesting with code in the evenings to feel like I'm still indulging.
Link Reply to this | Parent
[personal profile] rmc28Mon 2006-05-15 16:48
I think my one 'big program' was the University Card web interface, and it was *hard* work to do. If I'd been doing it for fun there'd have been no chance, but I had a small team of people utterly depending on me doing it and doing it properly, and it was what work were paying me to do, and so it got done.

I think on the whole I do prefer fixing existing things, or planning out "what needs to be done" given a problem than coding things from scratch. Certainly I've not really missed not having another huge project to write from scratch on my own. I've learned that I'm very dependent on feedback for motivation and "this needs to be fixed right now or bits of the university can't do their jobs" is fairly strong motivation.

My two non-software 'big projects' (2002 DWCon Gala Dinner, my wedding) both struck me as being 'just good enough' rather than having everything in them (in terms of the process and organisation) that I originally thought of. For both, I did have a good overall design, but I didn't implement every bit of it and some bits were frankly slapdash and only rescued by the efforts of other people.
Link Reply to this | Parent
[personal profile] mair_in_grenderichMon 2006-05-15 13:32
I'm not sure how large is large. The largest things I've written have been projects for university dissertations (final-year undergrad, and masters). Neither of these are really big.

After that there have been a couple of things which I started expecting to take an afternoon, and went on tweaking and bug-fixing 16 hours a day for the next two weeks, which is a reasonable of coding time.

The problems I have with facing genuinely large projects (and there are one or two ideas I have had which I might have implemented if I had been... someone else) are

1/ the willpower/staying power/whatever: I'm bad at starting things for which I won't see results. Also, I tend to work in bursts; if I had a month off and no particular plans for it and was in a staying-in-and-doing-mental exercise kind of mood (rather than the bursting out and going to find hills to cycle up mood I'm mostly in at the moment), I might start on a large project. If I thought I was only going to work on something on saturdays, well, I wouldn't bother with things one week to the next

2/ I'm bad at the design. The two dissertation projects have both featured me trying to design the system, struggling for ages, giving up eventually and getting stuck in, writing *something*, finding it needs quite a lot of restructuring/reshaping (and not really having time for that as deadlines approach). This makes it quite hard to get started on things, as getting stuck in "somewhere" isn't terribly nice if you don't have a shape or routemap in your head. For me...
Once I work it out, I really *like* nicely structured large projects. Neat designs make me happy by existing.

3/ Ya, memory. This is why I work in bursts. I can collect a *lot* of information up in my head as I work on something, know how it all works and how it fits together. ... but if I then go on holiday for a few days, say, and come back to it, it's hard to pick up again.

I also have more of a mentality of getting-things-working with the intent to come back and nice them up later, my code is commented with things like "TODO: this assumes...", or "MING! this only works if..", or "DANGER: ... ". As the program grows this build up of dodgy crud becomes nastier and nastier...

Doesn't sound like I'm saying anything outside what you've thought of, then.
Link Reply to this | Thread
[personal profile] simontMon 2006-05-15 13:47
I'm giggling quite a lot at the comment that begins "MING!". :-)

But yeah, these all sound like things from my list. I hope enough other people comment that I can pull together a generalised idea of which ones seem to be the popular ones to cite.
Link Reply to this | Parent
[identity profile] marnanel.livejournal.comMon 2006-05-15 13:39
Funnily enough, I've spent much of my life writing big programs mostly on my own, but I'm now trying to collaborate. I think I can be more useful that way.
Link Reply to this
[identity profile] the-alchemist.livejournal.comMon 2006-05-15 13:46
I think all of the points you made apply to writing a novel. Did you mean to imply it was only the first two?

Strangely, since I don't think of myself as having all that much willpower, I can't imagine starting NaNoWriMo and not finishing.
Link Reply to this | Thread
[personal profile] simontMon 2006-05-15 13:50
I expected the later points to be more programming-specific than the earlier ones, but yes, now I look at them I don't see any reason they couldn't apply just as easily to other fields if you changed a couple of words here and there.

I would have guessed that the memory issue in particular would be a lot more significant in programming than in novel-writing, but then I have no actual experience of novel-writing so I'm entirely willing to believe I'm wrong!
Link Reply to this | Parent | Thread
[identity profile] the-alchemist.livejournal.comMon 2006-05-15 13:54
I'm not sure. I try to keep comprehensive notes about when Aunt Emily met the jailer, and what her favourite kind of beer is etc., but I'd go mad if I didn't hold most of that information in my head. Writing novels would be very tedious if you kept having to refer back to notes. It's probably less significant, but not all that much so.
Link Reply to this | Parent | Thread
[identity profile] philipstorry.livejournal.comMon 2006-05-15 19:03
Memory certainly applies, and in that respect programming is somewhat like writing a novel.

However, unlike writing a novel, I rarely have a need to write the story. Lots of my programming is purely pragmatic - all of my writing is, um, cathartic. :-)

There's an interesting crossover there for me - I've got an idea for a project which is basically a huge "writer's pad", making the act of taking and porganising your notes on characters/places/people REALLY easy.

The problem is figuring out how to store the data - which is much harder than it seems, given the very free-form way I'd like to present and use it. And paper pads are cheap and easy to search - as is a big ol' text file. (The Windows text editor might be called Notepad for a reason, you know!)
The personal cost of developing the ultimate writer's notepad just doesn't outweight its benefits for me... *sighs*
Link Reply to this | Parent | Thread
[identity profile] the-alchemist.livejournal.comMon 2006-05-15 19:08
Have you tried Newnovelist? I'm not convinced it's worth the full price, but I picked up a [legal] copy for about a fiver on Ebay and I find it quite useful.
Link Reply to this | Parent | Thread
[identity profile] philipstorry.livejournal.comMon 2006-05-15 19:20
I bought it at the full price.

The main problem I have it that NewNovelist is *very* focused on getting you to write a specific kind of story. That's very frustrating for me, really - it doesn't seem to fit the way I want to write. I can understand that it's doing it to try to make my story better - but it's also forcing me down a very narrow lane.

I like to write in a fairly free-form way, in which my characters just create the story around a very skeleton plot. So I don't know much about the story as it starts, and won't until it's in progress. NewNovelist makes me feel like I should have all my characters, all my events, all my places and all of my story written already before I use it.

It wasn't a complete waste of money - it reinforced ome good writing patterns, and I learnt the idea of specific story types from it. But how well do you think it copes with Space Opera? Or with a P. G. Wodehouse-ian drama? The damned thing's designed for chick lit and detective novels, and that's about it. :-|

*ahem*

Sorry. Got a bit ranty there. But thanks for the pointer, and maybe I should re-install NewNovelist and give it another try...
Link Reply to this | Parent
[identity profile] flats.livejournal.comMon 2006-05-15 15:49
I think memory is a limiting factor mainly for certain kinds of novels - crime/mystery ones, definitely, where the author's both got to recall what's going on everywhere, and remember what they've actually told the reader. Perhaps also for major serieses like Discworld, or Harry Potter (although that's a bit short) - the need to maintain consistency between books, particularly if you've got an obsessive fanbase who'll notice if, in book six, some peripheral character had four sisters and now, in book twenty, he's got three... If you're writing some postmodern standalone novel then you can forget all sorts of things and leave lots of plot-ends un-tied-up, and that's fine!
Link Reply to this | Parent
[personal profile] pm215Mon 2006-05-15 14:05

I think that a large part of the reason why I don't really write large programs is purely pragmatic. For any particular thing I want done the chances are quite good that there's already some Free program or project out there that's a reasonable amount of the way there -- it's just easier to write a patch to get it to do what I want rather than start from scratch.

The other part these days is RSI, of course -- I don't generally feel that I can afford to dedicate that much keyboard time to something non-work :-(

Link Reply to this
[identity profile] philipstorry.livejournal.comMon 2006-05-15 14:15
I don't do large projects - I'm a self-proclaimed hobby/hacker programming type. And happy with it.

I don't really disagree with what you say. It all seems quite reasonable. I probably most lack method and memory from your list, as well as a need for the large project. I *could* write a large program which monolithically did everything I needed it to. Or I could munge a small utility which took the data produced by program A and munged it thoroughly so that I could use it in program B.
A small utility to act as a bridge or to automate an annoyance is often much more efficient a use of my time than writing that Large Program(tm) that does it all at once.

So why have I never developed your Large Program Mindset? Because I've never needed to. I worked on two Large Programs once, as part of my employment. One was good. The other - well, it was not a happy project, because the way in which I was managed was poor. Feeling that I'd be happier with systems administration, I stuck to what I knew and passed over my chance to migrate to being a developer. I sometimes regret that - usually whenever I start to flex my atrophied development muscles - but I do think it was the right decision at the time.

I have a few Large Programs I want to write, most of which probably aren't that large by your standards. Things like an MP3 player & music library which works the way I want it to, or a few large applications designed to monitor/automate/alert systems I work with on a day to day basis.
But the need just isn't quite large enough to sit down and begin deicating time to those projects. Not yet, anyway...

As I grow older, I feel the calling... *grins evilly*
Link Reply to this
[identity profile] senji.livejournal.comMon 2006-05-15 14:17
I tend to find that most of the WIBNIs that I get are either so stunningly huge that I couldn't even imagine tackling them, already almost done (see [livejournal.com profile] pm215's comment) or fairly trivial.
Link Reply to this
[identity profile] tackline.livejournal.comMon 2006-05-15 14:55

My excuses...

I've had plenty of time over the last few years to do a large project, but haven't. I'm clearly capable as I have done it before when being paid.

I guess the reasons are the same for not doing large out-of-hours projects whilst working. There is no focus. I'm not traveling to work everyday (although I do change buildings) to achieve something particular. I found at work I worked better in an office with a couple of other people, not necessarily doing the same thing. I worked better still when they weren't there, but not if they didn't exist.

I've started lots of stuff, and then stumbled on something glinting new and shiny to do a week later. Even during one day, I'm checking my e-mail, livejournal, RSS, Usenet constantly and Java SE 1.6 diffs weekly. Most of what I do do relates to a narrow point thrown up through that. The longest thing I've done is started to rewrite Xalan XSLT compiler, but went off briefly to do something else a few weeks into it.

So, I think it's a social thing. Few people have a personality equiped to do such a thing.

Now I'm off to have a poke at the broken locking in Swing text. That could be broadened out, but the whole thing is a complete mess wrt threading.

Link Reply to this
(Anonymous)Mon 2006-05-15 15:23
My current theory is biochemistry. I used to have willpower and interest and focus and now I don't. I used to learn and understand things on one reading, and now I'm permanently tired. I don't do large projects for the same reason that I don't run the dishwasher: lack of botheredness. At the moment the lack of botheredness is strong enough to kick in early in the considering-the-design stage 8-(

I don't experience unbotheredness as an acquired moral failing, and in fact I'm much happier on those rare occasions when it goes away. I think I was very lucky that I had much botheredness and learnt easily as a kid; it must be much harder to get through the school system without. I think it's chemical.

--PAS (who is employed doing middling-size projects and so could do without becoming googlable on this)
Link Reply to this | Thread
[identity profile] pjc50.livejournal.comMon 2006-05-15 16:37
permanently tired

This kicked in on me recently. It sucks.
Link Reply to this | Parent | Thread
[identity profile] pne.livejournal.comMon 2006-05-15 17:23
Doesn't it though.
Link Reply to this | Parent
[identity profile] hairyears.livejournal.comMon 2006-05-15 17:55
'Clever' is not always a compliment


You mentioned design, but not it's handmaiden: analysis.

I design small systems, sometimes from the ground and composted paper records, all the way up to a self-contained application with its own database. More often, I find the job is fitting a new business requirement - some report, or some new type of data structure - into an existing web of badly-designed databases, interfaces and legacy constraints. A good example would be adding syndicated loans into a system that has been built on the assumption that a 'lender' is a fundamental and 'atomic' data entity.

Sometimes I find that some co-workers can be given a part of the problem and left to come back with ideas, then left to build a working solution that fits the rest of the solution; and sometimes I find that they cannot. Any of it: not the thinking parts anyway. All too often they are 'coders' who will never make the leap to 'Analyst Programmer', never understand when to normalise and when to flex, never see the business logic, never see how their work affects other people and the system as a whole, never escape from the need to be given detailed specifications and hard numerical constraints.

I think it's a kind of autism. But these coders are often superficially brilliant at the elegant little word-puzzles that the C++ boards parade as cleverness and kudos. As if elaboration and obscurity are better than simplicity and clarity. And yes, a clever algorithm is indeed a mark of intelligence: but my first real job in the City was building interfaces for a vast library of clever quantitative analysis functions that none of the traders were using. Some of those algorithms were works of genius, but it took a mediocre VBA developer with design skills to build them into usable tools for the traders. Really, all I had to do was get the traders to explain what they needed - the analysis required was minimal - and apply the most elementary workflow design to the visual layout skills of a one-time graphic designer and amateur cartoonist.

I doubt that I'm especially good at analysis and design. But it seems that I am regarded some kind of rare genius for doing it at all. How does that square with your ideas on what is needed to be a programmer? Somehow I think I measure up, all of about ten percent of the way, to what Don Knuth would say is needed to master the art of compter programming. But it's a start.



Maybe I should blog this in my own space, and see what happens. But I suspect I'll get more interesting answers here.




Link Reply to this | Thread
[identity profile] philipstorry.livejournal.comMon 2006-05-15 19:08
Re: 'Clever' is not always a compliment
Oooh. Analysis. Well spotted!

I agree entirely that analysis is missing. I often stop a project at the analysis stage, simply because it becomes very obvious to me that the amount of time it will take it is going to be HUGE, and that even then there's no reason to believe that my analysis will produce something that actually works. Or, at the very least, that I'd be happy with.

Analysis and perfectionism have killed more great ideas than any other combination of qualities, I think.
Link Reply to this | Parent
[personal profile] pm215Mon 2006-05-15 19:53
Re: 'Clever' is not always a compliment

Me, I'm lazy. I can do the analysis thing (at least I like to think so), but sometimes the elegant little word-puzzles and the microoptimisation are easier and more soothing, precisely because you can do them without having to think very hard...

Link Reply to this | Parent
[identity profile] ixwin.livejournal.comMon 2006-05-15 18:56
That all sounds fairly plausible.

In my spare time, I'm very much a dabbler; I'd rather do lots of different small things than one large one. Also, I definitely have the mindset of your schoolfellow - I like to get input & output from early on, even if it bears little resemblance to the final product and I work very much by progressive revision/elaboration, solving each problem/bug as I encounter it rather than by planning stuff out in advance. This means that my first versions of most things are pretty buggy, and I wouldn't trust the reliability of anything large I'd written on my own. This is partly laziness, of course, I probably could be more disciplined and rigorous if I really made the effort, but it's not my natural inclination.
Link Reply to this | Thread
[personal profile] pm215Mon 2006-05-15 20:16
I definitely have the mindset of your schoolfellow - I like to get input & output from early on, even if it bears little resemblance to the final product and I work very much by progressive revision/elaboration

I think it's Simon who's the odd one out on this point. It's been accepted wisdom for decades that incremental development generally works much better than 'big bang' style programming. Brooks has a quote in The Mythical Man-Month somewhere about people being able to 'grow' much bigger programs than they could 'build'.

Link Reply to this | Parent
[identity profile] feanelwa.livejournal.comMon 2006-05-15 19:57
Also, tuits.
Link Reply to this | Thread
[identity profile] feanelwa.livejournal.comMon 2006-05-15 19:59
Re: 'Clever' is not always a compliment
Except for that other three year long big project, that the coding medium sized project is fitting into. I forgot about that for a minute. D'oh.
Link Reply to this | Parent
[identity profile] compilerbitch.livejournal.comMon 2006-05-15 19:58
I have written a few 300k lines+ applications from scratch, worked on a few larger ones, and countless smaller ones. I don't think size makes much difference to the way that I work.

I think, for me, I am compulsively creative. Or obsessively creative. Or some combination. Not in a, 'oh, look at me, aren't I wonderful, look at my sparkly stuff!' kind of way, it's more a 'can't sleep, must *do* stuff, or I will really hate myself' thing. I get ratty and irritable if I'm not working on something. It doesn't really matter if it's a piece of art (photography, graphic art, music, writing, whatever), mathematics or programming -- they all scratch essentially the same itch. I don't seem to have a lot of choice in the matter. I actually can get quite depressed if I've not created something that I cared about for a while. This doesn't sit well with a lot of commercial programming jobs, of course, but I've been quite lucky in that I've generally managed to avoid run-of-the-mill jobs.

For me, programming takes the same kind of thing as shooting and processing a good photograph, or laying out a PCB, or inventing mathematics. I haven't any idea how I do any of those things in any detail. I just 'know' what is right, and go with it. Usually, the gut feeling works out. Sometimes it needs correction, though this is rare. I couldn't hope to explain it. I use C++ a fair bit, and have done so for about 15 years now, so I know the language pretty well. I still have to look up the occasional obscure bit of syntax, but generally I don't need to these days. My code doesn't tend to contain many bugs, but I think that's more due to 30 years of programming time than any particular technique I might happen to use. I like small programs (or, at least, parts of programs) that look beautiful, work perfectly and do useful things, in the same way that I enjoy well designed furniture or a classically good piece of typography. Or some Bach. I suppose this sounds a bit big-headed, put this way, but I don't intend it to come across like that -- it's about as close to describing the way I perceive the world as I can manage.
Link Reply to this | Thread
[personal profile] simontTue 2006-05-16 09:17
Goodness me. 300k outclasses me by some distance, and several 300k programs even more so! My biggest work is PuTTY, which currently weighs in at about 100k but only because of significant contributions from other people. (In particular, that's counting all the OS-specific subdirectories, one of which – the Mac OS Classic port – I didn't write a single line of.)

So now I think it's only fair that I turn my own question round, and instead of asking why many people haven't written anything as big as I have, ask myself why I haven't written anything as big as you have. Hmmm.

Certainly the biggest reason is that I've never encountered a problem which I felt motivated to solve and which needed a program that big to solve it. I'd be interested to know what yours were, in fact.

But also, I think scale does affect me in a way which you say it doesn't affect you. The bigger the program, the more aware I am that I'm gradually losing track of how the details of it work, and the more mistakes I make along the way. It's entirely possible that 300k might be beyond my capacity (although, having never tried it, it's a bit hard to tell). Then again, it might be that I could have hacked a 300k-line program in my prime (loosely defined as age 20-21ish, when I had less experience but vastly more energy and a much better memory) but am past it now.

I may be limited, it occurs to me, by the fact that I rely heavily on my intuition rather than formal reasoning. I had this in maths: I blazed through school maths lessons without slowing down, tackled first-year university maths with no difficulty at all, did nearly as well in the second year, and suddenly came up short in the third year when I discovered that the levels of abstraction had suddenly reached the point where my intuition wouldn't quite encompass them any more, which meant that suddenly I only had formal reasoning and algebra to work with. I think up until that point I'd been relying on an unusually good intuitive grasp of the concepts to do most of the work, and then going back and filling in the details of the algebra and the proofs once I knew where they were headed, so when I suddenly had to rely solely on nonintuitive methods I found it much harder. It wouldn't surprise me to find that the same sort of thing happens to me with programming; I know I do a lot of high-level design, for example, entirely in my head, which is bound to mean it's limited by the dimensions of my skull...
Link Reply to this | Parent
[identity profile] satanicsocks.livejournal.comMon 2006-05-15 20:47
I suppose with me it's desire/willpower, but not quite in the ways above -- basically, despite being educated and competent, I do not enjoy the act of writing programs at all. Scripts I can cope with because if you've got to do manual labour anyway, it's easier to write a script to do it than to program, but I really dislike any programming task -- big, small, work, hobby. As for why that is, I expect it's a combination of being forced (the only useful languages I know were taught to me at university) and getting bored very, very easily with projects. Even small web-based projects which I start full of enthusiasm I abandon quickly, because I'm a designer and project manager, not a coder.

In summary I guess what I want to say is this: just because one self-identifies as a computer science geek -- and has paper qualifications showing a great deal of schooling in computer science -- does not make one a programmer. In fact, it doesn't imply one enjoys programming at all. That's exactly the problem I ran into when trying to find a graduate job, and a sizeable part of the motivation behind my continuing on to a PhD...
Link Reply to this
[personal profile] pm215Mon 2006-05-15 21:23
to analyse, criticise and compare, to script and to sysadmin, and to write small utilities

The rhythm of the phrasing here makes it sound like it's part of somebody's marriage vows...

Link Reply to this
[identity profile] mirrorshard.livejournal.comTue 2006-05-16 08:46
Something I've always thought of as a truism, but I don't think anyone brought up yet - apologies if they had and I missed it. (I got pointed here via [livejournal.com profile] hairyears's journal, by the way.)

A lot of what it seems to take is practice - working up through successive layers of what looks like a large project to you at the time, crowbarring open your mind-space and ability to handle state at the same time you acquire techniques, confidence, and muscle memory. So if you haven't done that, if you're jumping straight from utility scripts or the like to the large programs your training and/or skills theoretically fit you for, you're going to be in trouble.

I'd argue that the problem isn't a programming one, it's a workflow and design one. You start with a large, currently insufficiently understood project, and break it down into interacting mapped-out chunks, and you write those, but if you miss out any of those steps something goes wrong, and if you do them then - given a certain amount of basic programming competence as a starting point - the techniques take care of themselves. It may well not be the best possible result, but you'll get something that works and can be improved on out of it.

I haven't written anything particularly large, but I'd put that down to a combination of not having a "hook" to get me started and not having the sustained energy to get a firm foothold on the particular set of learning curves that the projects I was thinking of require.
Link Reply to this
[identity profile] ptc24.livejournal.comTue 2006-05-16 12:13
Hmmm... I'm not sure how to rate my programming skills - they're certainly there, and I can do a few clever-clever "word games" when needed (YVFC), and I did write NW. Except I never finished that. And the code for my PhD - not huge, about 3k lines of Python, but there the main thing was working out what to make it do. And my current source trees are starting to get quite large - there's about 10k lines of Java in my IDE workspace (OTOH, Java is *verbose*). I guess that what I've got going for me is neither the deep-compsci knowledge nor systems-engineering know-how, but a minor knack for (extremely informal) analysis - well, OK, bringing in some of my domain knowledge - and invention.

In terms of approach: I'm an incremental, get it to work and then keep hacking on it type, but I can do some big-block-coding when needs be. I tend to refactor quite a bit - I can notice when my code's getting shabby and re-design it to be smaller/more elegant/more readable/extensible in the right way. I was never particularly methodical or perfectionistic. I guess this is what lets me get to a certain size of my C code base, and then get horribly bogged down and demotivated. Ho hum.
Link Reply to this
[personal profile] cjwatsonTue 2006-05-16 15:15
I pride myself on being a bloody good maintenance programmer, except that that isn't quite the right term. I do write fair-sized things from scratch from time to time, but I'm much better at - and much prefer - taking an existing project and finishing it. I suppose that's why I got into the Linux distribution business, which is fundamentally about taking upstream code and finishing it (or that horrible word, "productising").

It also depends on what you count as "from scratch". After all, most software projects aren't standalone - if nothing else they depend on the OS unless they *are* an OS, and they often depend on piles of library code as well. The biggest project I've led was probably the Perl extensions to the Zeus web server, which was about 10K lines of C++ and XS (you may vomit now) but was still an extension to an existing program, albeit an extension that required its own ground-up design work and had a couple of "oh shit, it's all horribly wrong, rewrite" moments in its development. I don't know if that counts.

My current project at work involves a program that other people wrote sort of to our specifications, except that it didn't really follow our specifications at all under the hood and had some embedded awfulnesses, so I've had to gradually rewrite large bits of it until it no longer really resembles the original program and is now more or less what we originally designed. This is a rather curious approach to the "write a big program" task in that you get something mostly functional at each step along the way as you gradually morph it into what you intended it to be all along. I'm not sure I'd recommend it because it does tend to lead to a lot of accumulated cruft unless you're very disciplined.

When I get the chance to do so, my method usually involves sketching out enough top-level code that I can see the structure, and then dropping down to the bottom layer and writing library code until bits of the structure start to work.
Link Reply to this
[identity profile] jvvw.livejournal.comWed 2006-05-17 16:54
Large projects are less fun in the short-term because the feedback cycle is much longer. And if you're working on one in your day job, it's probably not the sort of thing you feel like embarking on in the evenings.
Link Reply to this
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]