Which language to learn?

I would appreciate advice from any experienced programmers on the best language to learn.
I am not a complete newcomer - I've done small amounts with Pascal/VB/Bat files.

I am finding myself really enjoying the creation of a program to achieve an end having just recently written a number of simple bat files feel I could really enjoy programming as a career.

What would be a good language to learn for it's marketability and versatility?
The main ones that spring to mind are obviously C++ and Java.
Any advice/suggestions would be well received.
Thanks :D
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

C++ is NOT for beginners. I'd start by learning C# and the Dot Net technology, which in my opinion will eventually suceed over the rest.
   I mostly have worked on C,C++ VC++, C# and VB (and a lil bit of java).

 I believe the learning curve for c++ is a bit steep, especially to understand the object oriented concept to apply it well.

  I would suggest you to start with C# .Net. because the learning curve is not that steep. It has almost the same constructs as in c++. Plus the advantage is that you can directly start to code Windows based application, but if you go with c++ first, you will have to learn vc++(MFC) to code windows apps. It is very much suitable for Rapid Application developement. The good this is that it will make leaning c++ much more eazier.

  VB, As I would say is the eaziest of all. In case you already know it you can do VB in VB.Net.

 I would personally stick up with C++, because I belive it is the most powerfull of all. but for a beginer, it takes time.



Offcourse Java. You dont need anything extra to learn java and do a complex program. You just need to know programming and rest everything you can get it from IDE (Integrated Development Environment) like Eclipse or Netbeans.
Java is easy to learn and slowly you can advance in it by applying OOPS concepts, Design patterns and frameworks. You can do anything with Java.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

One more important thing,

 Its not the language that is important, its the logic you use.
You can use c#, VB, c++, java to do your work, But in the end, if your logic is'nt good, any of these languages wont help you.

I assume you are talking about learning programming in the context of wanting to start working as a programmer. The market is pretty well split today between JAVA and .NET (C#). Language-wise (syntactically etc), they are very similar so either one is fine, really. There is much, much more to programming than language though. To create software you should build yourself a firm understanding of concepts such as object oriented design, using design patterns, architecture and just plain general software design. These issues transcend language to a large extent, but it's often easier to pick a language and study proper design practices in parallell and within the context of that language.

Beyond this, to be competitive in the marketplace, you should try to learn about some specific technologies or platforms as just learning to write code is like living in a bubble. If you don't understand what's outside the bubble, it's hard to be useful. This could be things like
* Understanding SOA (Service Oriented Architecture)
* Enterprise web
* Data integration
* Database design and abstraction (like knowing how to use the hibernate technology in JAVA)

The list can go on forever, the point is to pick some things and learn them.
As an instructor in a university,

Please start learning C first and combine it with data structures and algorithms sfuff...
Then, after mastering it, learn C++ and this will help you to get acquainted with Java faster...After Java i recommend learning .NET which has the similar base with Java combined with cool features of C and C++...

Best regards...
>>As an instructor in a university

I couldn't disagree with you more. C is a bloodly awful language and should never have ever been invented. C++ carried all the worst practices of C forward and added a few more, eg: constructor code in .h files.

Java when it came out was a real boon. You can still learn about algorithms and coding with Java, even Delphi or Pascal, but please not with C.

Now C# having gained from the experience of Java and the capabilities of the Delphi compiler guru, has almost no bad features, except for perhaps the double equals for equality testing carried over from C (and Java for that matter).

So if you reverse your list, I'd be greatfull!
> I couldn't disagree with you more. C is a bloodly awful language and should never have ever been invented. C++ carried all the worst practices of C forward and added a few more, eg: constructor code in .h files.
> Java when it came out was a real boon. You can still learn about algorithms and coding with Java, even Delphi or Pascal, but please not with C.

of course C is awful. But he wants to *learn*. C is still the main language for many applications (like unix), and is pretty simple language, it has all the basics and makes you understand how the computer actually works. I don't expect someone that never knew what is a pointer to really get what is a reference, though it is one of the main concepts of Java-like languages.

I think someone should give a good english language book reference about Algorithmy and Object Oriented Algorithmy. While learning (or reviewing the basics, as he said he already learned programming) you should read also the Kernighan and Ritchie, "The C Language". Only the first two chapter are to be read and understood at least once in a programmer's life.

Then you should start learning C++. There are good courses and tutorials on internet that can be found easily, and in the same time you should read "The C++ Language" by Stroustrup. This book is not an introduction. Given you know fundamentals of OOP and Algorithmics, it will teach you all the features C++ uses. And then, switching from C++ to another OO languages is just a matter of trading one feature for another. Learning Java, Python, Ruby, C# etc.. gets easy.

Once you're getting familiar with OO concepts, I advice you to learn design patterns, "Head First, Design Patterns" from O'Reilly is really a good one.

And always remember that you have to actually *code* to really learn... The best teacher is the compiler ;)
So, of course, the path I just gave you is not the easy way, but once you've got through that, I can tell you, you're glad you did it. And then another path comes to you : functional programming ;).
The easy way is to start learning Java while reading an Algorithmics Introduction book.

