self-taught programming for n00bs?
January 10, 2007 11:09 AM

I'm a MechE by training, but I've got some time to kill while my boyfriend to finishes up his PhD this spring. I'd like to fill a portion of my copious unemployed time by learning to program in a useful language. Any suggestions for languages/websites/self-teaching books that are good for n00bs?

Embarrassingly enough, I somehow got through well-regarded BSME and MSME programs with virtually no programming (Matlab and ABAQUS routines, if those count at all). I started my bachelor's degree when all the hot Tech schools were teaching Scheme in their intro programming classes, and found it to be....not so useful or exciting. Even though I'm not working for the time being, I'd like to keep my mind adequately challenged for the next few months.

I'm looking for a language that's useful (or at least used widely enough to be acknowledged by working professionals as semi-useful) and good for beginners, but the Google-fu/Amazon results [Python? Ruby? C/C++? Java? Perl? SCHEME??!! * a million resources for each] overwhelm me. I'm also hoping that there are quality, low-cost resources for me to learn said languages available on my own; I've found in the past that I need some definite structure to my initial learning (i.e., here are some Tutorials for Dummies, now try and complete this assignment on your own). Any suggestions?
posted by universal_qlc to Grab Bag (23 answers total) 14 users marked this as a favorite
While I haven't done anything in the languages, all the cool kids are doing either Ruby or Python, and both have a strong emphasis on the community aspect (eg., lots of people offering help, masses of tutorials etc.), so I'd go with one of them.
posted by slater at 11:17 AM on January 10, 2007




If you can decide which language it would be easier to find some resouces.

