-
A word about a career in programming... it's not for everyone. It takes a special kind of madness to want to program for a living. You're going to be sitting in front of a screen for 8 hours a day every day for the rest of your life. You will forget about such things as sunshine, fresh air, and physical exercise. You will forget how to interact with human beings. You will spend 3 hours looking for one bloody line of code in your program that's causing it to crash. You need an attention span and attention to detail that borders on mental illness. You need to make your brain think about things in a way your brain was not designed to operate. You need a lot of patience and a lot of tolerance for frustration. The money is good but it's not good enough to make up for doing something you hate. I have known many people who tried to go through CS in college and had to quit simply because it was so frustrating and unpleasant for them.
That said, I'm a programmer and I love it.
If you want to be a good programmer, you need to learn the concepts underlying programming. Learning the syntax and quirks and ins-and-outs of a single language is only a vehicle for learning the underlying concepts. The concepts are what's important.
At work I had to write a C# program, and I got it done in 3 days even though I'd never even seen C# before that point. I didn't know the multithreading library in C#, but I knew how threading works in general, how to use a mutex, how to identify and avoid race conditions etc. I didn't know the C# GUI toolkit, but I'd used GTK, Qt, Tk, Swing, and others before, and I knew generally how widgets work, how event handlers work, and so on. Understanding the broad concepts will let you learn a specific language quickly because all languages mix and match variants of the same concepts.
For learning concepts, the best thing is to start with a language that gets out of your way, so that you don't have to arm-wrestle with the syntax of the language, the quirks of the compiler, and other bullcrap. Specifically, a dynamically-typed language encourages quick exploratory programming in a way that a statically-typed language like Java could never do. I recommend Ruby or Python for this reason.
The best way to learn is to write a ton of code, and read a ton of other people's code. Write a program that renames all the images in a directory to number them, like "001.jpg", "002.jpg".. "100.jpg". Write a program that checks the weather for you by fetching it from Yahoo.com and printing the temperature. They're practical, hard enough to challenge you, but easy enough that you can complete them and feel like you accomplished something. Check out <a href="http://rubyquiz.com/">Rubyquiz.com</a>.
Get a good algorithms book. Learn the classic searching and sorting algorithms. Learn about data structures: linked lists, hash tables, trees, graphs, etc. These concepts are essential for every language. You can get away with using hash tables in Ruby without knowing what a hash table is or how it's implemented, but it will bite you eventually. Eventually, you'll want to learn about how programming languages work. Call-by-reference vs. call-by-value vs. call-by-name. The strengths and weaknesses of garbage collection. Dynamically typed vs. statically typed. Strongly typed vs. weakly typed. Compiled languages vs. interpreted languages.
Do NOT start with C++. C++ has too many dark corners and ridiculous syntactic quirks and unexpected behaviors. You will spend most of your time battling C++'s horrendous syntax and getting the compiler to work, and not enough time thinking about programming itself.
Eventually you absolutely must learn C, so that you understand what's happening under the hood. Interpreters for most other languages are written in C, for example. But do not start with C unless your goal for life is to be a systems programmer. C is too close to bare metal and encourages a certain kind of coding that doesn't work with higher-level languages.
If you're REALLY serious about learning programming, you should learn at least one or two languages from different families. Learn a "mainstream" workhorse language like Java or C#; learn a Lisp (Scheme or Common Lisp); learn a pure-functional language like Haskelll; learn a declarative language like PROLOG; learn a "pure" object-oriented language like Ruby or Smalltalk; learn assembler for your home computer's architecture if you can stomach it. Learn C++ last, so you can get a good laugh out of it. Learn SQL eventually, but given knowledge of other things, you'll pick it up along the way. Same with XML / HTML / other pseudo-languages.
MIT for a long time used a book called <a href="http://mitpress.mit.edu/sicp/">Structure and Interpretation of Computer Programs</a> as an intro to computer science. It uses Scheme. It's a good book and the text is free online.
tl;dr learn Ruby or Python.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules