Monday, December 20, 2010

Learning Real-World Programming

My apologies for the missed blog post on Friday. I got caught up reading Prospero Burns and honestly forgot that I had a post lined up. Hey, there are worse excuses for missing an update.

Anyway, I responded to a forum question a while back about what to study if you're thinking about a career in computer science (which I took to read "programmer"). The rest of this post is a cleaned-up version of my response, based on about five years' experience writing code for a living. If you think I'm going too far off-mission, well, tough. Go suffer the wrath of Trollquotes.

First off, you want to learn Unix or Linux if you want to be a well-rounded programmer. For all of Windows's dominance of the desktop PC market, most servers run on some flavor of *nix, so you're going to have to learn to love the command line. Ubuntu is easy to use as a desktop, comes on a live disc so you don't have to nerf your Windows gaming box, and has the full command line experience for you to play with. (If you don't know what a live disc is, God help you, and don't come crying to me when you reformat your hard drive.) Make sure you work out how to type in emacs or vi as part of your command line tour.

While I was in college I learned to program in C++ and Java. These are useful languages to learn from, because they're strongly defined, well supported, and complex enough that you can port your skills to just about any other language without too much difficulty. But as a practical consideration, well, I haven't touched C in years and only rarely use the Java. (That'll probably drop to "never use Java" now that Oracle seems bound and determined to screw it up. I still feel bad for Professor Lobo, who was firmly convinced Java was the language of the future. Now, I suspect, not so much. But I digress...)

Code gets compiled, and you will need to know how to do that. Not everybody gets to use an IDE. If you're learning C or C++, make sure you play with gcc and make. Visual Studio is fine, but will only take you so far. If you're learning Java, start compiling with javac before anything else. Once you're comfortable with that, Ant is a great tool for building larger projects.

Now, other languages. HTML and CSS aren't programming languages, but a basic knowledge of the tags is important if you want to be a web programmer. In which case you'll also need to be able to set up an Apache web server, which is not at all difficult after a few Google searches. Many *nix systems will come with it installed or as an easy add-on in any case.

Java servlets are good to know for web programming, but will require Apache Tomcat or Glassfish as your web server. These are both still easy to set up.

Javascript and Java are two different things - Javascript is generally the one that does all the fancy web graphics on Facebook or Twitter. Learn it if you need it.

For a simple introduction to modern web programming (i.e. Web 2.0, SOA, The Cloud), you might consider checking out Ruby and it's expansion pack, Ruby on Rails. It's got a very simple syntax that does a lot in a hurry, and Rails was designed to handle buzzwords like SOAP and Ajax with ease.

On to the nitty-gritty! Perl is the #1 language in parsing text files, so if you're planning on server programming, learn it as your second language. The syntax is (arguably) a little too confusing to start learning with, but once you get the knack for it you'll be fine. You'll also want to learn a bit of shell coding to go along with the Perl.

If you're interested in games programming, XNA is the simplest way to get started in 3D gaming. That means learning C#, which is about the only reason I know of to use that particular language. It's a lot like Java, so you won't have too much trouble getting spun up.

Avoid LISP like the plague unless you like artificial intelligence.

The best programming books I've found that are up to date belong to the Head First series. These are very accessible, and entertaining, but still give you a strong introduction to their particular subject. Beyond that, the O'Reilly tech books are rarely bad, so investigate them thoroughly whenever you want to learn about a new subject.

Programming can be a lot of fun, even if you never do it for anything other than a hobby. As a profession, it won't be a blast everyday; but at its best programming is a creative, rewarding way to make a living. So if you're in school and thinking about what career path you want to follow (or, like me, you want to be a writer but like to have money for food), give coding some consideration. If nothing else, hey, you can write a Pong clone for your own amusement.

No comments: