A recurring question on these boards is « how do I get started in programming? » Whether it’s choosing a programming language, finding tutorials or choosing an IDE, this FAQ is here to provide some guidance.

The FAQ assumes you want to start making desktop applications, with the most likely purpose of preparing for a Computer Science or Software Engineering degree. If you want to program websites, stop reading this and head over to w3schools.com. If you’re aiming for a particular domain (games, robotics, research etc), read this and then if any doubt remains please ask in the forums.

1) What programming language should I start with?

Short answer: Any widely used, general-purpose programming language can be a good choice. If that can be of any help, this author’s opinion is that you can’t go wrong with C#.

Long answer: What you’re looking for is a general-purpose programming language that:

Will teach you elements common to most languages (statements, expressions, loops, conditionals, functions, objects, operators etc)

Has a relatively clean syntax, logical design, and doesn’t lose you in low-level details

Is popular and useful

Has good IDE support so you can concentrate on learning how to program and not how to fight your way around crappy tools

Let's compare 4 of the most widely recommended languages:C:

Barebones, “close to the metal” language, goes hand-to-hand with a course on computer architecture

Ancient and eternal

Hard to do anything graphical or even text-based (GUIs, games): C is primarily designed as a systems programming language

Lacks such basic features as a string type, a container library, support for OOP, etc.

C++:

All the advantages of C plus support for objects and generics, and better standard library

Essential skill for any game programming position and in a wide array of domains

Complex at the outset: hard to learn, hard to master

Like C, it is mainly designed as a systems programming language

C#:

Logical, reasonably simple

Productive for GUIs, games, databases etc.

Shields you from the OS (the .NET framework act as an intermediary), a good thing in many ways except for learning how computers work

Not meant for writing device drivers or other such low-level code

Python:

Highly intuitive and elegant, geared towards beginners

Interactive prompt lets you learn by trial-and-error much faster

IDE support (debugging tools, etc) not great

Shields you from the OS and computer architecture (same as C# in that regard)

Other possible choices:

Java (similar to C#; if you're on Windows, C# is the better choice)

Ruby (similar to Python, but not as popular)

Objective-C (popular for Mac and essential for iPhone development)

Visual Basic (very similar to C#, but geared towards VB6 developers and beginners; many would say its peculiar syntax and legacy baggage make it an inferior choice)

Functional languages like Scheme, Haskell, F#, Lisp, etc. which are interesting from a CS perspective but not that widely used.

One good IDE (Integrated Development Environment). What is available depends on your platform:

WINDOWS:

For C, C++, C# and Visual Basic, look no further than the Express Editions of Visual Studio. They are free, stripped-down versions of the most widely used IDE in the industry. Check out the video tutorials there to get you started. If you are a student, you also might be eligible to a free, full version of Visual Studio through Dreamspark or MSDNAA.

For Java, both Eclipse and Netbeans are great choices. Be sure to check the great tutorials offered on both of these sites.

An alternative for C, C++, C# and VB development is MonoDevelop. Frankly, Visual Studio trumps it on Windows, but it's pretty much the only way to do serious .NET (C# and VB) development on Mac and Linux, where Visual Studio is not available.

MAC:

In addition to the cross-platform tools mentioned above:

For C, C++ and Objective-C, be sure to get Xcode. The recommended choice for developing iPhone applications as well.

LINUX:

In addition to the cross-platform tools mentioned in the Windows section:

For C and C++, the best IDE is probably Code::Blocks, but there are several alternatives.

Note that you don't necessarily need any particular IDE. Some people, especially Linux users (for some reason) prefer a "simpler" setup using just something like Programmer's Notepad (or even plain text editors like notepad. gedit etc) in combination with their favorite compiler (GCC, MSVC, etc).

You will still hear people recommending Dev-C++ around the net. To put it simply: don't use it.

Generally a good post, but I disagree with a lot of what you say and would argue against pinning it. A lot of it is opinion and highly subjective.

Some points:
I disagree that C/C++ is a bad first langage. I personally think that C# (and Java) is a terrible first language. If you're teaching basic programming of imperative languages (functions, conditionals, loops, etc), then C# is far too complex. You get caught up in syntax, memory management ('new' is too much) and program structure instead of focusing on the basics. In this case, Python is a much better choice. If your user is a future computer science or engineer student, then C# contains too much 'sugar' and hides too much of the basics. I've seen my fellow classmates that started with C# have nothing but problems in future courses like OSs, compilers, and computer architecture. In these cases, I view C# as setting the user up for failure. Of course, all of this is my opinion based on my experience. As I said, very subjective.

IDE support is not essential. I would argue that IDEs get in the way. For one thing, they're quite complex and having your user navigate something as large and feature rich as Eclipse or Visual Studio can be daunting. If you're starting with the basics, the best 'IDE' is really notepad with a run button and 'print' should be your debugging mechanism. Anything else is too much and distracts from the basics.

On languages, your description of the various languages is also something I disagree with. For one thing, your lumping of library features with languages is a bit deceiving. The two are orthogonal. Your observation that the C language provides nothing is the whole point of C. It was designed as essentially a high-level assembly, where there's a trivial mapping from every C construct to the equivalent machine code. C++ being a complex, bloated, inconsistent language is just an opinion, and one that I for one do not share (except the complex part, but I wouldn't phrase it like that). As someone who's primary coding language is C++, I don't find it unproductive, if anything, the opposite.

I could say a bunch of other things about some of your other points, but the jist of it is that the advice given is bad for a wide class of people and that what you're written is too opinionated.

1) "Productivity" is relative.Dr_Asik mentioned that C++ is highly unproductive, and to an extent I agree, but it depends highly on what you want to do. For graphical applications with buttons and images, you're best off going for a .NET language or similar since the IDE provides immensely extensive tools for GUI development. However if you're looking for low level development, then something like C#, Java or Python would be immensely unproductive since you can't (or in the case of .NET, struggle) to escape the runtime environment. C or C++ are built for the task of high speed, low level interaction. For a business programmer, or a high-level developer, high-level languages like C#, Java and Python are obviously more productive, but their vision of "productive" is different than from, say, a mainframe developer who needs to code as close to the metal as possible, and would prefer to program in C/C++ or even assembly!

2) Use the right tool for the right job.Similar to point 1. A good developer can write in a variety of different languages, and chooses the best language for a specific job. If you're knocking together an operating system, C is usually the best way to go, if you're developing a Windows application with a graphical interface, C# or VB are the way to go. If you're looking to do something very high level without too much work, then Python's extensive collection of modules can make life very simple. The worst mistake you can make when writing code is to try and use a language in a way it wasn't supposed to be used; it makes your life needlessly hard and usually produces crappy and inefficient results. You wouldn't use a power drill to hammer a nail, and you wouldn't use Python to write an operating system.

3) Don't jump in at the deep endA lot of beginner programmers, and I mean a LOT, will try to write a web browser or an anti-virus program for their first program, and to put it plainly: "it ain't gonna happen". Web browsers and antivirus packages take years to develop with team of highly trained developers, and trying to emulate their work in your first attempt will lead to fruitless results and endless frustration. Baby steps are what is required. Start off with a "Hello, World" application and go from there to write bigger and better programs as you get better.

4) Programming is Hard...Writing simple applications is easy, especially with the IDE support we get today. Software development suites like Microsoft's Visual Studio can save you hours and hours by writing a lot of code for you and letting you get on with what you want to do. However, writing GOOD code is hard. Efficient programming requires extensive design, and a lot of hard work. If you've jumped straight into a big project, don't expect your code to work well; you might surprise yourself, but it takes a long time to become a true code ninja. At the time of writing, I've been writing code for 6 years through 5 years of education and a year in work, and my code is still far from the best, but its getting better!

5) ... But its immensely satisfyingI said that programming is hard in point 5, but if you get it right, its one of the greatest non-sexual satisfactions you can get. The feeling you get the first time you compile your code and run it successfully is addictive, and what keeps programmers loving their jobs. Programming is something of an emotional roller coaster, there are times when you could just throw in the towel from frustration, but the feeling of success and pride you get when you solve a problem, and especially when you do a good job of it, can't be beat.

6) Tops down or bottoms up?The concepts used in programming can be learned in two different ways (in my opinion). The first, top-down, encourages you to start off with high level languages such as VB or C#, and to use the graphical designers and gently ease into writing code. Bottom-Up encourages you to start off at the base level using languages such as C++ (not so much C these days) and to learn the core concepts such as algorithm design and dynamic programming, and then building on this knowledge to build great software. The first approach provides you with results very quickly, although you're at risk of not understanding the underlying concepts and struggling with complex code. The other approach teaches you good programming practices, and teaches you good problem solving techniques, but puts you at risk of "burning out" since visible results come much more slowly.

The top-down approach to learning is generally taken by home-schooled programmers who just want to dive straight in since, like I said, it provides results very quickly. The bottom-up approach is usually schooled by university courses on software development, since it gives you a good education and sometimes a more transferable skill set.

Neither approach is invalid per say, but each approach has its advantages and disadvantages, and at the end of the day, its up to you to choose how you want to learn. Everyone learns differently, and in most cases a combination of both approaches works well for most people.

7) Get a text bookA lot of people contest this, but I stand by it that text books can be invaluable for programmers, particularly language specific ones. The best ones are great for teaching you the language you program in, and at the same time can be great tools for debugging your code, as well as great ways of propping up your monitor, as has happened to one of mine.

I have to largely go with MrA. The most important part is to learn underlying concepts.

Anyway, the main problem with your post is that it's not really about programming languages, it's about development environments (and it seems a bit Windows-centric at that.)

You say that C makes it difficult to do "something graphical," whereas C# makes it easy. What does that have to do with the language? That's a matter of libraries and IDEs. You appear to be actually be comparing C-based APIs like GDI and USER with .NET libraries like Windows Forms/Presentation Foundation and the Visual Studio GUI editor, rather than C and C#.

You then call C++ complex, which is debatable. C# 4.0 is also a very complex language. As for calling C++ bloated, I guess you might mean that you have to write more code, but then we're really back to the library issues rather than the programming language.

You say that C makes it difficult to do "something graphical," whereas C# makes it easy. What does that have to do with the language? That's a matter of libraries and IDEs. You appear to be actually be comparing C-based APIs like GDI and USER with .NET libraries like Windows Forms/Presentation Foundation and the Visual Studio GUI editor, rather than C and C#.

That's a very good point. Its unfair to compare C/C++ without a library to C# with the WinForms or XNA libraries since C++ can be extended with something like TCL/TK or Qt for fast GUI support and plenty of different game engines. I think its also necessary to distinguish that the "Drag-n-drop" features of .NET as part of the IDE, and not of the language.

