I want to be a coder!
January 29, 2005 3:15 AM   Subscribe

I want to learn to code. I used to be a good coder - in 6502 assembler and VAX Fortran in 1988. I know nothing of the architecture of modern computers (OOP? kernal? shell? how one set of code on work on Linux and Windows). I guess I should learn C++ - what's a good resource (book I guess) for learning, writing apps compiling etc on my Win XP machine, and finally getting jobs?
posted by Pericles to Education (20 answers total) 3 users marked this as a favorite
 
As far as tools for coding goes: Microsoft Visual C++ .NET Standard 2003 should be your budget compiler and dev environment.

As far as learning how to code goes, pick up Kernighan & Ritchie's definitive The C Programming Language.

The basics of OOP are pretty easy - at the heart it's just C's functions combined with C's structures (custom conglomerate data types), although if you really get into OOP it can get pretty amazingly complex (personally I just tend to write C++ that looks awfully like C, which is fine for me but won't be appreciated in any professional development environment where code granularity and reusability are at a premium). Just about any semi-competent reference will work here, in college they threw Deitel & Deitel's C++ How To Program at us, and it wasn't horrible exactly.

Once you're over the hump of writing commandline (console) apps and want to move on to GUI-based stuff, I STRONGLY advise you to totally ignore Microsoft's horrible, horrible, vomit-inducingly bad Microsoft Foundation Classes "API" (and by "API" I mean "unholy soul-destroying lump of shit from the lowest circle of Hell") aka MFC. Instead, tap into Windows at a lower level with Win32 - it's a little less consistent, not as well-documented, etc., but it's a very cute little API without the overhead and with lots of neat tricks for you to keep on discovering. I've never really managed to get bored coding it.

Go to Winprog.org and hit up their tutorials to get started, supplementing your knowledge along the way with MSDN for formal reference.

Outside of that, I really don't have much advice (make sure you familiarize yourself with COM - Windows' Component Object Model, maybe?)- I've always been more into coding OpenGL crap than Windows apps, so my knowledge stops roughly here because that's all I've needed to know in order to code my own little things.

The next step for me beyond that you may already know everything about - a good solid Data Structures & Algorithms course from my college. If you want to learn stuff like Big O Notation, the difference between a merge sort and a bubble sort, and lots of other stuff about classic, important algorithms and the process of formal optimization then I strongly suggest you take one as well.

You'll also find that, once you know C/C++, you more or less know PHP as well, which can be handy for setting up a site using a LAMP stack, or something similar (I prefer BSD and PostgreSQL, myself).

As far as *nix coding goes - I have so little experience, and it was so long ago that anything I have to say would be doing you a disservice. As far as getting a job goes - your best bets are to a) have recently graduated college with a CS degree, b) have recent professional programming experience on your resume, or c) write something really, really cool and show it to someone. Those are about the only methods these days.

Good luck, and have fun.
posted by Ryvar at 4:00 AM on January 29, 2005


you mention linux + windows. if you want to write code that runs on both, you need to be careful if you use ms c++. i understand that it's a very good compiler (at least, the latest ms c++ compiler, not sure that's the 2003 stuff mentioned above) and the environment is good too, if you like that kind of thing, but you can't use it on linux and unless you're very careful you will start using non-portable libraries and extensions.

to be honest, i'd suggest starting with python, a cross-platform gui toolkit like wxwindows (others might suggest a better gui package - i don't do that myself. see here). if you want a dev environment rather than just a text editor, you might look at eclipse or komodo. again, i don't use either (just emacs, plus tools for uml, reqs, bug tracking, code management, etc.), but komodo has always stuck me as pretty neat (although not free, afaik).

