Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Personal context: I've been learning C++ formally the last 6 months at university. Prior to this I dabbled in JavaScript for a year. Now I am considering learning Python during a month off school.

By splitting my focus early in the learning process am I degrading the efficiency of my learning? Should I spend the month off continuing in C++? Or is it never too early to learn a new language?

share|improve this question

closed as not constructive by gnat, Jim G., Walter, Bryan Oakley, Robert Harvey Aug 22 '12 at 22:36

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.

If you understand programming in general then learning new languages should help you become a better programmer. If you're new to programming and haven't grasped things like flow control, data types, functions/methods etc then I would wait to learn other languages. – The Muffin Man Aug 22 '12 at 4:45
I'm quite comfortable in C++ with everything you mentioned. – Anticipation Aug 22 '12 at 5:27
I will place your question into perspective. Within the first 6 months of being at a university I had already been introduced to 5 different programming languages. Assembly( I forget the exact Moto platform it was), C, C++, Visual Basic 6, and Java. I later went on to learn Basic, C#, Visual Basic .NET, x86 Assembly. After college I have learned at least 5 additional programming languages within the first 2 years. – Ramhound Aug 22 '12 at 12:52
If you can multitask and prioritize and have a disciplined approach to learning, then by all means go ahead and learn a second language. Usually its best to focus on and master the first language. However, its also important to learn various programming paradigms. Read the programming section of the following links to see what I mean: What Every Computer Science Major Should Know and Programmer's Competency Matrix – Anthony Aug 23 '12 at 12:38
up vote 8 down vote accepted

My experience with Python is limited to some play code only slightly more complex than hello world, so this won't be a very in-depth answer for python specifically, but I can tell you this:

The differences between the languages is in details like the syntax and certain language specifics will be different (like the different ways errors are handled, I/O capabilities and how compilers convert your input into something executable), but C++ and Python both offer the same paradigms, so problem solving can be done in much the same way with both languages. Both C++ and Python are Imperative and Object Oriented, so you're probably going to pick up python quite fast if you're comfortable with C++ once you've mastered the new syntax using problem solving techniques you've picked up with C++. If you want to, you can use Python for functional programming as well, but I've never touched that part, so I can't tell you much about it.

Is it too early? I can't really tell from your story in a definitive yes or no. Are you already confident enough to write full (GUI) applications with C++? (i.e. use libraries, more complex language features like generics and/or templating etc.) I think that learning a new language paradigm is much harder than learning a new language in the same paradigm family. When you step out into new paradigm territory, you'll have to spend much more time for getting a good idea of how to solve problems with that paradigm. Between OO languages there are differences as to how inheritance is dealt with, and how data is passed in the memory when you pass a parameter/argument to a function affecting performance. But to get going these are usually of minor concern at first.

My guess is that if you're confident enough with C++ to do something more than hello world in a fancy way, you're ok for launch. Learning many languages superficially will help you understand code samples regardless of the language used, but creating your own code requires a bit more understanding of how the languages work and how they differ from each other.

P.S. When I want to learn how to use a new language superficially, I'll usually try the following things to get a feel for the language syntax and superficial workings:

  • Hello world (Text on screen)
  • Hello world written to a file (teaches you the basics on file I/O for that language, and very often other kinds of I/O as well)
  • Doing some standard calculations with different bases (10, hex, octal), both integer and floating point. (teaches you about truncation and number notation)
  • Try to use some graphical library to show hello world in a fancy dialog. (teaches you how to use libraries and external code)
share|improve this answer
The concluding remarks in the last paragraph are excellent. While I'm not quite to full applications in C++ I appreciate your argument about broadening the scope of what I am familiar with, even if it is just superficial. – Anticipation Aug 22 '12 at 5:35

Well of course it is.

No doubts about it, it is sometimes too early to learn a new programming language.

The simplest case is if an el-stinko language comes out and before anyone points out its unsuitability, by learning it you damage your brain. A couple that come to mind include BASIC, FORTH, and APL.

For a more complicated case, one of the great computer scientists has described this problem which very briefly stated is that practice makes permanent, and there are many disciplines that should be learned before learning computer languages so that the language does not distort the more fundamental understanding. In his words:

The tools we use have a profound and devious influence on our thinking habits, and therefore on our thinking abilities.

The opponent of just diving into to programming is named Edsger Dijkstra and he had a very distinguished career. He was awarded the ACM Turing Award with the following citation:

For fundamental contributions to programming as a high, intellectual challenge; for eloquent insistence and practical demonstration that programs should be composed correctly, not just debugged into correctness; for illuminating perception of problems at the foundations of program design.

The paper where he blasts premature learning of programming languages is:

"On the Cruelty of Really Teaching Computer Science"

Also, please don't flame me, I am just the messenger.

share|improve this answer
"I started with BASIC and have been scarred for life" - doesn't that kind of disprove your point? If you had been introduced to other programming languages early on, BASIC wouldn't have made such a strong impact? – tdammers Aug 22 '12 at 18:15
I guess I needed an emoticon. If it helps, I have deleted that sentence. – DeveloperDon Aug 22 '12 at 22:23

Is it ever too early to learn a new language?

I would say yes. If you're still wrapping your head around the very concept that the computer might actually do what you tell it, then learning a second language will probably just confuse you.

But if you are past the point where you realize that the computer does exactly what you tell it to, no matter how stupid it is, then chances are that you have a reasonable enough grasp of your first language that looking at a second (and third!) language doesn't break your focus.

share|improve this answer

Can't you do both?? I would do a project in C++ and learn bits of Python (just because it is so awesome), you could solve problems at using Python

In general, I think its a bad idea to learn a language, leave it and start learning a new one. One should be flexible working with different paradigms at the early stages. But that is just what I think.

share|improve this answer looks awesome! Thanks for the recommendation. – Anticipation Aug 22 '12 at 5:30

To a practicing programmer I would unreservedly say learning a new language is almost never a bad idea. To a university student, I would urge a little caution, depending on what classes are coming up. The reason is, in a school exam you frequently have to recite language details without the benefit of a compile/execute environment that will easily point out your mistakes.

Especially when you only have a few month's experience, it's very easy to mix up the details in your mind. If you care about your grades and are taking a class with exams like that, I would be careful. In the real world, that's not a concern.

edit: I originally said syntax, but non-syntactic details are just as important to professors, and there are a lot more of those.

share|improve this answer
If as a student you cannot remember the differences between syntax between languages you have a problem. You won't always have a compiler to check your syntax, there are some very real situations in this field, where you need be able to recall the syntax on the spot. – Ramhound Aug 22 '12 at 12:54
I'm not saying it's impossible to remember, just that it makes it a lot harder for a beginner. Large syntactic differences are fairly easy, but professors can be annoyingly picky about details like append() vs. push_back() for a list, which is something even experienced programmers have to look up if they haven't used a certain feature in a certain language in a while. Being able to recall syntax on the spot undoubtedly helps, but for the vast majority of jobs it is never required. – Karl Bielefeldt Aug 22 '12 at 15:24

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