I do think that discussion of languages is a good idea though since someone learning to program has a LOT of choices in regards to programming languages, as well as a choice to make in which version of a programming language to use (C# 1.0 is vastly different from C#4.0 feature wise), and it would help to have input from those who do use the various languages to provide information about what languages are good at, as well as what they are bad at.

Perhaps its worth avoiding the bias towards C#. I know its the OP's preferred language, and it is a good language in general; however, someone looking to get into programming needs a balanced view. Lets at least get a second disadvantage to C#.

Its still worth pinning as a replacement to the "Easy Programming Language" topic in my opinion, but it needs work first.

Thanks for the feedback. I agree with some and disagree with some, so I'll go through it in order:

I disagree that C/C++ is a bad first langage.

I didn't say that (in this post at least ). I said like most popular, general-purpose programming, it can make a good choice, although like every other it has both advantages and drawbacks.

I personally think that C# (and Java) is a terrible first language. If you're teaching basic programming of imperative languages (functions, conditionals, loops, etc), then C# is far too complex. You get caught up in syntax, memory management ('new' is too much) and program structure instead of focusing on the basics. In this case, Python is a much better choice.

At the same time, many will say early exposure to some memory concepts is vital, which is why many recommend C or C++ as first programming language. C# provides a decent middle ground: it makes the stack/heap concept explicit, but provides garbage collection. Again, syntax is complex, but it's a middle ground; sometimes it's Java-like (writing Hello World), sometimes almost Python-like (lambdas etc). But mainly I find your comment weird because I 100% agree that Python makes a FINE CHOICE; I say it explicitely and do praise it lavishly.

I get the sense that this post is interpreted as an apology of C#, because I start by saying it's my personal recommendation. It's not, really, I'm taking the most commonly recommended languages and comparing them based on a few criteria. I felt giving a "short answer" would be useful, even though it can never be much more than a personal opinion since several languages make fine choices. I think I did make it quite clear in my formulation that this was my personal opinion however, no?

If your user is a future computer science or engineer student, then C# contains too much 'sugar' and hides too much of the basics. I've seen my fellow classmates that started with C# have nothing but problems in future courses like OSs, compilers, and computer architecture. In these cases, I view C# as setting the user up for failure. Of course, all of this is my opinion based on my experience. As I said, very subjective.

I made that clear when I said C and C++ go hand-to-hand with a course on computer architecture, and that a drawback of C# is that it shields you from the OS.

IDE support is not essential. I would argue that IDEs get in the way. For one thing, they're quite complex and having your user navigate something as large and feature rich as Eclipse or Visual Studio can be daunting. If you're starting with the basics, the best 'IDE' is really notepad with a run button and 'print' should be your debugging mechanism. Anything else is too much and distracts from the basics.

The reason Visual Basic got so popular is not because it was a great language (it wasn't) but because the IDE let you do stuff quickly. With a good IDE, a beginner can quickly make a functional GUI-based application, and the debugger can be a vital learning tool as you get to see your program running line-by-line, inspecting the value of variables simply by hovering your cursor over them; it's very intuitive and I didn't see beginners struggling with that (I did see beginners struggling to find out what was going on when the only tool they had was print). It's also much simpler to set up, and there are tons of tutorials including quality videos on the net to help you out with the basics of the IDE. Finally I find it pointless to learn how to setup a "barebones" development environment when that's used neither in academic or professional contexts. Majestic makes a similar point:

Its unfair to compare C/C++ without a library to C# with the WinForms or XNA libraries since C++ can be extended with something like TCL/TK or Qt for fast GUI support and plenty of different game engines. I think its also necessary to distinguish that the "Drag-n-drop" features of .NET as part of the IDE, and not of the language.

It hardly matters from a beginners point of view. He wants to learn how to make applications, not how to learn the language-specific features of a certain language. To make applications, you need to learn a language, sure, but preferably one that has good IDE and libraries to help you get the job done.

And sure you can add librairies to C++, but the point is that you have to do it yourself, and with no understanding of programming concepts it's a tough call you'll be able to do that. I view the out-of-the-box integration as an important asset for a beginner.

Besides if you want discuss semantics, a language can hardly be considered separately from it's standard libraries/platform. What is Java without the Java librairies and Java platform? What is C++ without the STL and standard library? A language, sure, but one you can't do much with. hdood also makes a similar point:

Anyway, the main problem with your post is that it's not really about programming languages, it's about development environments (and it seems a bit Windows-centric at that.)

It's about both, and both matter from a beginner's perspective. A good, popular IDE will help him get started faster, get rewarding results faster, see his program in action, find appropriate tutorials on the net more easily. I do explain this reasoning in my post.

On languages, your description of the various languages is also something I disagree with. For one thing, your lumping of library features with languages is a bit deceiving. The two are orthogonal. Your observation that the C language provides nothing is the whole point of C.

I do make it a positive point that it is barebones. However I also point out that the lack of libraries make it hard to get any results done, which can be discouraging. I think this is a nuanced, correct point of view.

C++ being a complex, bloated, inconsistent language is just an opinion, and one that I for one do not share (except the complex part, but I wouldn't phrase it like that). As someone who's primary coding language is C++, I don't find it unproductive, if anything, the opposite.

C and C++ are among the few languages that a beginner can't use to make any sort of graphical application, because it involves a lot of code, installing and linking to external libraries, etc. Even making text-based applications is hard because processing user input is touchy, writing/reading text files is touchy, etc. Of course you learn your way around that stuff eventually, but in the meantime, in Python or C# you'd be done already and would be learning some other programming concepts. Hence it is unproductive, at least for beginners (and even for advanced programmers, but that is another discussion).

It is bloated because of the duplication of features between C and C++, including both language and library features. Also because it forces you to learn how header files work, concepts of very little use such as private/protected/virtual inheritance, difference between a reference and a pointer (as if pointers weren't hard enough) friends, various meanings of "static", and I could go on. All of these simply don't exist in most languages, so it's something to be aware of. Hence I point it as a drawback, which is correct. I am not advising against C++: I am saying it is a recommended choice, but be aware of that, it's not going to be a walk in the park.

Agreed. I was getting a bit tired at the end, but that needs much better phrasing.

You then call C++ complex, which is debatable. C# 4.0 is also a very complex language.

C# is very complex, but it allows you to do a lot without having to deal with much of that complexity, unlike C++. It's easy to learn, hard to master. C++ on the other hand is both hard to learn and hard to master. How many posts do we get here asking why some text input code using cin doesn't work? We don't get that for any other language. Even the most simple tasks are hard to do right in C++. Again, that's something to be aware of.

In general again I think this post is interpreted like an apology of C# and encourages not to try other languages. This wasn't its purpose so I will try to reformulate it as to make my intent more clear.

I've carefully read your post and I although it's interesting and I agree with it, I decided not to add it to the FAQ for the following reasons: - it's right below the OP, formulated in your own words, so if the reader is interested in more discussion he will see it immediately - it's too high-level for the purpose of the FAQ, which is just to point the beginner towards a language, an IDE and some tutorials.

I agree that books are useful, if you have recommendations in particular (preferably with links) I could add a section for that.

Also I'd just like to point that at least two operating systems were written in C#: Singularity and Cosmos.

It's about both, and both matter from a beginner's perspective. A good, popular IDE will help him get started faster, get rewarding results faster, see his program in action, find appropriate tutorials on the net more easily. I do explain this reasoning in my post.

Your posts are mostly about environments. There's nothing wrong with that, it's just that you phrase it so that it seems like the pros and cons are somehow inherent to the programming languages, which is not true.

A GUI framework is not part of the C# language, it's part of a library, just like in C/C++. You could easily have Windows Presentation Foundation in native C++ (or even C), and it wouldn't be noticeably more difficult.

What you're really saying is that a C++ environment made up of Windows and Visual Studio is harder to develop for out of the box, because it doesn't come bundled with libraries like that. I think this distinction is important, and I'm not just trying to be pedantic.

So after "Productive for GUIs" you want me to add "(not because of the language itself, but the libraries and IDE integration that comes with Visual Studio Express which is what recommend installing)" ? I don't even expect someone reading this post to understand the difference between a language and the librairies it comes bundled with.

Besides the distinction is almost meaningless in some regards. In C#, int is defined as System.In32; C# is simply undefined without the BCL. And no you can't use WPF in C even if you wanted to.

Yes, you could. There's nothing magical about it. The fact that no one has bothered to write it has nothing to do with the language. I'm a little surprised that you don't understand this.

You cannot call WPF APIs from a true unmanaged program. You might be able to write some kind of wrapper and then use that, but the fact that no one has bothered to write one leads to believe that it's probably impractical and mainly pointless. And what's the relevance to a "getting started" FAQ anyway? As I said I don't expect someone reading this to understand the difference between a language and a library. C# lets you easily create GUI applications because WPF and Winform are well integrated with it in the Visual C# IDE; for beginners I can simply say "C# lets you easily create GUI application" and leave the rest for future discovery. It's not misleading. It's incomplete, but my point is to be helpful, not complete. Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.

Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.

I spent 2 weeks learning almost everything to do with C. After that. it took me a couple days to get my first fully-authored GUI program done using the Windows API. Sure, I followed a tutorial the first couple of days, but who doesn't? It's not that hard. All it takes is an intelligent person with the right mindset. If you give up too quickly, you'll never get anywhere. That's true in almost any case, programming or not.

It took me 3-4 months to learn C GUI programming in Windows AND Linux(Gtk+/SDL).It's not that difficult. Sure, C# simplifies it, but ALL .NET applications are SLOW.I wrote the exact same program with both C, C# and VB and it was no contest.(2.6 GHz Intel Pentium 4,2GB RAM,7200rpm HDD)C load time: 0.46 secs.C# load time: 2.35 secs.VB load time : 2.46 secs.

Fact: Everything you can do in C# or VB you can do in C.The Windows API is very simple once you get to know it.

It seems as if you're trying to draw attention to yourself, starting a thread with a title that you might find pinned to the top. I'm just saying, that's what it looks like.

Uhm, I said that you could easily have Windows Presentation Foundation in native C++ (or even C). As in that you could implement the same thing in C++ because it has nothing to do with the programming language, not that you could call the .NET version. Reading comprehension. There's nothing inherent about the language that makes it impossible to have modern APIs.

And what's the relevance to a "getting started" FAQ anyway?

It wasn't supposed to be a huge deal, just to point out that your post appeared to be trying to highlight pros and cons of programming languages, when that's not really what it does. What you're doing is giving your opinion of what out of the box experience one can expect when using Visual Studio under Windows, rather than discussing programming in general. Nothing wrong with that in itself, and it's certainly what a lot of people want.

C# lets you easily create GUI applications because WPF and Winform are well integrated with it in the Visual C# IDE;

Then you're saying that Visual Studio lets you do it, not C#. WPF isn't part of C# (and isn't even available on anything other than Windows.) The ability to automatically generate GUI code is not part of C# either, it's part of an editor/IDE. The actual WPF/Forms APIs are not really that simple if you had to write the code yourself, and I suspect the same is true for whatever .NET GUI APIs are available on other platforms.

Hell man, you could probably become comfortable with the good old Windows GUI/graphics APIs faster than it takes to figure out Expression Blend.

Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.

Debatable. No, you're not going to just instantly load it up and start dragging and dropping controls to make your own "browser" without actually understanding what you're doing and then go post on a forum asking how to compare a variable to some value, but then that is taking "learn as you go" too far and is not a good strategy. Is the goal to actually learn, or just patch something together as fast as possible? Once you've got the basics of the language down, it's not that difficult to get something graphical up and running in C or C++ on most platforms. In that sense your post seems a little clumsy and gives off a kind of biased vibe.