I've heard that, but then I learnt Pascal and it did not help my English, I even learnt Java and C and C++, some python and now I speak almost proper English, but French eludes me, I have started with some Haskell, Erlang and Clojure... I might not have spent enough time with them, because I am not yet fluent! Darn it! Oh, excuse my French
–
David Rodríguez - dribeasSep 15 '11 at 17:43

8

True if you stay within the same type of language. Shifting language type means you need to learn again. And then you need to learn all the standard libraries all over again.
–
Loki AstariSep 15 '11 at 18:00

21 Answers
21

All programming language are concrete implementation of some of the abstract ideas in computing. As you learn a language, you start appreciating the abstract ideas better. This usually makes it easy for you to also appreciate the concrete implementation of those ideas in other languages. This makes it easy to grasp and learn newer languages. The better grasp of abstract principles, the easier it is to grasp it's concrete implementation.

Now this is a statement that doesn't get into overgeneralization and doesn't give false promises. +1 for your careful wording, sir.
–
delnanSep 15 '11 at 17:46

18

It's good, but not quite there. For example, Lisp is a realization of lambda calculus. C++ is not. Learning C++ and learning Lisp are two very different beasts. If you understand C++ and object-oriented design principles, you can probably learn Python (in an OO-style), Java, and C# fairly easily. However, learning a language like Lisp will be a mind-bender.
–
Thomas Owens♦Sep 15 '11 at 17:58

13

@Thomas Owens: Yes Sir! I agree. Not all languages implement the same set of abstract ideas and principle. Hence the leap can not be made easily from one language to another entirely on this reason. A subset of ideas remains the same. What use would it be for learning new language if one did not come across new ideas / thoughts!
–
pyfuncSep 15 '11 at 18:03

The basic concepts are going to be the same, regardless of language so long as it belongs to the same paradigm. Things like looping, branching, data types and such for procedural and object oriented, for example.

Some languages have very similar syntax - such as the C type family of languages which includes C++, Java, C# and javascript to name a few. With these, if you know one, you can easily read another (the basic constructs, at least).

From there on it is normally a matter of syntax, but mastering a language requires time and diving into details - lots of things are very subtly different.

What will not be easy is to learn a programming language from a different paradigm - procedural, object oriented, functional and imperative are all very different paradigms and understanding each takes a long time. This is mostly due to the very different kind of thinking you need in order to be effective in each paradigm.

Basic concepts from assembly are the same as those from Haskell? :)
–
Bart KiersSep 15 '11 at 17:42

5

No, not really. I'm not sure about Haskell, but in other functional languages like Scheme and Standard ML, you don't generally use for loops or if/else statements, but rely more on recursion and pattern matching.
–
Thomas Owens♦Sep 15 '11 at 17:44

1

@Thomas: in Haskell you rely even more on recursion and pattern maching than in Scheme and ML, as it's a pure functional language.
–
leftaroundaboutSep 15 '11 at 18:50

2

I agree that switching paradigm is not that "easy". Moving from Pascal and C to C++ took me a while because I was not used to OOP thinking.
–
GiorgioSep 15 '11 at 19:08

It depends on the language and paradigm. The core concepts of a paradigm (procedural, object-oriented, functional, logic) are usually consistent across languages. They might provide different features or have different syntax, but understanding how to think and design in a given paradigm will help you significantly when learning other languages within that paradigm.

However, when you cross paradigms, that's where it becomes more of a struggle. Thinking functionally is very different than thinking procedurally which is very different than thinking with aspects. This is especially true if you have been working on one paradigm and try to approach problems with the same mindset.

To be more specific, after learning one language, you mostly know that language. Learning the second language is almost more difficult for many people, because the first language has set fairly specific expectations. Looking around shows lots of evidence of this sort of situation -- just for one example, lots of attempts at implementing BASIC-style strings in virtually every other language around (this seems to finally be diminishing to a degree -- but I think it's primarily because BASIC has become less popular, so there's a greater variety among the first languages people learn).

Learning the new syntax of the second language is often fairly quick and easy -- but that's often (usually?) followed by a rather protracted period of attempting to use the second language as basically a variant of the first language, with little changed except the syntax. It frequently takes quite a while to really accept that second language as itself instead of a variant of the first.

After you've managed to do that, it starts to become substantially easier to learn new languages. I suspect most of us still tend to think in terms of previous languages for a while when first learning a new one, but I think most people are at least a lot more likely to be aware of that tendency, so they're actively attempting to learn the new language on its own terms; in the case of the second language there's frequently a tendency toward actively resisting it, and thinking of virtually every difference as obviously wrong.

Looking at it from a slightly different angle, for many people it initially seems like learning the second language is easier -- but getting to the point of using that language well often takes a lot more time and effort than they realize or admit (even to themselves). Most of us have to go through that process a few times before we can get past the individual trees and see the forest. I should also add that from what I've seen, this is also a point at which more people are likely to get stuck and never really accept that second language on its own terms -- many people seem to need to "learn" a half dozen or more languages before they can really "let go" of the first, and really start to accept other languages. Others never seem to achieve this at all.

It's a very tricky subject. In a lot of ways, once you know one language, other similar languages become easier to learn. Especially understanding program design, algorithm use, and other higher level topics in one language. It's the programming fundamentals and just doing programming that make it easier to learn another language, not that you've specifically learned one language.

However on the flip side, sometimes it can make it harder, unless you agree to forget all the fine details. Example: If you already know C, then you learn C++ you may continue using C-idiomatic runtime functions like printf instead of learning the C++ iostreams. Another example: You know Java and try to learn C++. Java does nearly all object creation by pointer/reference with new but this is very unneeded in C++ where locals and RAII should be used.

Acquiring a minimum proficiency in a new language becomes easier the more languages you already know. Becoming an expert programmer in a new language becomes easier the more languages you are already an expert in, but it's still a lot of work and it's tempting to think that you don't need to do it.

My first language was Basic and my second was Fortran (yes, really). Fortran felt like it came much easier than Basic, but I wasn't a very good programmer in either language. My third language was Scheme, which was quite dissimilar in some ways but I still had a leg up on others who were learning Scheme as their first language.

However, then I got into C++ and then Java and spent years exclusively there and got pretty deep. When I tried to do JavaScript, the simplest stuff was quite easy, but I wasn't a very good JavaScript programmer. I tried to follow some YUI source code to understand it and realized how little I knew. It only took a couple of Douglas Crockford videos to get an "aha" and get to be a pretty good JavaScript programmer (though still not expert), so in that sense it was easier to learn than earlier languages. But it took me years to bother to look deeper because through my C++/Java lens, JavaScript just looked like a very limited language that you had to use because that's what ran in the browser. I thought I already knew JavaScript, but I didn't.

My first language was PHP 4, and that was very, very bad for the development of my programming skills.

PHP has classes (since PHP 4), and you can write good PHP, but it is often used as a lazy language to do some old-school procedural programming, and it's endowed with duck typing, the all-in-dangeron error resume next philosophy, and some other stuff which is harmful for the unexperienced programmer, who needs a structured language to start with.

Languages like PHP, Python and Ruby are very useful when you need to develop something fast and easy. You can setup, for example, a simple web control panel within some hours.
But these tools, which are powerful, are often in the wrong hands, like mine, when I started writing rubbish with PHP.

I strongly recommend you to start with a statically typed language (C#, Java or C++), you'll save years of hassle and you will learn the basics of the modern approach to software programming. Then, you can use dynamic typed languages to make stuff fast.

It's obviously always easier once you get the hang of one language. But I wouldn't really go as far as calling it really easy.

There are various types of languages.
I know C#, Java, C/C++, Python, Ruby, Perl, PHP, Javascript, Bash, MSIL/CIL and some other funny languages like Expect.

I'm still apprehensive about giving Factor or even Haskell a try. I think I'll still feel quite incompetent for at least a month of working with them.

See, it's not really that syntax that is the problem. It's usually the different philosophy that sprang the language that's most difficult to get used to. After that, there's the standard library, which always feels like playing with another kid's toys.

You know you know a language quite well enough when you feel at home with it. That is, you can appreciate its advantages and disadvantages objectively in relation to other languages that you already know well.

It helps to understand what it is that you will be learning as you learn a language. Other then the syntax. I have tried to indicate how long it take to learn the different concepts. As that will give you the best idea of what part of learning a new language are easy and difficult.

Easy

I break it up into the main problem solving tools, the literal build blocks of programming. At its lowest level you will always find these three things are what is used to solve problems. Sequence, selection, and repetition. These are probably the easiest parts of a language to learn and carry across languages quite easily. These concepts can be taught in a few hours or days. They are least likely to change between versions.

Sequence is about the order in which you do things. Like opening the box before trying to empty it. First concept you learn, not always apparent, because it can seam so obvious. Your BODMAS rules you learn in maths applies here. Brackets of Division, multiplication, addition subtraction. Which lay out the order of precedence in evaluating mathematical expressions.

1+(3-2) + (4 * (3 + 3)) - 4 / 2

Selection is about making decisions. If the box is full then empty it. If the box is empty the move it to one side. In programming an example of these is the "if" statement.

if (box == full) then:
empty box;

Repetition is exactly that. With the 20 boxes empty them and place them to one side. These are your loop structures. Like

For 1 to 20 do,

or

While x < 20 :
x = x + 1.

Intermediate

Out side of that you start to look at different ways to abstract your code. Abstraction, is just the techniques people developed to mange code and make it reusable. Object orientation being one of the most prominent forms of abstraction. The concept can be explained quite quickly, but it takes some times a little longer to really grasp and understand. It will take quite a bit of practice to get good at understanding of how to structure lager programs. This will probably take a few weeks to really make sense. There may be small change between version and maybe new additions and best practices to follow. This is also where a lot of languages can differ quite a lot in how they do things.

Advanced

Lastly the most difficult, or rather time consuming part of learning a language is learning the API. This takes months or years. It is also the part of a language most likely to change between versions. The best programmers don't reinvent the wheel, they use the code already created buy other programmers. The use the API. Each API, is unique to its language, and some languages have different APIs for different operating systems. This is where the programming languages vary the most. Yes they all have a way to connect to a database, but the way they do it can be very different between languages.

It is also the part of learning a language that can be quite difficult to learn for people who have never programmed before. Lots of technical jargon and technological concepts some times need to be learnt at the same time to be able to use an API. For instance if you want to connect to a server, you would have to learn what all the different error codes that a server can out put. For instance connecting to a database server you might get a database not found error. You would need to understand why you got that error and how to fix it.

Final Thoughts

I have learnt, java, pascal, object pascal, visual basic, some c and cpp, php, bash, javascript, and recently python. I have also taught visual basic. I would also recommend python as a starting language because you can get started right away. It is very talkative and will tell you when you have done some thing wrong. In a nice way that you can fix it. It is very simple to start working with, especially using the interactive command line. There is very little extra stuff you have to learn before you get started in python compared to learning some thing like javascript (html, dom, web servers)or cpp (file structure, main, compilation). In python you can learn the basics of the sequence, selection, repetition with out try to understand obscure error messages (cpp).

The other thing that might be useful here, is to lower your expectations. You are not going to write the next hit iPhone app in your first week. You probably won't even write a gui application for a few months. I am not say you can't or shouldn't try. But don't get disappointed if it takes you a while to get where you had imagined programming would get you. Python has some really good free resources on the internet that you can get going right away.

I know a lot of people are going to give me a hard time about this. The other good language to learn for first timers is visual basic. It is easy to get access to as most people have office installed on their comptuers, and you can use it immediately in excel. You can have a very useful code in a mater of hours with out having to worry about lots of details. All you have to do is look at the code the macros produce and read the help to learn how to program in excel. I would still recommend python over visual basic as you can use python in open office.

Other wise if you really want to understand how complex, and versatile, and useful programming can be learn C. There is a reason most of the core components of an operating system are written in C. It is because you can really do any thing you like with it. You will take a long time to master it. Especially when it comes to using the 1000s of API that people have written. Also has lots of good free resources to help you learn on the internet.

The point of say learn C, is that you can't really know how easy or difficult some thing is until you try. I measure difficulty with time, as you have seen me use though out this post. Nothing is impossible it just takes time.

Learning syntax and basic structures such as loops will probably become easier the more you learn them. However, if you learn poor programming practices while trying to pick up a language, then even though you might be able to write something in another language faster, the code written in the new language will likely suffer from the same problems, even if the syntax is correct.

Syntax for new languages can always be looked up in reference manuals or guides; what's more important is that your core understanding of the fundamentals is correct.

(Imperative) languages (like Python, C and C++) share some common ideas and principles. So when you learned them in one language, you will recognize them in other languages as well, despite differences in syntax. However, languages are different because of different concepts. It is easier to express some ideas in one language than the others. Also you have to be aware of differences in meaning behind seemingly similar syntaxes/idioms.

So it is easier to learn the second, third, ... language, but not easy. But to become a programmer you have to start with a first one.

You have not clarified your objectives for learning programming, so this answer is general.

In programming details mater, so each language has its learning curve.
It is true though that there are basic concepts that are more or less the same in nature such as decions, loops, variables, ...etc. The syntax for those may differ but the general concept remains the same.

Learning a language at basic depth given that you have some software development knowledge is not usually a problem. Learning a language to be proficient in and do professional work is difficult because of many factors:

1-No one good book, you need to search and try

2-OO concepts are usually not the same across languages and are hard to master because of (1)

3-Database access can be done in variety of ways and may require learning frameworks other than just the language (e.g. ORMs, and SQL)

I guess that learning professional programming for a person with average IQ is not trivial.

I am probably going against the grain here for me the answer is a qualified NO.

To be more precise its harder to learn a bad language after you have learned a good one!

There are various ways to define "bad language" and perhaps the term is too strong but I am basing this on my own recent experience of a small project where (because it was the only API exposed by the underlying software) we needed to write a reasonably complex parser and loader in Visual Basic -- which I had up till this point managed avoid except for a few spreadsheet macros.

I have done similar projects for other meta data tools and implemented them reasonably quickly in Java,Groovy and Lua.

It took twice as long in VB, it took twice as long to debug and the end result was only just sufficient and horribly slow.

The "pure"ish OO languages have consistent syntax, useful libraries with consistent naming standards so you send most of your time thinking about the problem at hand rather than struggling with trivial tasks like string manipulation.

I can quite happily code up Java just using a text editor like vim, although, eclipse is useful for dealing with the more complex libraries. VB absolutely requires Visual Studio to do any coding at all.

I mean no disrespect to those who spend their lives coding VB and know all the tricks and hidden features, but, it is a ridiculously inconsistent and bizarre language.

Absolutely. Especially if technical or analytical thinking does not come naturally to you. I would say that learning a programming language is very similar for most languages. And, some languages are very similar, such as C# and Java.

In addition, many of the processes are the same for all languages: break the problem down into pieces, find best practices and common patterns, etc.

Once you train your brain to use one language, others are much easier to understand. And, you become much better at the process of learning as well. You learn how to find and leverage resources (like Stack Overflow and Google).

For someone well versed in programming concepts, learning to write code in any langauage should be reasonably easy.

Fundamentally, learning to program is about turning real world processes into logical statements. Translating logical statements into a specific language is comparatively easy.

When you learn your first language, you're also learning how to program. Hopefully by the time you learn your second language you already know how to program, so you should have a much easier time. With each language you learn, you understand a bit more about programming in general, so things only get easier.

All that said, most languages are associated with frameworks, which consist of libraries and other tools a programmer can use to be more efficient at their job. As a c# (.NET) programmer, I am quite profficient in writing code in Java (this is no big claim - the languages are almost identical), but since I have little practice with the Java libraries I'm going to be a lot more productive working in c# than Java. I'm also proficient with VB.NET, but since my fingers have had more practice punching out c# code (and because there's actually less typing involved), I'm more productive with c#.

I think once you know two or three languages, learning other languages is easier. I think the second language you learn may be just about as hard as the first, though that really depends on the language.

Once you are fully proficient in a couple of different languages, knowing another is pretty easy. I know C, Java, FORTRAN, Tcl and Python very well. Last week I needed to do some C# programming and I just started coding. Learning the language was a no-op, the only hard part is knowing what functions live in what libraries.

When dealing with certain languages, for example C++, you'll come to deal with just about everything that you'll encounter, in whole or in part, most other modern languages commonly used in the business world.

However that's not the case if you start with a language like Python, where you don't have to deal with a compiler, static typing, memory manipulation etc.

IMO anyone who wants to become a programmer in the modern business world should spend some time acquiring a reasonable level of proficiency in C++, regardless of what else they're involved with. It's a rite of passage of sorts - not unlike calculus or statistics for an engineering education - it gives you a context for everything else you'll do.

Base level common denominator for most programming languages is.... our pals... our friends... good ol' conditional statements.... .... the IF's OR's and ElSE's. You can most certainly learn this principles in the Python world. You would be suprised how many scenarios and programming equations are solved by a combination of these simple principles.

Complementing ..
.. what about if you get in a project that uses OO? and you came from a background of procedural programming? It will be so hard to learn new concepts (not impossible), but sure it will take some time to get in the new concepts.
For example, my first language was C (compiled), after that, I have learned Java (Compiled), JSP(Interpreted after the compilation), PHP (Interpreted), Perl and so on.. there are so many differences between languages.. but logic is always logic, whatever language you are applying. Know the logic and learn a language to apply that logic.