It depends on how much time you want to spend learning, and how fast you want to be able to master programming. ie The easy way will get you faster into doing "real" code, but it will take you longer time to master it...
I'm with BigRat on this 100%. Saying you should start by learning C or somesuch is like saying you should learn to ride a horse before learning to drive a car. Many of the best software developers I know never even touched C++, let alone C or any other "legacy" languages. Sure, it might give you some perceived "geek cred" to know C, BASIC and COBOL and whatnot, but it's hardly useful and it won't make you a better software developer. Leave the outdated dinosaurs where they belongs - in the past.

And before you ask, yes, I know C. I started out by learning BASIC and C and it's benefitting me not one bit today.
zmo: Wouldn't you PREFER to learn O-O techniques with Java or with C++? And if you're going to quote Kerrnigan and Richtie you OUGHT to quote the Java series which came out in the 1990s with Addison Wesely - they were simply super. But my point is that C# is a Java successor and you might as well start with that if you are a beginner and have your own PC.

Although I was part of a group which wrote a C compiler for a mini-computer firm in the 80's, my first real encounter with C was with Charlie Petzold's Windows in 1990. And that coming from a Pascal, Algol 68 background was a real blow - it was like diving off into Assember once again. Great fun for spending dark evenings looking for obscure bugs - but to learn from it!!!!!! In those days I used to see in Dr.Dobbs journal advertisements for a commercial program like Lint which would find obscure bugs. They used to have a teaser - what's wrong with this code, they'd ask. The anwser came next month of course or when you bought their product. The real reason why the code was wrong was that C is a crappy language. And, to think of it, they (at Bell labs) had THREE goes (with the A and B languages) to get it right!
Well, then if we're not careful it will end in flamewar :)

I really think that doing it the "hard way" is a good thing, as I said. I've worked with so many developers who learned programming through high level languages and could not get how references work and what's the difference between the referenced types and primitive types in Java (which is one of the worst things of that language)...

And C++/C are not "legacy" languages. Unix systems, like OSX and Linux are based on C code, Windows still relies on C++ code. If you do scientific work, you'll have to deal with them. If you want to have really optimized code, you can't go without them.

To build a solid wall, you need to have solid foundations, and I don't think learning programming through high level languages will reallly help having solid foundations, at one time or another you'll always have to learn how a computer works. Yes, it has registers, it has a function pointer, it has memory blocks and addresses, even if you want to ignore it...
Just a small comment,

     I am not saying that you should start with C to lean C++ and then forward.
     But, I thought you will get a wrong impression on C and C++ after reading some of the comments.

   Java is a powerfull language, Agree, but nowhere near powerfull as C. Who uses java in embeded platform. If C was'nt invented, would somebody ever write low level system code in Java( First of all is that possible). Does C or C++ require a third party tool to execute? (As java code is just a file in the computer if the JVM is not present).

   Only advantage I see from java is cross platform compatibility. Rest everything is there in every other programming language.
   Also, Java offers pre written code, So lazy people can use them. But remember, You will never want to understand the logic behind those once you use them.