While I did start with BASIC, I found it very useful to learn the low-level first (C and x86 assembler) before I got into the higher level languages (java, C#, php, perl, etc.)

If you just want to learn "programming," I would strongly recommend starting with either C or C#/Java. Which one depends on if you want to learn where things came from or start with a more current version of C-style programming.

If you want to learn something that can be immediately applied to the web then I'd say either ASP.NET (Visual Studio Express is free,) PHP, or if you want to live on the bleeding edge, Ruby.
posted by cmicali at 11:26 AM on January 10, 2007


Python and Perl are likely the easiest to pick up for a non-programmer. They have the lowest learning curve. (I picked up Perl in about a week with Learning Perl, with no real programming experience beforehand.) Both are widely used, and by no means under-powered.

A language like C/C++ and Java have a lot of difficult-to-define concepts (OO? pointers?) that can get in the way of getting to sit down and just program.

Scheme, as a LISP dialect, is useful for learning functional programming. However, there's a relatively steep learning curve, and LISP sees significantly less use in The Real World(tm) than say, C++ or Perl.

One additional thing to consider is that different fields have different languages of choice. Biologists are all about BioPerl, while physicists and some engineering disciplines are still fond of FORTRAN for high-performance numerical computing. What kinds of software do MechEs use? What are the scripting languages for those? (For example, if you're doing a lot of drafting in AutoCAD, learning a lisp dialect suddenly becomes much more attractive)
posted by NucleophilicAttack at 11:28 AM on January 10, 2007


I disagree that Scheme has a steep learning curve -- it might be difficult to pick up by people whose brains have already been warped by imperative languages, but my college used it as the language for the first programming class in the CS program and it works pretty well for that purpose -- that is to get an insight to the theoretical foundations of computer science (rather than just learning how to code).

Not that I would recommend it in this case -- functional programming is a very fringe paradigm in the real world and you'd be much better off starting with Python, which is a language where it's easy to do complex things right away but also is a powerful language in its own right.
posted by zixyer at 11:35 AM on January 10, 2007


Normally, I recommend Java to people that want to learn to program, but you might consider Flash. Learning ActionScript would allow you to learn the basics of object oriented programming and the ability to do animation may be useful in mechanical engineering. The tutorials that ship with Flash 8 are a good place to start.
posted by McGuillicuddy at 11:37 AM on January 10, 2007


You want to be semi-useful in a professional world? In that case, I'd recommend VBA, ie that VB-derivative that comes as part of MS Office. You can do all sort of useful things with that within the realm of Office. It won't get you any cool geek points, however.

That being said, VB sucks as a programming language, and if this is for general programming knowledge, or if you want to build apps or anything web-based, I'd recommend Java or C# for apps (C# if you want to stay in the MS world, Java is cross-platform). Also, like it's been mentioned, all the cool kids are using Ruby and/or Python for the web, but I really don't know enough about those to comment on their learning curve. Ruby, Python and Java are all free, with nice (and free) IDEs and more than enough info on the web. C/C++ is also free, but I wouldn't recommend that to a noob.

PHP (with mySQL) could also be easy-ish to learn by yourself, if you're interested in non-bleeding edge web development. It too is free, with well established development tools and tons of info.
posted by cgg at 11:41 AM on January 10, 2007


Just thinking about how this might hook into your engineering degree: I'm given to understand Lisp or a dialect thereof is used as the scripting language for a number of leading CAD programs, so learning it or Scheme or some other similar functional language could be real boon in that context. Lisp also can have a speed advantage over some of the interpreted scripting languages or Java, which is something to consider if you think someday you might be using your language for serious number crunching, too.

Ruby and Python are nice, and I think they're probably genuinely good choices for a beginning programmer. I waffle back and forth about which one to recommend. Right now I'm thinking Python (especially if you think you might want to pick Lisp later).

Java's not bad. I really, really liked it when I came to it from having mostly done a lot of C, and think I mostly liked it in comparison with. (C and C++ just seem so damn painful sometimes that I'd have trouble recommending them unless you think you might be doing operating system or embedded systems development at some point). Java has the advantage that everyone has heard of it and it's widely acknowledged as standard and something to do serious projects in and suitable for the enterprise blah blah etc. The dev process and some of the implementation of features make it just a bit less fun to work in than the scripting languages, and Ruby and Python are picking up a following amongst the savvy.

PHP will instill you with bad habits if you're not careful, but it's pretty good if you want to do web dev. I like writing in it, but it's only in the last three years that I've shaken most of the bad habits and learned to do it well.
posted by weston at 11:46 AM on January 10, 2007


First, I'd recommend figuring out what you want to do with the language you learn. Programming languages are like natural languages insofar as the learning is mostly in the doing, once you've got the fundamentals down.

Learning C or C++ is guaranteed to make you mental; likely the same for Java. You can get to those later if you really take to programming. I would recommend staying with a scripting language. You've got days or weeks of trying random stuff (as you muddle through inscrutable errors) ahead of you. It's best to skip the compiling step.

I would suggest Perl or Ruby, or PHP if you're going to restrict your programming to webpages. Ruby is really a beautiful language. Perl has mountains and mountains of library code available to you via CPAN, which is a tremendous advantage. PHP is probably, the easiest programming language to learn, but restricted in what you can do with it. Javascript might seem like an easy thing to pick up and use, but it's actually a bit of a nightmare. You might want to learn some SQL, too--even non-programmers can find it handy.

As far as guides, I'd second Learning Perl (I'd also get the famous Camel book--Programming Perl, and the Perl Cookbook, all from O'Reilly, and that'll suffice for a Perl library). Ruby has a free guide called Why's Poignant Guide to Ruby, which is way too cute for me but a lot of people highly recommend it. It does have the advantage of being available free online.
posted by Nahum Tate at 11:50 AM on January 10, 2007


This is more important a decision that you might realize. Your first language shapes how you think about programming forever. If you choose poorly, remember the wise words of Edsger Dijkstra: "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

I recommend Python. For a tutorial, I recommend Dive Into Python, and for a book, anything published by O'Reilly.

A great piece of Python advocacy is Paul Grahm's The Python Paradox. Choice quote: "A friend of mine who knows nearly all the widely used languages uses Python for most of his projects."
posted by profwhat at 11:50 AM on January 10, 2007


You can learn Python with How to Think Like A Computer Scientist -- even better, it's a free textbook (disclaimer: the prof was one I had in college -- he's a cool guy). I hear Python is pretty versatile... I know web people who program in it, and I know hardware people who have (painfully) programmed in it, so it seems applicable to many things.
posted by olinerd at 12:15 PM on January 10, 2007


As another ME I would recommend Python without hesitation.

I use it for *everything* - as a matlab replacement, for computer vision, for robotics, for web apps, for telling me when I need to plug the parking meter...

It is really fast to write, easy to read, easy to understand, and fun to use. No matter what you want to do, there is likely a Python tool to help you (see the cheeseshop)
posted by nazca at 12:29 PM on January 10, 2007


Python or Ruby are what you want. Don't learn a bunch of crap you're eventually going to have to unlearn with PHP or BASIC variants. My personal bias is strongly towards Ruby, but you could look into them both very superficially and devote your time to whichever you're inclined towards, as they're similar in more ways than they differ and it comes down largely to a matter of taste. If you like problem solving, word games, etc check out the Python challenge (which is obviously geared toward Python, but works with any reasonably expressive language.)
posted by moift at 12:30 PM on January 10, 2007


er well re: python challenge, you may have to google spoilers for a few pages if you use another language.
posted by moift at 12:40 PM on January 10, 2007


Ultimately my vote is for Python - it's a thing of beauty and it's the language I smile at the most !

I do think cmicali's point about low-level languages was a very good one. It's a great thing to understand what's going on under the hood even if you don't want to deal with it on a day to day basis. I tend to think Assembler is a little too divorced from other languages so I would suggest finding a C compiler (any number of no/low-cost ones) and see if you can find the Kernighan and Ritchie book.
posted by southof40 at 1:25 PM on January 10, 2007


I'd recommend Ruby or Python.

I prefer Ruby myself because it's so easy to read (I actually enjoy reading the source code other programmers produce) and write (no need to worry about tab formatting as in Python), but both languages are excellent. Ruby is definitely slower than Python in execution speed, but it more than makes up for that in its programmer-friendliness.

Here are some useful resources:
Ruby-Lang.org
Programming Ruby - The full HTML text to the first edition of 'the Pickaxe book'.
PLEAC Ruby - Very useful examples
Ruby Facets - Lots of nice libraries
Rubyforge - Ruby's equivalent to Perl's CPAN repository ( see also Gemtacular, which rates Ruby gems )

I'd only recommend Perl if there's something in CPAN you really, really want or need to use. I respect what people have done with Perl ( CPAN is freaking amazing ), but I find it a frustrating language in almost all other respects. Lots of syntactic salt (extraneous formatting) and contortions to accomplish relatively simple tasks. I'm glad it exists, but I'd avoid it if possible.
posted by Kikkoman at 1:35 PM on January 10, 2007


I'll add a suggestion for python. But, to provide some practical reasons why I wouldn't recommend another language:

Perl: Perl contains a mix of idioms incorporated from C, awk, and sed. Also, the use of implicit variables drives me up the wall.

C/C++: You have to also learn the compile/link/debug development cycle. If you think you are going to primarily work in C/C++ you might as well start here. Also juggling data types can be a pain.

Java: Offers some better issues for memory management over C/C++, but you also need to pay careful attention to types.

lisp: I must admit that I've caught the lisp bug. But, there are a limited number of introductory texts.
posted by KirkJobSluder at 2:03 PM on January 10, 2007


I like Common Lisp: A Gentle Introduction to Symbolic Computation, not only as an intro to lisp book, but as an intro to programming-itself book. Free PDF at the above link.
posted by ctmf at 2:26 PM on January 10, 2007


Given the requirements of simple and useful, you've kind of limited it to Python (my favorite) or Perl (nearly ubiquitous) or Ruby. You can learn from ground zero with almost any language but these 3 scripting languages are mature with large communities and plenty of books available. They're also free, cross platform, and good fun for just playing since they don't have a lot of set-up problems or complex tools.

Between the 3 I would suggest Python since it has the cleanest syntax this side of Scheme but that's just my opinion.
posted by chairface at 3:18 PM on January 10, 2007


Python has the cleanest syntax of any language. The entire language is built around "the principle of least surprise". And it actually is like that. Things that "should" work in your head, magically work in code. It's like the machine is reading your mind. This is especially true when it comes to other languages that are definitely not like this (scheme, perl, I'm looking at you).

That said it's popular but not *hot* in the RealWorld(tm). It has a following and good communities of people programming in it. But hey, you'll have to make some choice and if it were me, I'd pick python over Java or C#. That said you could do a best-of-both-worlds approach and learn / start in Jython. All the fun of python with all of the marketable skills of knowing Java. Or at least knowing Swing. Which is the front-end widgety part (windows, buttons, scrollbars, etc.) part of Java. Python has no easy cross-platform interactive "stuff" so you'll need to learn some kind of toolkit for this. Swing sucks, but it's used very widely.
posted by zpousman at 3:32 PM on January 10, 2007


Java is excellent if you're dealing with HUGE projects, require an open-source framework, want a language with a large user-base to bounce ideas off, or need a bunch of ready-made libraries.

If you're a Mechanical Engineer, however, I'd go with Python. The performance benefit of compiled code can't be overstated with engineering applications, not to mention the lower memory requirements, and like Java, Python has an ENORMOUS toolbox to work with.
posted by Civil_Disobedient at 10:14 PM on January 10, 2007


I see a lot of love for the newer scripting languages here, namely Python and Ruby, so I'll play devil's advocate and represent C++ and Java. I don't have anything at all against scripting languages, and in fact, the next language I want to learn is lua (which also looks like a very nice language), but I don't think that I would be going out on a limb by saying that C++ and Java are more widely used in industry.

C++ definitely isn't as sexy as some newer languages, but it is powerful, ubiquitous, and definitely useful. There's zillions of libraries written in C++ to do just about everything imaginable. It compiles for all sorts of machines, large and small, all the way from big iron, to embedded systems like video processors and cellphones. You are probably using software written in C++ to read this right now, and it's NOT going away, not any time soon anyway.

So, if you're interested in learning C++, here is the course website for the C++ course I took. There was no textbook. All the course material is present in the course notes that are linked on that page. All the assignments are still there, as well as a sample final exam. The solutions for the assignments are present as well. The material in the notes is slightly dated, but I still found them quite useful. I consulted tutorials on the net to get the gist of things (to get started and learn the proper up to date syntax), then read the notes to see the details, explanation, and examples. If you read the notes and do all the assignments, you'll have a solid, working understanding of the language, as well as object oriented programming in general.

Java is cool too. It's also full of lovely object oriented goodness, and is widely used/considered useful. The only thing I'm going to say about Java, is that Eclipse is so nice that it makes me want to program in Java. Ok, I lied. Here's the course page for a Java course that's just started. Material and assignments and stuff will be posted as the semester goes on.

I know you didn't ask about this explicitly, but please, please, do yourself a favour, and at least use a syntax highlighting text editor like SciTE (I use this version), if not an IDE like Eclipse or Visual Studio. Coding in notepad makes me want to eat glass, and I wouldn't wish it on anyone.

Whatever you decide, best of luck to you, and happy coding!
posted by benign at 2:11 AM on January 11, 2007


Python with rur-ple to get you started gently.
posted by aroberge at 3:57 AM on January 11, 2007


« Older I repent   |   Recommendation for a book on Jewish Law? Newer »
This thread is closed to new comments.