tags:

views:

217

answers:

11

Possible Duplicate:
What’s the Easiest Way to Learn Programming?

I'm very new to programming, but it has always interested me. I've tried to learn a couple of times except I don't know where to begin. What's a good language to learn first? What is a good website that can help me learn it?

I once partitioned my hard drive and installed Ubuntu in an attempt to learn Python, but I was overwhelmed. I didn't know where to start or what to do.

All suggestions, feedback, comments are welcome.

A: 

You have to first of all decide on a first language.

Scripting languages like Python are lightweight and let you get cracking fast - but they are very powerful with some unique concepts like functional programming.

Other languages, like Java, are heavier in their syntax and style, but IMHO are easier to debug and force you to think about object oriented programming.

Certain languages, like C/C++, are closer to the operating system (or at least, are less sandboxed) so screwing up can be costlier and more frustrating.

There are free environments, compilers/parsers, and IDEs for all these languages, and really great free online tutorial.

In fact, for Java and for Python the official tutorials are better than most books.

By the way, I have no idea why you would need to partition the system or run Linux to try Python. Python works very nicely on Windows and on Mac OS X and is fairly straightforward to install.

Uri
+7  A: 

I once partitioned my hard drive and installed Ubuntu in an attempt to learn Python, but I was overwhelmed. I didn't know where to start or what to do.

Reinstalling your operating system is not going to help you learn how to program. You can learn the basics of programming with any decent operating system, so if you're trying to learn programming just stick to the operating system you are used to so that you don't have to learn two new things at once.

A good way to learn how to program is to find a good tutorial or book and follow it through, typing in the examples and running them. Then make sure that you understand why they work and how you could modify them to do something slightly different. When you have completed the tutorial, try making a simple program of your own choice using the language documentation as reference.

Good luck!

Mark Byers
And since Python is cross platform, installing Ubuntu just for learning Python is not a necessity. Installing Ubuntu because you're tired of Windows, OTOH, is a different issue entirely ;)
Wayne Werner
+3  A: 

If you're learning Python, subscribe to the [email protected] mailing list. For a week, just read the emails and get a feel for what's going on.

During that week, pick one of these books/tutorials:

If none of those links intrigue you, there are others available.

Last but not least, when you start learning a little more, the python documentation is an invaluable resource for figuring out how stuff works.

I've learned several new languages, but Python is by far my favourite and I feel the easiest to learn. It has most of the power you would expect from a lower level language, but a lot of the messier details about programming tend to be hidden away from view so you can just begin to enjoy learning to program.

Good luck!

Wayne Werner
A: 

The most effective way to learn how to code is to actually start writing code. I recommend C# or Java as good languages to start with. For starters, think of an application YOU would find useful, then set about developing it.

There are a huge amount of websites related to C# and Java. The only way to start is head first. Stay clear of 'Learn x in 21 days' books etc. In my opinion, these not great tools for learning. The second way you can learn is to read code written by others. Find an open source project you find interesting and begin reading and understanding the code.

Jimmy C
A: 

I'd go with Java or C#, just because errors tend to be much more informative than BAD_PTR (C/C++), and python assumes you know what you're doing (typo in a variable name = new variable!) and personally I hate white space significance. Plus they have a bunch of libraries to help you out with a lot of really tedious parts that you might not understand how to do yet (e.x. string concatenation, unmanaged memory).

As far as what to start with...always start with "Hello, world!" to make sure you're grounded :) beyond that, I'd try to figure out how to read in output (e.x. "What's your name?" type in Name "Hello, Name!").

From there learn how to control code, stuff like if/else statements and loops.

Once you get data in and out of the program and control the code you can do cool stuff with it. I got started programming with a TI calculator because I was tired of doing the quadratic equation, so I made a program that read in a *b* and c and gave me back two answers.

Zwergner
Null Pointer Exception isn't a whole lot more informative. `NameError: name 'foo' is not defined` has a lot more information. The only difference is whitespace significance, but if you already format your code, is it really that bad?
Wayne Werner
A: 

My perception is that there are people who take naturally to programming, once they get started they almost can't help themselves from learning more. Others really have to work at it, and seem to find it more of a chore. I've got three adult children and I can see this pattern amongst them.

My suggestion is to take and language that's readily available to you, and which does not need much installing or insfrastructure set up. Find a "Teach Yourself in 24 days" or "... for Dummies" and rigourously work through the book. This is not because the particular language matters much, but rather to find something about yourself.

You will find that your simple "print out a fibonacci sequence" or "how old are you" programs don't work, have little typos that give mysterious errors, or seem give wrong answers. Then you make little changes and Bingo! they work!

Now some folks find that frustrating and annoying, and never seem to get better at it. Others seem to relish the challenge and find great fulfilment in doing this. If you're the former then you probably need formal tuition if you are to progress. If you're the latter you'll probably be off learning C# and Lisp before you get through the book.

djna
+2  A: 

I think the best order to learn would be Python, C, C++, and then whatever you want. That's at least my experience, since i'm not a computer science student (i'm a photographer!)

Python is very high-level and it's easy to understand, it also has a lot of built-in modules and there are a lot of tools to do almost anything you can think about, it also has a lot of bindings for other libraries.

When you feel comfortable with Python, the change to C is quite easy too, since the structure is similar.

I know very good resources to start learning Python, but they are in spanish. And, the best place is always python.org :)

Oscar Carballal
A: 

I think what helped me starting out (and I'm still fairly new) is getting in there and actually working on a project. Its one thing to poke around and try different things but there's nothing like working towards a finished product. Give yourself little projects to work on like making a little helper application that you can use yourself. This will help you get into the code and start understanding the concepts and the tools. As you go along, try to pick different projects that will expose you to new features/problems and continue to grow your skills.

markiyanm
A: 

Since it seems that you have a preference for Python because you already tried to learn it, I suggest you watch the video lectures by Google's Python Class (just google it). The lecturer might go a little bit fast, but don't worry since the concepts start really basic. It will get your feet wet.

There's no need for you to (re)install any operating system just to learn a language. Formating and installing an OS has "nothing" to do with programming and takes valuable time and you have to back up stuff.

Another great resource is Stanford's Engineering Everywhere initiative. Intro to Computer Science in Java I particularly like Stanford's series because everything is provided: video lectures, handouts, problem sets, solutions, and you don't stop after completing the first course. There are a total of three that build on top of the previous course. It starts with Java, then goes to C++, digs deeper into C++, then you get a good overview of Assembly, Lisp, Python, etc.

There is also another free Python course with video lectures by MIT's Open Courseware: ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/

Since this is stackoverflow, I can't help but mention the SICP book!! Structure and Interpretation of Computer Programs. It's free and online.

chiurox
A: 

So, compared to some of the people that have replied, I know nothing... However, this is just my personal experience and you might find it helpful. I started by programming PHP because I was tired of writing HTML, so I made a small content management system. It taught me bundles. PHP is fairly forgiving (compared to say, C) and it will get you used to the basics (variables, loops, operations, functions, etc).

A lot of people are saying "python python!" but I'm honestly not sure if that's what I would have learned first... I would go Java first, and that's also what most colleges use in the introductory classes (and often beyond).

www.codingbat.com is fantastic for Java OR python - I used it a lot to study for my AP exam in high school, and it really breaks each problem down so you can get used to how little snippets of code work. Good luck :)

alleywayjack
A: 

In my honest opinion you should read a book on fundamentals of OO programming. Don't start with C++ since it might confuse you with pointers. Don't go with PHP because it's weakly typed and it's rather flexible - I don't think that it's a good foundation.

Don't go with visual basic.net - yes it's capable of a lot, and a lot of applications are written in VB.Net,however, when you learn C# or JAVA it'll be a lot easier to transfer your skills to other C-like languages.

That leaves you with JAVA and C#. Get a book on fundamentals, spend a lot of time on the concept of classes, re-usability and once you are comfortable with that move onto inheritance and interfaces. By that time you should have enough to understand the basics.

Download open-source project, nothing too complicated. Break it. Before you break it, learn how to use debugger and step through lines of code annotating each line, making sure you are 75% positive with what it does.

I wouldn't listen to people who despise .Net framework or java framework - both are very powerful and rich tools.

Google and blogs are your best friends.

Search for "Gang of four" once you are comfortable with classes. This book will give you a very solid understanding of OO programming, even though many may argue that examples in the book are confusing and structured badly.

Good luck

vikp