Writing better code: The self taught coder

Just a data point, I am not a great coder but I have run several studios/teams and experienced the work of well over a hundred programmers in my time.

I would say 70%+ of the very best game programmers I have worked with have all been self taught or without degree.

This maybe my generation, or maybe just the games business , or a selection effect based on who I see, but it hasnt been a bar from what I have seen.

I’m confused, if you’re “not a great coder” yourself, how are you able to identify good programmers or even good code? I suppose spotting it is easier than writing it, still I find it odd.

I suppose this comes from my own personal experience where I’ve run into several programmers that have been held in high regard by their management and even other programmers. They were smart guys but they weren’t great coders, mostly they were just very fast and prolific programmers. I suppose management loved that, as they’d get a whole lot done but the quality and approaches where rarely the best and they would easily take shortcuts at the expense of writing better more robust systems. Going into such a person’s code afterwards is always trouble.

One such guy, I remember, gave me a puzzled look and asked “why?” when I suggested we rework a system to take an XML file and be data driven rather than requiring a programmer to code all the specifics manually.

Incidentally sometimes I think that there must be a totally different thing going on East Coast vs West Coast and also Business Software vs. Entertainment Software.

My generalizations may be overly broad. :)

At least where I live, we seem to get a lot of people that only got into IT because it pays well and have every intention of coasting by on minimal knowledge.

It’s a valid question. You don’t mention how often, if ever, the specific values are likely to change.

In some cases sure. This was layout for a GUI library and would be used on all current and future projects. Sure writing the parsing code, schema and first XML doc might take a little longer but after that it would save time in recompiling alone, not to mention if it’s robust enough the work can be handed to a non-programmer.

I realize it’s out of date stuff, but I think that looking through an old edition of Kernighan and Ritchie might be good. The code examples in their C book are just so beautifully pure compared to other books, that I think they still stand up for teaching purposes even if you will never actually use C yourself. Also, C is close enough to metal that it can be instructive in learning some elementary hardware principles. Grasping the equivalence of a[i], i[a], and *(a+i) is an education in itself for some people.

I’m not sure it’s possible to learn good programming practice just with modern scripting and web programming environments. Internet programming is so high level on top of so many other systems that it’s the programming equivalent of collage. Collage is great, but you can cut out and paste together as many images as you like without ever learning anything about drafting.

I think C++ is an enormously protracted multi-car crash on I-5 on a foggy day. The accident started in the late 80s, and there are still tractor-trailers ramming into the back of the mass even today; entire ecosystems and economies have grown up around the wreckage. IMO it’s only possible to program C++ well if you’ve learned good programming practices as well as good OO principles in some other environment.

Theory is of course very useful as a basis, but unfortunately I’d guess that 95% of most theory classes and books have no relevance to a programmer’s life, and I have no idea how to pick out the relevant 5%.

I also suggest an EE course or book that talks about how processors work and which teaches some basic assembly language. Programming in assembly not only teaches lots of useful things about the underlying hardware that most programmers never learn anymore, but once you put it behind you, you can accept the most painfully stupid high-level programming environments with pleasure…

I think this is more of an artifact of the roughness of the game industry (and its tendency to pay less than other software sectors) than a really positive point. I do agree that good programmers can be entirely self-taught, and that a MSCS or even a BSCS isn’t actually necessary. However, I think that many self-taught programmers miss out on a lot of important stuff that would enable them to work in a much broader range of environments and on a broader range of applications.

Well put. Unfortunately C/C++ is everywhere and won’t be going away any time soon.

I can’t control what we use at work but I’ve reached the point in my hobbyist programming life where if your language doesn’t have some basic features (like garbage collection), I’m not using it. That means no C++ at home.

Heh. I love this analogy. I’m imagining a tractor trailer with “Boost” written on its side slamming into the wreckage and exploding…

Also is re-use of software an issue here? The more likely it is that your software will be re-used, then it becomes more important for the initial program(s) to be sturdy. While games have expansions, the expansions seem to come pretty quickly after release (in software time) meaning that it’s very likely that the same person(s) is working on the initial code.

I know at JPL, they are still using some of the initial Pathfinder code (not all of it but the core parts) for the ensuing Mars missions. Had that code been thrown together, the cost of future missions would have been impacted by that. JPL also has to confirm with ISO 9x standards for software coding, meaning that you need to know common software programming standards in order to code for their missions. On the business side, they use Oracle and have definitely been burned because of having to completely redo stuff that had been poorly done initially.

(I evaluated software developed at JPL for transfer to businesses for 10 years).

Ah fair question. I am primarily going by the eagerness of other programmers to work with them, quality of resulting task and speed.

I am talking about the guys who when you say “Oh xxxx is working on that” every other programmer smiles, nods and knows its simply no longer a problem.

These are not tiny projects either. games that take 3 - 5 years to build with 30-40 programmers on them are pretty decent sized tasks I think.

Like I say maybe its just my unique experience but I have seen no bar to self taught programmers, in the games biz at least, and games programming isnt easy IMHO.

Could be. Although I have lived here for 18 years I still cannot detect regional differences like that. I was shocked back in the late 90’s when I got turned away at an east coast restaurant for wearing sneakers and a T-Shirt, no idea if that kind of stuff still happens. I dont think its possible to get turned away in the bay area, all the rich people dress like bums :)

As a self-taught programmer, I’d like to know what “stuff”. The professional opportunities you meet in a research setting?

That’s as good a yardstick as you get.

Code Complete turned up today, thanks for the recommendation, just a quick skim through the first couple of chapters suggests that it’s going to come in very useful even if reading a couple of bits here and there has yielded a mix of “Got that assumption right” and “oh bugger”.

Research setting? No. Most MS degrees have nothing to do with research, and for that matter, someone fresh out of school with a MS probably sucks at programming if they haven’t ever had a programming job. However, the theory you get with a MS does hopefully provide a basis for better development in your career, not just because it is a more or less firm requirement for some jobs.

I would say the ability to choose appropriate algorithms and data structures for the task at hand is the most important thing that a self-taught programmer is likely to miss, because this choice is often based on theory principles.

For some applications, it’s important to be able to understand some computer architecture to support the most efficient implementation of critical segment code.

Some of the math required for the MS – linear analysis and so on – or quaternions for graphics – does occasionally crop up. I admit this is not very common for most programmers.

Anyhow all these things are certainly within the grasp of a self-taught programmer; and historically there have been many great ones. However, I would say these are the things that self-taught programmers are more likely not to understand because early in their careers – especially if they started out with lightweight web applications – they may not have had to worry about these issues.

I wish my job enabled me the time to sit around and look over my code and retool it to be better. Unfortunately I have deadlines and more work than can ever be done in that amount of time. Most code is written to get the job done.

I know this has been dead for a while, but “Code Complete” is amazing if you’ve half a clue in whatever language it is that you develop in. I say language really appreciating after the first couple of chapters that I was still a scripter.

It’s not even a “one size fits all” technique book. It affirmed a number of techniques that I already used and made me think whether I should be doing things a different way. Some I did, some I didn’t but it made me think why I wasn’t using those techniques.

It dawned on me the other day while having a robust discussion with a lecturer in Computer Science just how much I’d gained from the book.

Are you kidding? Boost is a a spaceship full of fanciful technology developed by god aliens that was then dropped on top of the wreck on the I-5 and we’re still trying to put together the pieces and figure out how the thing actually flies.

Template Metaprogramming? Really? In C++? I did C++ programming for 5 straight years and still can’t figure that stuff out, I think because I’m still trying to parse the compiler error messages.