How do I most effectively learn how to program?
October 30, 2011 10:59 PM   Subscribe

I'd love to learn how to program effectively in a language like C++ or Java, so that I can, within a year or so, be somewhat productive.

I'm having a bit of a professional midlife crisis, and am considering learning how to program since I've always loved it and it can help secure a decent career for at least the next decade or two. I studied engineering at a top school, so I'm not dumb, although I'm in my late 30s and the only programming I know now is HTML and basic CSS.

I understand it will take a decade of concerted practical experience to be great; I'm just wondering how much training, and what kind, would get me to the point that I could (in fits and starts, and slowly, of course) be productive.

I don't learn great from books/online tutorials without the pressure of assignments and exams (I'm just wired that way, I guess) so I'm looking into local community colleges for certificate programs for C++ and MySQL/database programming. Keep in mind that there are some basic concepts and paradigms around programming that I wouldn't want to skip over in the rush to learn a language's syntax.

Is this the wrong approach? Is it pointless? Should I just focus on a few courses and then work on practice?
posted by oaklandj to Computers & Internet (15 answers total) 55 users marked this as a favorite
It didn't take me very long to learn to program as a kid. Maybe you need ten years to be a 'master' but you can get started to today. I'd go on Amazon and look through the Java and C books for one that's targeted to complete beginners (as opposed to people who already know other languages).

You might also want to try Python as a beginner language as well. You don't want to stick with one programming language.

What kinds of things do you want to be programming in a year? Just simple programs to help you with your work? Software that you distribute? Server backend stuff?
posted by delmoi at 11:14 PM on October 30, 2011 [3 favorites]

Honestly, the first two intro cs courses at my (highly-regarded, public) university taught me enough to get hired. Typically the first course focuses on the basics (compiling a simple program, if statements, getters and setters, for loops, while and do while loops, switch cases, object oriented class-based programming, a high-level crash course in a couple design paradigms) while the second course focuses on some of the really useful tools based on the basics (data structures, sorting algorithms, recursion, big-O notation, efficiency).

After that ... you could basically get hired as a programmer. It's just practice, practice, practice. I have interviewed with many of the big names and I'm having a hard time remembering a single interview question that I couldn't have answered after those first two classes (ok, maybe I used stuff from my algorithms class and a tiny bit from my OS class but honestly it was stuff I would have been able to derive on my own in the interview).

I guess what I'm trying to say is that taking a couple (literally, 2) courses at a good uni sounds like a perfect fit for you.
posted by kthxbi at 11:17 PM on October 30, 2011 [2 favorites]

Best answer: I think your approach is reasonable: at this point in your life, you know what works best for you. A few things come to mind:

- Since you're entirely new to programming, I second kthxbi with respect to a fundamentals class or two. The college/university will have a house favorite language and that's what you'll learn the concepts in. Practice, practice, practice. Learn to think like a computer so you know how to give it instructions to do what you want.
- You'll think you know how to program after about a year of this; at that point hopefully your wisdom will remind you that you don't even know what you don't know. New and exciting things await you even after year ten.
- I'd recommend that once you have the basics of programming in your brain, start on a commonly-used imperative, strongly-typed, early-bound language (Java, C, C++, etc.) if your instructors haven't done so already. All types of languages are useful for various things, but (and I'm likely going to get hate mail for this) I've found in many years of mentoring that people who start early in "strict," powerful, and somewhat conventional languages tend to develop better habits and become more flexible programmers.
- don't bother with certification programs for C++; there aren't any that are worth a dime. It's a language, not an ecosystem.
- community college instructors are, as you likely know, largely hit-or-miss on Hard topics like specific languages, physics beyond intro, etc. You can get someone who has tons of practical experience and isn't a demagogue or you can get someone who, well, doesn't and is. Arm yourself in case you don't get the former.
- try to get into practical programming as soon as you can. Whether that be writing apps for yourself (backup scripts, something for your smartphone, whatever) or contributing to an open source project, the more exposure you can get to 1. real problems, and 2. experienced mentors the better off you'll be.

Good hunting, and have fun in the beautiful art of programming!
posted by introp at 11:40 PM on October 30, 2011 [4 favorites]

Formal training has utility, and it can help give you a point of entry, but there are really only two home truths about programming that you need to know right now:
  • In order to be a programmer, you must write code.
  • In order to write code, you must read code.
I dabbled for a long time, but I don't think I really internalized this until I got a job that put me in front of a text editor all day with people expecting results. Since then I've interviewed a lot of people with formal training who have not actually done the work, and hired people without it who have done the work. The main thing is to start hacking, and to pursue an understanding of it by paying attention to what the craftspeople in the field are doing. Classes and books and so on can give you some tools. You will probably learn a great deal of theory along the way, and it will be helpful. But really it comes down to staring at other people's code until you understand it well enough to make it your own. It's deceptively simple, and the sooner you start the better.

There's almost no lower bound to the amount of programming knowledge that can make you more productive. Productive enough for a full-time gig is a trickier question, but I imagine that if you put the time into taking a couple of courses and actively work on real projects (read: ones you care about) in the meanwhile, you'll have a much better idea.

These might be useful: Finally, here is the standard disclaimer about programming: I love writing code. Software is one of the great human undertakings. To hack well is both an extraordinary privilege and a pleasure akin to making music, writing poetry, or building a home. It is also, once you've got a job where your work matters, potentially among the more stressful things you can do while being paid to sit comfortably at a desk in a climate-controlled room. It will consume your life in ways that are hard to articulate and which will probably alienate you from your non-programmer peers. If you get a ways into this, and you don't find yourself programming on your own time for your own satisfaction, you might seriously want to look in other directions.
posted by brennen at 12:56 AM on October 31, 2011 [5 favorites]

A resource to check out: No C++ or Java, but does have C and Python and Ruby.
posted by xtine at 5:35 AM on October 31, 2011 [3 favorites]

If you're keen on learning Java, then I recommend the BlueJ Teaching IDE and textbook. It was developed as a tool to teach Java to college students, so the textbook has lots of projects and assignments in it.

My partner used it as part of a Master's degree she was doing. She had no programming background (or even an interest in it: it was a compulsory unit), but seemed to navigate it all ok. It gives a very good introduction to object oriented programming, even before a line of code has been written.

I was so impressed by it that I kept her textbook for myself.

It has its detractors, but I think it would be ideal for you if you want to jump a little more into the deep end.
posted by TheOtherGuy at 5:41 AM on October 31, 2011 [2 favorites]

it can help secure a decent career for at least the next decade or two

Just like there are different kinds of writing (fiction, non-fiction, journalism, copywriting), there are different kinds of programming at the career level. (Obviously there is skills transfer between them, just like with writing, but the feel/pressure/kind of code you're writing is very different. Are you crafting algorithms, are you fitting together in-house puzzle pieces, are you making strong use of libraries, back-end, GUI, web, etc.)

I just want to put it out there that it's not just about the code. For example, for advancement and for your own sanity, you want to have *architecture* always in the back of your mind, so you're not working harder than you have to.

So, even if you take classes or do tutorials on the web, beyond code, here are some often overlooked issues that I do find interesting in their own right:

Also google Hacker News, Slashdot, Joel on Software.

Have fun, write loops, make some cool little programs (games, toys, animations, mini-apps) because something in your imagination wants to be realized. But keep your eye on the sweeping big picture too, so you don't get lost in the details, flamewars, language wars, etc.
posted by zeek321 at 6:04 AM on October 31, 2011 [3 favorites]

(Also don't get bogged down in picking a language to start with, suggestions above are great, but another thing to file away:
posted by zeek321 at 6:08 AM on October 31, 2011 [1 favorite]

My link in my earlier comment was meant to be:
posted by xtine at 6:14 AM on October 31, 2011 [1 favorite]

I agree that taking some intro courses at a community college is probably the best way to get started. I think some formal instruction to act as a base for everything else you learn is really, really important. Like learning a musical instrument, it takes a lot of effort to get from novice to beginner.

As for mindset, you have to teach yourself to think in procedure. A way to start that is to think about other things that you do as procedures. What are ALL the steps required to brush your teeth? Walk to bathroom, find toothbrush, find toothpaste, put toothpaste on toothbrush, open mouth, brush around for 60 seconds, spit, rinse, etc., etc. And each one of those is a procedure- what do you need to do to find the toothbrush? Do you need to open a cabinet? How do you know which brush is yours? What muscles need to be flexed to grasp the brush?

Also, when debugging a program, have a notepad so you can make note of all the things you need to fix when you open the program to re-edit.

I recommend learning C first. It is both very simple, and very powerful. Almost every language builds off of those concepts. And you can practice to your heart's content on just about any linux distribution with gcc installed.
posted by gjc at 6:22 AM on October 31, 2011 [1 favorite]

I would start with Python. Python is a great language that is very versatile. It is used professionally, but is also good for beginners. Whatever you do, absolutely DO NOT START with C++. It makes me weep tears of pain occasionally and I have a B.S. in Computer Science. After a little bit of Python, I'd move onto Java. After that, C/C++. Seriously, listen to me. C++ is not a good language to start out with. I'm not telling you this because I think you're stupid. C++ has a lot to remember and the comp errors you get will not be useful (even people with years of coding have issues sometimes). You need lots of experience debugging your Python, Java, or Ruby code so that you know what to do when you get C++ errors.
posted by 200burritos at 6:42 AM on October 31, 2011 [2 favorites]

I recommend learning C first. It is both very simple, and very powerful. Almost every language builds off of those concepts. And you can practice to your heart's content on just about any linux distribution with gcc installed.

I completely agree. I am a fan of doing work in the highest level of abstraction possible, but to begin learning I recommend starting at the lowest. Languages like Python and Ruby, while great for productivity, stifle your understanding of concepts like memory management, endianness, etc. because they are all hidden from your view.

Another point: learn to program in a UNIX-like environment. If you are using Windows, install Cygwin and program using a text editor and the gcc compiler, do not spend a million dollars on Visual Studio from Microsoft (yeah, yeah there's a free version) -- it is a harder environment to learn because a lot of Windows specific annoyances get in your way.

A copy of "The C Programming Language" by Kernighan and Ritchie is the ideal place to start. You can get a copy on Amzn for I liken C to Latin in the etymology of programming. Learning C first is a great foundation for expanding your knowledge.

Of course, you could always start with Perl too.
posted by godisdad at 8:00 AM on October 31, 2011 [1 favorite]

secure a decent career for at least the next decade or two.

Learning how to program is a lot easier than securing a decent career. Why should someone (who will likely be around your age or younger) hire you with no programming resume when they can get someone just out of college for cheap? My experience is that the older you are, the harder it is to get hired to program. If in addition to age, you are untested in the job market, you are even less desirable.

You might do better going into business for yourself writing and selling apps.
posted by Obscure Reference at 9:32 AM on October 31, 2011 [1 favorite]

I'd start with MIT's free classes, then move on to's paid tutorials.

I hate video tutorials, but love everything I've seen from (and I've seen a lot).

I would also decide what types of things you want to program before you start learning C++. If you want to do web stuff, that's not the most time-efficient place to start.
posted by coolguymichael at 12:50 PM on October 31, 2011 [1 favorite]

Response by poster: Thank you so much, everyone who responded. Each and every one of your responses has been incredibly valuable. (It also underscores why MetaFilter is the best community for real answers I've seen on the Web.)

Based on your feedback, I think the approach I'll take is taking the online LearnCodeTheHardWay, which uses Python. That might be a good introductory language to get my feet wet, and since we're mid-semester right now, I can't take any classes at the local college anyway. I figure that if I have the gumption to get through that, I can proceed to the same online course on C (which the instructor is midway through so far; maybe it'll be done by the time I'm ready to take it).

I'll leave C++ and Java until the end, and focus on two solid university-level courses (I see them in the certificate program plan, although I'll probably pass on bothering to get certification) once I pick one.

I'll also slowly start to familiarize myself with the various architecture/library options. I suspect that might happen more "on the job" and ad hoc projects (i.e. the real-world, post-didactic phase).

As for my career prospects: I certainly understand that employers prefer younger, formally-educated, >ahem!< cheaper, engineers. I also know that small startups that aren't Google or Facebook in the Bay Area are borderline desperate for engineering talent. I'm currently on the other side of the hiring divide, and we've struggled for years to get halfway decent engineering talent hired. I suspect that unless Harold Camping was right and the world will end in some cataclysmic event, that this shortage of competent coding talent won't be going away anytime real soon.

And working on my own projects, like phone apps, might an alternative way to go, eventually, although I'm a social beast and prefer working as part of a live group (if I need to occasionally ask questions).

Besides, I think coding will fulfill some basic interests of mine: an interest in languages (I speak several), my desire to build/make things, and my interest in solving puzzles. I'm sure many of you are chuckling at my naivete, and maybe you're right. :)
posted by oaklandj at 2:27 PM on October 31, 2011 [1 favorite]

« Older iPhone iSsues   |   Help my phone help me find myself Newer »
This thread is closed to new comments.