the reason i'd suggest python rather than c++ is that it probably has a lower learning curve and gets you thinking about oop more quickly. in particular, unlike c/c++ you don't need to worry about memory management (ms c++ for .net will also do memory management for you, i believe, but then you're not portable). also, the docs are very good (start here) and there's good community support. once you're cool with python, you'll find c++ much easier.

if you're feeling more adventurous, try this, probably with this book.

you also mention kernel/shells - the kernel is the heart of the operating system and a shell is a way of interacting with the operating system (mainly on unixes). that's not really programming as much as being familiar with computers, unix in particular. if you really want to learn more, get a cheap/old computer and install linux. linux comes in various "distributions" - you might try suse (free), as that has a reputation for being easy to install/maintain, but this is the kind of thing people have strong opinions on, so i'm sure people will make other suggestions too. aletrnatively, you can try playing with cygwin, which adds a unix-like layer on top of windows, but you'll probably be confused/frustrated with that until you've used a "real" unix for a while.

finally, i'm sure i've answered very similar questions here in the past. search the archives.
posted by andrew cooke at 4:32 AM on January 29, 2005


if you just want a c++ compiler that runs on windows and linux, try gcc.
posted by andrew cooke at 4:34 AM on January 29, 2005


Andrew Cooke makes a solid point - most of my advice is moot if cross-platform coding is absolutely essential to what you want to do. Broadly speaking, people tend to use *nix for running their server daemons and Windows for running their client programs. The advice I gave was said bearing this fact in mind, and was targetted towards the Windows clientside programming because that's what I know.

On to other things - Python certainly has its merits (from what little I've played with it), but for coding core applications C/C++ is the de facto standard, and if this is at all for a job you are not going to get very far without knowing it. Period. Also, it might behoove you to learn Java, because I've noticed a LOT of employers out there seem to insist on it lately. I'm really not qualified to speak on the learning curve of C other than to say as a budding young programmer the entire language seemed completely intuitive to me. There are plenty of excellent (and cross-platform) memory management libraries and APIs out there for C/C++ if you need them, and there is every chance you will once you reach a certain level of complexity.
posted by Ryvar at 4:49 AM on January 29, 2005


yes, i was (honestly!) trying not to go too hard in that direction (other languages) because the original post mentioned c++. but i mentioned python because (apart from what i said above): (1) i suspect it's going to be some time before this becomes a paying gig; (2) c++ seemed to be something of an afterthought in the question; (3) it is quite possible to earn a living programming in other languages (i do it; in fact i suspect the majority of "programmers" here aren't in c++ shops).

on that final point, i'm actually working in a project based on fortran 66 at the moment, so don't ignore your (Pericles) experience there.
posted by andrew cooke at 5:22 AM on January 29, 2005


I second Python to get the basics of OOP down, and learn modern coding techniques. Picking up Python and learning OOP through it should take someone with a programming background a couple of weeks at most (about only 2-3 days of which should be Python itself).

But for employable skills and a decent environment and architecture I don't think you can beat Visual C# Express and .NET: The MS "Express" environments are both free and much easier to learn than anything comparable in say Java.
posted by costas at 6:23 AM on January 29, 2005


You sound similar to how how I started out - engineering degree, but no formal training in programming beyond highly procedural "Fortran for Engineers" on a VAX cluster running VMS.

Personally, I've never learned c/c++ and never felt the need to. Nothing wrong with them, but Java, VB, Python, a touch of Perl, and other crappy web scripting languages have kept me busy until recently. I've recently become a big fan of MS's .net framework and c# (very Java-like). Whatever. Despite the arguments on slashdot and the like, the concepts are more important than platforms, compilers, IDEs and languages. To that end, I strongly recommend The Object Primer, for understanding modern OO programming techniques. After a bit and (more importantly) some practice, you might then want to study design patterns.
posted by normy at 6:41 AM on January 29, 2005


C++ is an abomination before God and Man. I'd strongly recommend learning Java instead. Easier, more powerful, and very similar to C++--but not evil.

If you really want to learn C++ you'll need: Stroustrup (Language), Josuttis (STL), Lakos (project organization), and Meyers books.
posted by nixerman at 8:13 AM on January 29, 2005


If you just want to write actual code for a living, you will be better off with a certificate from DeVry and such ilk, rather than a CS degree from a major university, the latter being like obtaining a pre-law degree just to become a uniformed cop.
posted by mischief at 8:53 AM on January 29, 2005


You could start with javascript, which is free and cross-platform by definition, and the syntax will familiarize you with the c-c++-java family. You need to know HTML also though, so if you don't it's not a good choice.

Otherwise, I vote for java. It's cross-platform, object oriented, free, widely used, and its syntax is similar to many other languages. It has become the standard intro level language at colleges (and even high schools), so there are lots of good intro texts available. There are also some decent RAD tools available.

Python would be my next choice, for many of the same reasons I suggest java. It is perhaps a better introduction to object-oriented programming. The syntax, however, isn't really like any other language and that's why it's my second choice.

C is a good extension of the knowledge you'd have gained from assembler, but it isn't object-oriented (at least not without a lot of work) and therefore isn't a good intro too more current languages.

Stay away from C++. It's very powerful but also kitchen-sinkish and I think you need to know it well in order to make use of its power.

Perl is a mess of a language. It's essentially unreadable so it's difficult to find coding examples to learn from. Avoid it.

VB is, syntactically, a dead end and it's neither cross-platform nor free (although VBScript is available via MSOffice and Windows Scripting Host).

And forget all the FORTRAN you learned. Little of it applies to a modern language.
posted by TimeFactor at 8:55 AM on January 29, 2005


I'll second the Python recommendations. Unless you have a specific reason to learn C++... you don't have a reason to learn C++.
posted by agropyron at 8:56 AM on January 29, 2005


Also, become reasonably competent in a (modern) language before learning CS fundamentals. I found it easier than most of my classmates to understand basic algorithm and data structure stuff because I'd already been exposed, albeit unknowingly, to much of it and had the ability to try out the theory. You'll need to understand pseudo-code anyway so you might as well learn a real language. You'll also know a lot of processor basics from your assembler experience.
posted by TimeFactor at 9:08 AM on January 29, 2005


If you already have the logical background for coding (it has really hasn't changed since 1988), I would echo the recommendation that you start learning OOP with Java, Python, Perl, ColdFusion, anything but C++. C++ is the most powerful of the options, but with the power comes generally unneeded complexity. Most notably, platform specific versions and classes make mastering cross-platform C++ a tougher challenge than Java. Bugs in memory management are also no fun to debug while learning.

You might also be suprised how much work you could get if you brush up on your Assembly skills for mobile and/or new media devices. The catch-22 of programming is it is hard to gain experience in a new language because everyone wants experienced programmers. If you have work experience in Assembly, use it for what it's worth.

I like the Wrox and Dietel & Dietel lines of books for soup to nuts introduction to a given language.
posted by McGuillicuddy at 9:56 AM on January 29, 2005


try looking at local job listings. if no-one is offering to pay python programmers, and you want to get to work quickly, python might not make sense (for example).
posted by andrew cooke at 9:58 AM on January 29, 2005


Unless you have a specific reason to learn C++

Real-time critical applications with careful memory management and performance optimizaton requirements. A small fraction of all software, in other words.
posted by normy at 10:25 AM on January 29, 2005


This thread can very easily turn into a language religious war. There is something about geeks and their tools that sparks fanaticism.

Bearing that mind, if your eventual goal is to use these skills for employment, and not for hobbying, I would recommend Java hands down. From your previous experience with VAX Fortran and ASM, it sounds like you were doing non-user interactive work.

Java is now the industry defacto standard for server side work. Check out Monster and Hotjobs for the Java, Python and C++ keywords. The only one being even close is C++ and Java overtook it some years ago.

The cools kids don't like it since its only free and not free. Plus, it has a reputation for being a bit slow from a few years ago. Additionally, its GUI toolkit is pretty crappy.

However, it's a very easy to learn OO based language, if a bit verbose. There are an incredible array of resources on the web for learning Java, with multiple websites dedicated to helping all levels of Java programmers. Additionally, the number of free (usually LGPL or Apache licensed) libraries is amazing.

There are a number of tippy-top rate free IDE and toolchains available for Java. Eclipse, NetBeans, and IDEA (free for beta and noncommercial work) all are at least the equal if not better than Microsoft's vaunted VisualStudio.

Additionally, the Java community has embraced alot of modern development methodologies used by programming shops. Most notably is unit test first and continuos build development. I recommend looking into the excellent JUnit framework and CruiseControl product to learn.

Plus, Java has the advantage of being highly portable. While the Write Once, Run Anywhere tagline is a bit of misnomer, getting java programs to run on Win32, Linux, MacOS, FreeBSD and Solaris is very easy, and recent JVM's have gotten much better at being consistent across platforms.

If your looking for something easy to learn than makes you marketable very fast, I don't think anything can hold a candle to it.
posted by PissOnYourParade at 12:22 PM on January 29, 2005


If you do want to learn C++, then there's a few free online books available. One of them: Thinking in C++.
posted by Gyan at 7:47 PM on January 29, 2005


To summarize: Object Oriented Programming is where you set up complex programmer-created data types that have functions and variables within them, called "classes," then create instances of them - for instance, in a server you might have a "SocketListener" class that has methods (functions) like "start()" and variables like .listenPort. Or a "Demon" class in Doom 3 could have some variables like height and methods like "eatHero()." It's easy once you see it.

The Kernel is the core hardware interface and storage system of of the OS, as opposed to the rest of the OS which is just a bunch of programs and files, eg "ls," on top of that.

A shell is a program to give the user the command-line interface that's run automatically when you start up (the more complicated combination of windowing system + desktop environment + window manager is the same but for GUI).

One set of compiled code can't work on Linux and Windows, you have to tweak it up and compile it for each one - the difference is in the system calls, as they're both (usually) x86 remember. Java can theoretically run on both and even other processors and OSes barely if at all changed, but that's because it uses its own instruction set (virtual machine) that's automatically converted to native binaries by an interpreter when you run it. Interpreted languages also can run on multiple platforms for that reason.

Anyway, as others have said, it's probably best to get a vice grip on Python, then move on to something like the revered Thinking in C++ (available both in print and free online editions). The "Thinking" series makes OOP a bit tedious and less effortless than it should be, which is why it's probably good to learn Python first (I think even Eckel recommends it).
posted by abcde at 12:37 PM on January 30, 2005


abcde, not a snark, but what good books do you recommend for C++? Bonus points for free, online works.
posted by Gyan at 3:38 PM on January 30, 2005


I'm not by any stretch a C++ expert. Thinking seems to be the best that's available free online, probably one of the best period. The one I happen to have is Wrox Beginning C++ but I don't particularly recommend it because like most Wrox books it's one of those incredibly drawn out "bible" books that in my eyes are probably just an excuse to charge $50.
posted by abcde at 3:47 PM on January 30, 2005


« Older Help me track down a volume of Nabokov's poetry   |   Hangover? Insomnia? Newer »
This thread is closed to new comments.