Thats all
> And, to think of it, they (at Bell labs) had THREE goes (with the A and B languages) to get it right!

you forgot about BCPL :)

so yes, the flamewar is on ! :P

> But my point is that C# is a Java successor and you might as well start with that if you are a beginner and have your own PC.

my point is that C# is NOT a java successor. It's just another OO language.
What makes it better than Python, Ruby or Objective C ? Is C# truly portable ? etc...

Your seeing the world as "windows-centric" but it's not, and if you've worked on mini-computer, you should know... I'm not as old as you are, and I'm glad to have learned C and C++, though I'm not using them on everyday basis. They were just useful to open my mind to new concepts.

And I can tell same things about Ocaml than I did with C++...
"on my right on the ring prakash and zmo, on my left BigRat and pellet, let's fight !"

zmo: No, a flame war is where people stick to things emotionally. My first computer language was a high-level language - it was Atlas Autocode an Algol like language - and then I learnt Assembler. I do agree that one needs to learn the nitty-gritty in order to have a firm foundation. But there is no need to learn the hard way. To be fair a language like Delphi has it all going for it. You can write in O-O style and make Windows programs, you can make commandline programs which simply use read() and write(), and you can drop down into assembler. But it is not mainstream.

>>If you do scientific work, you'll have to deal with them.

I don't if this is still true - it's a good ten years on now - but the Los Alamos Labs had over five million lines of Fortran II to maintain, a language which died in the sixties.

Which brings me onto prakash2007's point. Software developement is not expensive, it is software maintainance and enhancement which is. In my experience the more ways of doing one thing the worse the maintainance costs get. The more reuse of software components or run-time systems the better, since it reduces the long term costs. The most powerful language is Assembler - but no one these days would think of writing an operating system in it, although it would be a) small and b) fast.

I once knew a chap who held his software modules in hexadecimal on punched tape. He'd stick little bits of tape together and bootstrap them into the machine to get a running program. He was the original cut and paste man.
>>Your seeing the world as "windows-centric" but it's not, and if you've worked on mini-computer, you should know...

Harris, Norsk Data, Digital, Perkin-Elmer, and so on, what happened to them? And why?

I'm afraid Windows owns the desk top. Our application, which server side runs on Windows and Linux, serves several thousands of work places at our customers. All but 5 work places run on PCs under Windows. Server side it's split 60/40 in favor of Linux, although the server side is a box which sits in a room and does nothing else but our app so most customers don't care since the never ever have anything to do with it.

C# is a Java successor since MS dropped Java out of their program. They did this after their bust up with Sun, who, amongst other things failed to understand how the product should behave under Windows. MS also hired the Delphi compiler expert to help form the language and the JIT.

My point is it hurts nobody to program the way MS programs and to use their tools. You can always decide for yorself later which direction you'd like to go. I myself still haven't decided an that after 40 years in the industry.
I am not trying to argue about the greatness of C or C++. Just commented because, No language is better than the other. Yes it all depends on What we are trying to create and the timeline.

Nobody sticks up with java, if you are told to write an OS or a driver. you go with C. One thing here "C allows inline assembly code"
Nobody writes a code in C if you told to create a Enterprise application, you would go with C# or java or VC++.
  The point here is that based on the need we have to shift our programming language.

 It does no harm in knowing C,C++,C# or java. Everything is the almost the same.

  But I would suggest, for a beginer, to experiment with c#, then move on to C++ or Java. Once you know c++, there is nothing to study on C(Except on how to strip the OOO concepts out of your mind).

