I'm sure you guys are tired of this question but after wading through hours of similar posts and questions I've really not made any progress to my specific concerns.

I was hoping you guys could shed some light on a couple of questions I have before I decide on a course of action.

BACKGROUND: I'm wanting to enroll in some type of program to learn a programming language/get a certificate/degree to work in the field. I've always been interested and bought a book on VB back in high school and dabbled. Now I want to get serious after a huge hiatus.

Question 1: I've read it's counter-productive to learn C first, then C++ or C# because you develop bad habits. In a lot of college courses I've looked at, learning C/C++ is mandatory to advance. Should I ever bother learning C? On a related note, I really don't understand the difference between C and C++, or C# for the matter other than it incorporates .NET (which, I understand, is a compilation of tools and libraries that make programming easier and faster).

Question 2: Where did you guys learn to program? Where do you recommend? Is it possible to land a job programming being self-taught? Is my best chance an ITT tech or a regular college? I was going to enroll in a JC and go from there but I can't decide what to do.

LAST question :) I heard C++ is being "ported" to .NET. True? And if so, is this going to make C++ a solid, in-demand language to learn?

This question came from our site for professional and enthusiast programmers.

6

If you have to choose one of those three, and you haven't done any programming before, C# is unequivocally the way to go.
– Anon.Feb 7 '11 at 22:31

6

I disagree. Starting with a low level language will greatly improve your knowledge of how things work. C# is far too abstracted to begin with if you're serious about learning how to program.
– RobFeb 7 '11 at 22:41

1

I'm self taught and got employed, but I think an education would be good anyhow. Learning all the theory by yourself is daunting sometimes. Also, more importantly for some people, it'll probably land you a bigger salary.
– SkurmedelFeb 7 '11 at 22:42

7

@Rob: Starting with a low level language means a whole lot of frustration to get even the simple things working. Far easier to get a grasp of high-level concepts first and then backfill.
– Anon.Feb 7 '11 at 23:03

2

I don't see any problem learning C, then C++, then C#. But you need to understand that you shouldn't program the C way in C++, that's bad, they're very different languages each with it's way of doing things and it's drawbacks. The same goes if you put C# in the mix. Different languages mean basically different ways of expressing yourself. =)
– TrinidadFeb 8 '11 at 1:26

11 Answers
11

It really depends on how you see your career progressing. If you think that you'd like to work on shrink-wrapped software like Office, or on low-level software like an operating system, then yes, by all means, learn C and C++ first. But if you're looking for a job writing Line-of-Business software, which is probably where most entry-level jobs are available, something like C# is much more valuable.

There are thousands of significant difference between C/C++ and C#. But there are three big ones so far you're concerned:

(1) C# comes with a clean, reasonably easy-to-use object model, in the form of the .NET runtime (and its various Silverlight/WP7 brethren); C and C++ are platform and framework independent. To take just one example, this means that they don't have any defined way of doing string handling, and consequently, programmers over the years have thought up roughly 1000 ways of doing it, none of which are really compatible with the others. In contrast, if you want a string in C#, you just use the built-in Microsoft "String" class, and you're done. Yes, it's about 1% more limiting, but about 100x more convenient.

(2) C# generally doesn't make you think through the details of memory management. If you create an object, you don't usually need to worry about deleting the object to free up the memory it's using. In contrast, you'll spend a good chunk of your time in C or C++ trying to make sure that you delete your objects at the right time and in the right order. And if you make the slightest mistake, you're gonna pay for those mistakes with a nasty runtime crash.

(3) The MS C# compiler gives you pretty good error messages. Typical C and C++ compilers give you really amazingly crappy error messages. When I screw up a line of code in C#, the compiler will almost always give me a single error that says, "This is the line of code that you screwed up." If I do something similar in C or C++, the compiler will quite frequently give me a thousand different errors, none of which actually point to the line of code that I screwed up. You can draw your own conclusions about which environment is more productive for the average programmer :-).

The net result is that although C# is slightly slower than C or C++, and isn't quite as good for certain tasks (for instance, video codecs), you'll be about 10x more productive in it than in C or C++ for nearly every business level application you can think of.

I don't know that there's any one single way to learn to program, except that all of them include lots of programming. Some of the worst programmers I know have Ph.D.'s in computer science, and some of the best never graduated from high school. There's simply no one single way to do it. As other folks have suggested, a reasonable way to start would be to buy a couple of books, find a pet project that you'd like to implement (a website would be a good start), and start hacking away. You'll make a thousand mistakes, but the only unforgivable one would be to architect your second website the same way you did you first. And move on from there.

As for other languages: Java is much like C#, and learning one after you've learned the other should be pretty quick. These days, you should also pick up at least one "dynamic" language, such as Python, JavaScript or Ruby. (A dynamic language is, roughly, to C# what C# is to C: very expressive, working at a much higher level of abstraction, making you think a lot less about implementation details, but also tending to be slower, and possibly encouraging more bad habits.) You'll probably end up making your living doing one form of web development or another, and all three of those are important languages in that field these days. You'll almost certainly have to learn JavaScript at some point, but it's almost entirely a front-end language: almost nobody uses it to write back-end stuff.

C and C++ are very different. Syntax is similar as it's also with C#, programming styles are not. Also I don't get why people complain so much about C compiler's error messages, I could understand what was going on most of the time using GCC...
– TrinidadFeb 8 '11 at 1:31

1

I should note that things have changed significantly since when I wrote the last paragraph above. With the coming of node.js, it's no longer true - at all - to say that "almost nobody uses JavaScript to write back-end stuff." In fact, it's a pretty good backend environment, especially if you replace JavaScript with a decent superset language like TypeScript.
– Ken SmithJul 20 '15 at 4:39

I wouldn't recommend any of your list as a first language. Start with Python, Ruby, and JavaScript -- yes, all of them at once. They are similar enough that skills will carry over from one to another, but different enough that you will learn valuable things about how programming languages in general work by studying the differences.

Once you have those down, you should proceed to C. C teaches you how your computer works at the lowest levels, which is valuable for programming in any language. (But trying to learn that on top of "what's a loop?" is too much at once, which is why you do this after you learn high-level programming.)

I would not bother trying to learn any of the other C-family languages until you needed them for a project. The problem with them is that they're gigantic and every project picks a different subset - so you can be great on a project where C++ means templates and the standard containers, but completely at sea on a different project where it means deeply nested inheritance hierarchies and COM.

I read his question as first and foremost wanting to get a job. He should therefore learn the most employable languages - C# / Java, or HTML/PHP.
– Kirk BroadhurstFeb 8 '11 at 0:29

I have structured my life so that I do not have to care which languages are the most employable.
– zwolFeb 8 '11 at 0:43

JavaScript crazyness is a bad choice IMO. And I like Python but I would recommend a strongly typed language, as it reduces run-time bugs.
– TrinidadFeb 8 '11 at 1:33

The "crazyness" is precisely why one should learn JavaScript. It prepares one for the even nastier crazyness that one may encounter when, for instance, one needs to learn Bourne shell. I would like to endorse your recommendation of a strongly typed language, but I have yet to find a strongly typed language with syntax that makes sense to my brain (which has been permanently warped by two decades of the Algol family).
– zwolFeb 8 '11 at 3:25

Pascal (or rather Delphi) might be what you're looking for, as it inherited much of ALGOL syntax. Also doesn't have as many problems with memory as C or C++.
– Alan PearceFeb 9 '11 at 11:21

First off, you need to know what it is that you want to do. Are you interested in software development on top of an operating system, or do you want to program hardware? If you are looking to program hardware, you will likely need to know pure C and assembly language. However, if you're looking to develop platform software, C++ is a fairly universal language. C# is also good in its own rite, but I would not recommend it as a starting point (although probably easier than C++, you will learn more fundamentals with C++ that C# tends to do in the background).

Also, remember that no language (whether it be C, C++, C#, Java, etc.) is easy to learn and since it is a skill, it must be developed over time. It will take time to get good with or without schooling.

Until entering college, I was entirely self-taught (approximately 7 years of programming experience with about 3 years professional experience). The amount of programming that I learn is very limited; you should not depend on any school (unless you go to a school for a specific "programming" major, but I am not sure about those programs) to teach you programming language. Perhaps they will help you with certain pragmatics, but as a developer, that is mainly up to you to learn (there are many great guides on the web and professors can point you in the right direction for help). That said, in Computer Science anyway, you can learn a lot about how systems operate, etc. which, when applied to your programming, can definitely improve the efficiency of your code.

With that in mind, it doesn't mean a nice little diploma won't help your chances getting that job you want over at Google (as I'm sure it will). However, aptitude in the industry is far more valuable to a company than purely being a "bookworm." You can learn all you want in school, but if all you can do is work out a homework programming problem with a set of conditions then you're in trouble when the real world hits you; you need to anticipate and find your own bugs/errors, etc.

Finally, I do not use the .NET framework often, so I cannot verify or deny this claim. However, C++ is a very solid and useful language to learn.

1) Yes it may be counter-productive to learn C and/or C++ first, because those are very complex languages with plenty of oddities in them. A better first language would be C# or Java, as those have cleaner, better syntax, yet reminding a lot of C++.

C can be described as a "bare" language, having the necessary functionality to create any form of program. C++ is more vast, with object-orientation features. C# / Java (those two are quite similar) are also object-orientated, more purely than C++, and they also lack much of the complexity of C++, making them more suitable for beginners. Eventually you must however learn how hardware and bits/bytes work, and also the binary and hexadecimal number systems.

And forgot you ever knew VB existed, it is an obsolete, horrible language that fills no purpose in modern programming.

2) Started on hobbyist level with Delphi and Pascal, then studied programming in school, before eventually getting a degree.

Last question: C++, like C, is a standardized language maintained by the ISO standard organization. Thus, no company owns the rights to it. Microsoft has a .NET version of C++, but C++ was already solid and in-demand long before that.

And .NET is, in a simple way of putting it, a framework designed by Microsoft that has lots of common solutions to everyday problems. It's not core in any language, you can have implementations of C# using mono, for example.

Question 2: I learned a bit at school, but the most of it by myself. You can't actually learn programming just by reading books, but they may help you getting started. What you will want to do is practice, a lot. And you can get jobs being self-taught, although a degree will probably help you to get a better job, especially if you don't have any work experience.

Last question: there is Managed C++, but I wouldn't bother in learning that, really. If you want to do .NET stuff stick with C#. But I don't think focusing on .NET is a very good choice on learning. Also, C++ knowledge is still highly demanded in some industries, like games.

Go ahead and learn C, but learn some basics about OOP and RAD software development techniques the same time, so that you don't mindlessly engrain certain "bad" habits.

Both C# and C++ can also lock a student into some non-transportable programming habits.

And knowing some close-to-the metal C can help you in several professional areas, where development for small battery powered or constrained devices is important (and this can sometimes command higher consulting rates than for generic desktop or web applications).

If you want to get work as a programmer or developer and you're choosing between C, C++ and C# then for me it's a no brainer. There are a lot more C# jobs out there, the money is often better (especially for entry level), and the competition is frankly lower probably because it's easier. Just go to your local job website and look at what's on offer and you'll quickly see what I mean.

C# is also easier to learn, given the efforts put in to Visual Studio. You can get Visual Studio Express for free as a student, and there are literally thousands of tutorials and downloadable projects / samples online. C# has more questions and answers than any other topic on StackOverflow.

I'm not saying C# is 'better' than C or C++, as they each have their own pros and cons, and I should also note that I am a C# developer.

How did I learn? Some professional study but mostly self-taught, until I was able to get into an entry level position. After that I devoured whatever knowledge I could from the smart people I worked with (as well as learning how not to do things from certain other people). If you interested, intelligent and passionate about it then you won't have any problems.

