Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was looking for some guides to start programming with, I'm a college student and I'm learning Ruby as my first language (Side-question, is that something good to start with?).

I found _Why's guide to Ruby and I also found Learn You Haskell (which is of course not Ruby) and I was curious if there were any more guides/books like these, free and fun to read? Just for future reads and to know about.

Will reading a book or guide actually teach me programming, do I just have to hop from one book to another until I understand the concepts because I feel like most books focus on theoretical stuff and I don't actually pick up much programming from them. Are there any "just do it" ways of learning programming? Like do I just sit here and start writing bad code until I get better or do I go out there and find some code and edit it? Because ultimately I want to write my own code but I want to see some good examples.

share|improve this question

closed as not constructive by gnat, MichaelT, GlenH7, ChrisF May 9 '13 at 12:04

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

Don't think starting with one language is necessarily better than another. You'll be fine with Ruby - can't go wrong there –  Jaco Pretorius Oct 7 '10 at 7:34

5 Answers 5

Preface: Although Zed Shaw is a bit of a rebel in the programming community, and I don't agree with everything he says, he does have many good points.

This one is also not Ruby, or Haskell. This is Python. http://learnpythonthehardway.org/

My first programming language was JavaScript. I think learning any object oriented programming language would be good to start out with, although I've been interested in learning Haskell recently too.

share|improve this answer
Javascript is great and I hear, think, feel, and believe that it runs the internet (this might not be true but it sure feels like it). I'm glad ruby's an OO language then, I wasn't sure if I was getting a full experience of learning a programming language. And this python glad, I appreciate it! I will be reading it ASAP! –  Muhammad Usman Oct 7 '10 at 9:27

Lisperati comes pretty close for Common Lisp, though Dr Barski doesn't have as good a sense of design as Miran Lipovača.

As far as learning programming; no. Going from book to book won't do it. Probably the best approach is to pick a project, then implement it in a language you like. Repeat until you're out of languages, then repeat with your favorite language until you're out of projects. You don't have to start big; try implementing your website in something other than HTML (since you're into Ruby at the moment, you could do a lot worse than pick up Rails).

Other than that, it really depends what you're into. If you like cooking, maybe implement a recipe tracker (if you're feeling adventurous, try implementing a recipe generator). If you mix, look into (i)mpromptu or (fluxus) or other live-coding systems. If coding is the hobby you're trying to get into, try implementing your own bug tracker/source control/editor (it's worth noting that you probably shouldn't actually use anything you build at this stage; Redmine, GIT and Emacs already exist, but trying to implement something similar will give you an idea about how they're structured).

Once you're practiced and have a better understanding of whatever languages you've decided you like, start reading others' code (you can try this earlier if you like, but you need to get the language before it'll start being very valuable to you). GitHub and similar sites are plentiful, no matter what your VCS choice happens to be. If you find a project you like and use, try contributing to it.

share|improve this answer
Land of Lisp is a great book but it's more for intermediate programmers rather than beginners. –  omouse May 13 '12 at 22:26

There is an Erlang version of Learn You a Haskell for Great Good.

This book is for you if you’ve got some programming experience and if you’re not too familiar with functional programming. It can still be useful if you’re too good for that, as we progressively go into more and more advanced topics.

The book started as a free online guide, and you can still read it that way. If you prefer the soft touch of paper, the delicious smell of a real book, the possibility to physically hug a document, or just want to boast by padding your bookcase, you can buy a few copies too (and e-books are also available)...

share|improve this answer

The "just do it" approach works best, that's why it's a bit of a cliched response to a question like this. Find a project that you're interested in and do it in a language you're interested in, read books that run parallel to this. Expand upon it.

A large project will teach you valuable lessons like having a good grasp on the design before writting much code or(replace this or with an AND if you want to be really awesome!) keep things loose (as in loosely coupled) enough allow lower level changes without mangling a great deal on up the food chain.

The refactoring you'll have to do when you inevitably paint yourself into a corner will make you concious of design patterns and when to use them.

This is the very important bit that you will likely not encounter in school: Programming is more than n or n+1 languages. It's a combination of algorithms, languages, design paradigms and history.

Although it certainly helps to master a couple languages if you want some sort of career! I'd suggest digging deeper into metaprogramming concepts. The art and science of programming is about wielding tools to create tools.

share|improve this answer
Currently I'm learning Ruby's syntax actively and want to keep going with that and I think you're right because I've seen a lot of books and after reading half the book, I feel like I've just learned a lot about the author and less about programming. What do you mean by metaprogramming concepts? –  Muhammad Usman Oct 26 '10 at 1:04
Metaprogramming in the simplest manner is programming to facilitate programming. Things like find and replace using regular expressions, creating and using macros, and monkey patching (or duck punching for rubyists) are examples of metaprogramming by this definition. An interesting and rather short read for me was the productive programmer as well as metaprogramming ruby. I've been very happy with books put out by pragpub. –  MushinNoShin Oct 26 '10 at 4:16

Basically, to learn to program, you need a tutorial, a reference, the compiler/interpreter, time, and dedication. It also helps to have a guiding person. Decent college classes accelerate the process somewhat for the average person.

Pick something you want to learn and put your nose to the grindstone.

To learn to code takes about 6 months. To be somewhat competent takes about 2 years. To know what you're doing takes 5-6 years. To be good takes 10 years. Time may vary slightly depending on how natural you are for sequential logic thinking.

Put another way: you will to write something on the order of 15,000 lines of code before you're an ok coder. (That's 3-5 small projects that aren't trivial). 100,000 LoC is sorta an experienced coder. Lines of code is a terrible metric, but all the other metrics are worse.

I recommend Haskell or Scheme if you have a mathematical bent, C if you like electronics, and one of Perl/Python/Ruby for the web. Javascript is a nightmare of a language (There's a reason Crocker wrote an article called "The Good Parts"), and should be avoided for initial programming learning.

There is no substitute for experience, unless it's experience not repeating the same mistakes.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.