>>But I would suggest, for a beginer, to experiment with c#,

So you agree then that STARTING with C is NOT a good idea? If so then is zmo also of this opinion?
Starting with C can sometimes Backfire (as I have seen this happen).
The reason being this. You try to learn C, you then find it hard, you get frustrated, then you loose interest in programming and you leave the Idea of becomming a programmer.

If it dint backfire, I assure you,  that you will worship C above all. :)
> I don't if this is still true - it's a good ten years on now - but the Los Alamos Labs had over five million lines of Fortran II to maintain, a language which died in the sixties.

but is still used by many scientists around the world because there is still nothing getting as comprehensive... You find also pretty comprehensive libs in C. And Matlab is also pretty much comprehensive... though it's an awful language. I'm working in a sound analysis and synthesis laboratory, and they use matlab to create the algorithms, and then C++ to implement them efficiently in hardwares...

Anyway, my position is that it is better to learn languages from the simplest paradigms to the most sophisticated ones. Lambda and Pi calculus existed for decades, but efficient implementation only came lately. OOP programming too, but only java, python, ruby or C# matter...

What I don't like about C# and .net is that it's too much windows centric. Programming is a matter of logic, and the language you use does not really matter, the most important thing, imho, is to abstract your thinking of the language you use. That's why I think C++ is handy for learning purposes, you can see good things, bad things, you can understand what makes a code hard to maintain, or easy to maintain. You have to learn by knowing the theory, and also having your own experience.

Being told "C++ is hard to maintain" is not enough, not knowing the language, you can't understand why it is so. And I don't think languages are good or bad, I think every language has its purpose. Like functional programming is good for doing the logic of an application, object oriented programming for creating libraries, imperative programming for doing efficient algorithms of the libraries... I try to never use one language to do everything, when it's possible, but use languages to do what they are best at.
Kindly, check this link. You'll find a comparison of different programming languages:
Comparison of programming languages - Wikipedia, the free encyclopedia
It shows Intended use, Paradigm(s), Standard, Type systems, Expressiveness, ..
Comparison of programming languages (basic instructions) - Wikipedia, the free encyclopedia
It show Variable declaration, Control flow, Standard I/O, ...
To have a practical idea about each language, take a look at this link:
TranswikiList of hello world programs - Wikibooks, collection of open-content textbooks
To learn about the programming languages evolution:
Timeline of programming languages - Wikipedia, the free encyclopedia
Finally, I agree with BigRat to C#.
And agree with prakash2007 to the importance of using the right logic.
And agree with jazzIIIlove to learn Data Structures and Algorithms.
I encourage you to start C# unless you are interested in Cross-platform application (Java).
Let me say this:

You CANNOT start some coding directly with an OOP language...You must first understand the behaviour of the primitives and forming structures before a formation of a class...Since the asker has some background, maybe he can skip/skim some parts like variable declaration, conditional statements, conditional loops but when it comes to pointer notation, that you cannot skip...This is the main issue in most of the reputable universities...Students cannot get the idea of pointer notation easily...The process of understanding this issue leads a good algorithm foundation that is the reason why the main algorithm formation is based on ANSI C and C...

When you get the idea, call/pass by value/reference stuff, things will be clear in a student mind related with memory allocation...You don't really deal with this stuff mostly in OOP, because the main aim is to produce rapid applications but if the learner doesn't know the memory allocation for the variables, how can you expect him/her to understand for example static data members in Java?? Of course not...

So the order imho:
                    C                            ->C++                      
                     ->Data Structures and Algorithms
                                                                ->Java                                      ->Advanced Java
                                                                                            >Advanced Algorithms
                                                                             ->C# .NET
html->css->JavaScripting              -> PHP    ->Python
Best regards...
>> I don't if this is still true - it's a good ten years on now - but the Los Alamos Labs had over five million >>lines of Fortran II to maintain, a language which died in the sixties.

Oh..really..then, next time in my thesis, before dealing with Fortran libraries in my Java application that calculates variance/variogram, krigging and simulation, i would ask you so that you can simply offer me a better language with that precision of FORTAN...

Best regards...
deathbybatfileAuthor Commented:
Well thanks for all the input guys. I'm aware there are many different languages and knowing which is best to start with is difficult for someone who doesn't know the limitations/abilities of each.

What is clear is that every language is accomplishing tasks - data manipulation/device communication etc. and that these languages use different syntax to acheive this. Is there a good undercut to this though? It seems that a good understanding of how the computer itself works on its basic level would be a good foundation for any language that you then cared to learn. I'm thinking this would be the best place to start and then from there with a more educated viewpoint to look at different languages and what I want to acheive and which one best suits me. Any books that you guys can recommend in this area? Am I perhaps going too deep or does my reasoning seem sound?
Indeed, you do not need to know how computer works to be a programmer. All what you need to know is that a computer is a programmable machine that does what exactly you instruct it to do. Later, when you move to more advanced topics in programming, you may need to learn more about computer architecture.
You can strat with this book. I like it very much:
Beginning Programming For Dummies, 4th EditionBook Information - For Dummies

I think this thread veared a bit off course but if you look at some of the earlier posts, you'll see a lot of people stressing that learning a language is just one part (and a fairly small one) of learning to be a programmer. If you're serious about getting into software developement, you need to learn and understand data structures, algorithms, (object oriented) software design and some "best practices" like design patterns. These are all concepts that are pretty much independant of which language you ulitmately decide to specialize in. At this moment, like has been mentioned, the predominantly used platforms are JAVA (JAVA, JSP etc) and and .NET (C#, VB.NET, ASP.NET) . However, you should keep in mind that learning the "language" involves as much understanding the underlying architecture and platform as learning just the pure syntax and standard libraries of the language. In the case of JAVA, for instance understanding what the Java Virtual Machine is, what an application-server (like WebSphere or jBoss) does, in the case of .NET, how the .NET runtime environment works, what IIS is all about etc.

Getting hands on programming quickly is a good way to get started and feel like you're making progress, but you should do this in parallell with studying all the other aspects.
deathbybatfile, my opinion is that you should make a synthesis of everything that has been said...

I think The C Language by Kernighan & Ritchie is a must read, because it's well explained, and only the firsts chapters really matters. It can make you a good idea of the low levels works so you'll know what the computer is doing when using references, or understand how a garbage collector works when you'll need to understand all that later on.

Then jazzIIIlove may have good book references for an introduction to algorithmics, and to object oriented algorithmics that are not necessarily tied to one language or another (Pascal-like syntax is often used to explain concepts in those books, as you know Delphi you'll be on known territory). Sadly, the only good books I know (have read) and usually advice to beginners have no English translation...

I really think beginning that way enables you to have a solid understanding of what you'll do later on with whatever language you'll learn, and you'll get the good usages and know what to avoid. Then there's a trillion references for learning C#, Java, C++, Python, Ruby etc... depending on what you want to do with the "programmable machine".

so to sum up :

- fundamentals:
1/ The C Language by Kernighan & Ritchie
2/ A book that is an Introduction to Algorithmics
3/ A book that is an Introduction to Object Oriented Algorithmics

- to dig in:
4/ Any book about the language you target (you may read online tutorials too)
e.g. 'Head First: Java', O'Reilly, may be as good as the one behind for learning java ;)
'The C++ Language', from Stroustrup, if you want to have a deep understanding of how a OO language works

- to think like an architect:
5/ Head First: Design Patterns, once you begin to make biggers applications (it is good to know Java as well when reading this one)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deathbybatfileAuthor Commented:
Thanks for all the input guys. Giving zmo the points as he summed it up well for me but thanks to all :D
deathbybatfileAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.