Ask HN: Which language should I start learning?

8 points by shkabazi ↗ HN
Im in the last year in high school. I wanted to major in Computer Science and Engineering but I don't know any programming so I thought I should start self-teaching me at least the basics. The first language introduced at the university that Im going to is C++ but I read on the internet that C++ isn't a good language to start with ( too complicated for beginners), Python and Ruby seem more suited for this purpose. So now I'm confused, should I start learning C++ so I have a good background on it and risk not fully grasping it or start learning Python (or Ruby or any other "first language") and get my programming basics right from that language, and learn then C++ at the uni? Please elaborate your recommendation and thank-you in advance.

17 comments

[ 4.2 ms ] story [ 43.5 ms ] thread
Given your situation, I would suggest learning C right now. C is a small language, and will be a good ramp up into C++. A lot of people around here readily recommend Kernighan and Ritchie's The C Programming Language as a book for learning C, though for a beginner, it can be a bit terse.
Learn not the language, but how to use them.

Stop reading this thread and start writing some program/app right now.

Don't know where to start?

Simple: Make a Rock Paper Scissors game in C++|Python|PHP|etc.

Really?

Yes. This little game will allow you to learn the basic principles without much frustration. You will use variables, functions, conditional statements, and loops to make it happen. You can then go and use arrays and object oriented programming to learn more. But just focus on making it work first.

Then, after it sort of works, move into something entirely different.

Like what?

How about a little web app to track your finances?

That's so boring, you might say, but it will teach you many things.

Like:

- Finishing a project is 10000 times harder than starting one. - Many languages in one sitting (HTML/CSS/PHP/SQL/JS/etc.). - How to organize files around. - The importance of comments and readmes. - How to play around with linux to get your stuff to work. - How to work with apache (on XAMPP). - How to work with versioning (GIT, etc).

One last thing:

Don't stop because you are stuck! Push through! Most of the software I build is done so when frustration is navigating around my brain, trying to wreak havoc in the sea of my thoughts.

Note: I know this is rather off-topic, but I'm a long time lurker who saw the opportunity to assist a young mind learn.

Good luck kid,

Never quit, don't give up, you will do it.

I can't second this. Too many people spend time trying to find the best way to do something. This is only possible when you understand the domain. Until then, move fast and break things!
If I were you, I would start messing around with Javascript first. Yes, there are MANY weird things about Javascript. But, the nicest thing about it (for you) is that all you need to start programming with it is a web browser!

Codecademy also has some great simple Javascript tutorials. All you need to worry about now is learning the basics, and the core concepts you learn in Javascript will apply to almost every other language you learn.

first and formost, learn something. don't waste too much time trying to find the "correct" language to learn. Here are three options:

-If you are interested in reading SICP, then learn scheme -If you want something that is a good prereq for C++, learn C -If you want a simple and very useful language, learn Python. You'll probably keep using it in the future

Learning the basics of any (within reason...brainfk,etc not included) is within easy reach of a beginner. The difficulty with languages and C++ is the more complicated features like templates and such.

Every minute you spend researching and trying to decide which language to use is time wasted. You shouldn't be learning languages at all, you should be learning concepts. Figure out concepts like what linked lists are, recursion, inheritance, etc. Then learn the details of some language, then go back to the fundamentals and realize how little you knew before. Rinse, repeat.

This advice is for someone interested in CS as opposed to just programming. Yes, there is a huge difference.

Stop wasting your time and start something.

In my personal experience, the hard part for a beginner is not the actual programming, but the environment. Fussing with the command line to compile and link a program, or setting up system environment variables, class paths etc. pp. can be a frustrating experience. I would argue that for a beginner a good IDE is an important tool to getting you up and running, having fun and keeping motivated.

I would therefore recommend something highly integrated like Visual Studio C# Express Edition which you can download for free. If you have Microsoftphobia, the alternative would be Java with Eclipse.

Having said that, at one point you HAVE to leave the "kiddie pool" and jump into the deep end. For that I would second the recommendation of Kernigham & Ritchie's The C Programming Language.

The order of these two steps is up for debate...

The good thing about learning C/C++ first is that it will help you understand how the internals work and you will (should) learn how to program efficiently and understand basic algo's and methodologies. For that matter, assembly might be a good start! :-) If you understand HOW things work, it will not matter what language you elect to use down the road (for example, you might want to use Rails because it makes developing web apps a pleasure, or whatever). Ultimately, your choice.
I'm doing the same thing and writing a blog at www.codepo.st. I don't think it really matters what language you start with. After a couple of months you'll find out about different languages and naturally find you way to ones that you like.
I doubt there is one objectively and universally "best" path to learning to program. What worked best for me, might not work well for you at all. In the end, my feeling is that any programming with a (reasonably mainstream) language is a fine choice. And by "reasonably mainstream" I basically mean any language that wasn't intended to be an "esoteric language." So even a less widely used, but still somewhat practical language like Haskell or Ada or Erlang is better than not starting at all.

That said, I think any one (or two) of C, C++, Java, Ruby, Groovy, Python, or Javascript would make a good starting point. All are widely used enough to offer plenty of community and support for beginners, none are so hard to learn as to be especially prohibitive, and all are used in industry and the F/OSS world to a fairly wide extent.

And if you put a gun to my head and asked me to name on recommended place to say, I'd say "C".

Learn Java.

It is relative simple comparing to c/c++, so the initial learning curve is not steep. At the same time, JAVA (language and platform) is complicated enough to learn computer science topics. Eclipse is a great free IDE you can use.

After that, you can continue to learn other languages.

Learn C - become a punter in C.

The hardest part is learning Pointers. It will take lot of time to become a punter in c.

With C you understand the inner details and working of programs and memory. Learning C is a fun ride - you play with Pointers.

Get involved with some Open Source projects that's built around C and heavily on Low level programming. Play with Beagleboards and make it your toy.

From my experience (disclaimer: I love python :) )

C++ : would be too hard to learn on your own.

Python: That would be like gliding on clouds. But then, if it's your first language, you may never be able to walk on the ground again ;)

C: It would be a rut, and you will stumble a bit. It is low enough for you to understand what is really going on in there, but hopefully high enough for you to learn on your own. RECOMMENDED.

Java: Tried to do in too many words what python does. You will cross path with this mammoth surely in your future. But you do not need to do it now :)

You could also start with scheme and SICP. It is highly revered (by people I respect) as an introduction to computer science (the version from 2005 which is based on scheme, not the latest one based on python), but I have no direct experience and cannot comment on it. I plan to do it some day.

In the end, enjoy programming. Thats the only way to sustain years of computer addiction.

Happy Learning!

I'd say C just like many others did.It helps you to know the programming concepts, and what happens behind the scenes w/o too much stuff. If you start with Python (though i love Python) , things get done , but you don't feel like working on complex languages. And as C++ is the starting lang at uni , basics of C would really help.