Question 1: I wouldn't bother learning C (This is my opinion so no flaming please). While there are still uses for it, C++ provides many improvements such as Object Oriented programming. Depending on what you want to create (games, web applications, etc) would dictate the language to learn. Trufully you will probably end up learning more than one as technology changes. While C++ will teach you about memory management it is much harder to grasp then C#. I would suggest learning C# by reading Head First C#. It will help you grasp a lot of the basics you need to move forward.

Question 2: You can definitely get a job being self taught but the problem is getting recognized. Knowing people in the field can help. Joining an open source project might help you meet people but I can't speak to this from experience. If you plan on getting formal schooling go for a regular college degree. I went to Lincoln Technical Institute and it was a waste of time.

If there's a particular language you want to learn, learn it. Learning another language that's similar in some ways, as a steppingstone, is usually a bad idea. You may pick up some concepts faster, but you'll have to unlearn more. Note that C and C++ are two distinct languages, and "C/C++" is usually shorthand for "I don't know much about C++ (and possibly also C)".

If you're going to be a programmer, I'd advise learning C sometime. It will give you a good feel as to what's going on at a more basic level. I'd advise learning a lot of different languages. However, you should probably get good at something else first.

Don't worry yet about not understanding the differences between C, C++, and C#. That understanding can wait until you learn more about programming. For now, C is something of a minimal language, C++ is very powerful, and C# is somewhat less powerful but cleaner.

For career prospects, a college degree is the way to go. Not having a bachelor's degree will be a hindrance in many places, sometimes disqualifying you from jobs. There are obviously exceptions, but on the whole it's a good investment. If what you mean by JC is what I mean by "community college" (a two-year college program), that's one place to start, but see about transferring to a four-year institution sometime.

C++ itself is not really compatible with .NET, but it's a very viable language with lots of jobs available anyway. There is something of a version of C++ that does work with .NET, but since it's neither real C++ nor something .NET-native like C#, I wouldn't deal with it except if I had a specific requirement (like a job that used C++/CLI).

Question 1:
I think it is worthwhile to learn C++ even if you are going to do mostly Microsoft application or web development, which these days will most likely be done in C#. It is a good foundational language for either C# or Java. Also, one day you will have to program against a C/C++ API even if you use a higher level language. So it is good to know what is going on over in that world.

Don't bother with C unless you plan to do low-level or hardware programming. However, DO read up on the differences between C and C++. For the most part C++ is C plus the ability to create classes. So if you can write C++ you can essentially write C programs.

C# is similar to C++, but the main difference is a more automated system of managing memory (a pain in C/C++). However, do understand that in exchange for easier development/debugging you will give up some control. In practical terms however, you don't often NEED the level of control that C++ gives you.

I don't subscribe the philosophy that learning language X can teach you bad habits and make it harder to learn language y. Many do, but I personally am suspicious of these claims, especially when they come from language snobs.

Question 2:
I learned to program via numerous sources (High School, College, Self-taught, Independent Courses, Peers, etc.) You will find that you will learn from a variety of places too. If your main concern is getting a job with no professional programming experience a 4-year university is your best bet. You can get a job without a traditional degree, but no degree + no experience will make that very difficult.

LAST question:
C++.NET already exists. It has for as long as .NET has been out. In my opinion it is kind of half-fish/half-fowl. I haven't seen a ton of demand for C++.NET developers out there, nor do I expect it to increase. As far as job prospects you are probably better off as a C# developer.

Sorry, but you can do web programming in C and C++. Would I recommend it? No. It's using the wrong tool for the job. Try cutting your hair with a chainsaw.
– MarlonFeb 21 '11 at 21:06

@Marlon I think You've not heard about Google Chrome Native Client! --- Native Client apps use Pepper, a set of interfaces that provide C and C++ bindings to the capabilities of HTML5. As a result, developers can now leverage their native code libraries and expertise to deliver portable, high performance web apps.
– Muaz KhanOct 29 '12 at 2:43