Which programming language should I learn first?

Status
Not open for further replies.

ellusivegman

Distinguished
Jan 11, 2012
1
0
18,510
Before I describe my dilemma, let me first give a little background info.To start, let me just say that even though I am a beginner in programming, I still know a couple of things here and there. My first experience in learning how to program was during my sophomore year of high school, when I took a course on java. However I didn't have a good experience with that class at all for a number of reasons, mainly because the teacher didn't know jack about programming in java, which he even stated himself.

My second attempt at learning programming was a year later, when I decided to start teaching myself C++. Even though I actually made progress during this time, I eventually stopped because of too much schoolwork, laziness, and because the online tutorials I was using got pretty advanced fairly quickly.

I don't really know what I want to do in life as far as career goes, but I definitely want to learn programming at least as a hobby. One thing that I really want to learn programming for is video games. Before you jump to any conclusions, no I have absolutely no dilutions about breaking into the industry and working for someone like valve. I know that will never happen, and quite frankly, with all of the horror stories I hear about the industry I hear, and all of the stories I hear about how even great programmers have a horrible time getting a job, I'm glad I put that dream to sleep. However, I would like to make games for fun even though I will most likely never become well known (besides, indie game studios are the future anyway).

So now, here I am, a year later, and I really want to start learning programming. The problem is that I don't know where to start. Every time I ask people, or do research online about which language I should start with, I get a million different answers suggesting almost every language you can think of (except for visual basic and assembly of course lol). The languages that people suggest the most as a starting language are python, c, java, and sometimes c++. But I feel the need to ask this question myself. Which language do you think is the best for a beginner to start with?

Thanks in advance!
 

PhilFrisbie

Distinguished
I went from Basic to assembly to Pascal to Image to C to Visual Foxpro to JavaScript to PHP.

Right now, with advances in HTML 5 and browser speeds, I would recommend JavaScript. It is getting more popular by the day, you can create full browser based games with it, and you can always use it for interactive web pages.
 

randomizer

Distinguished
If you are going down the game route then that typically means C++ for most of the core (engine, AI, etc) and potentially a higher level language for the UI, but for small indie games you could go with almost any language. It really just depends on what level of complexity you are going for. You can make games in Flash if you really want to...

If you want to do something other than games, just try them all out and see which one "clicks" with you best. In the end, your first choice of language isn't all that important. You don't want to be a C++ programmer or a Python programmer, you just want to be a programmer. There are far more important things to learn than your choice of syntax. Higher level concepts and patterns can be learned using many languages.

I'd start by coming up with a small project or goal to aim for. Then you won't be mindlessly typing code and it will be easier to find a language that best fits what you're trying to achieve.
 

gamerk316

Distinguished
Jul 8, 2008
325
0
19,060
Understand that once you understand one language, the rest is all syntax. So I generally recommend starting at a more basic language to learn program flow (Algol 68 or Pascal), then moving up from there.

C is a good language to learn because of its use and syntax, but a bit overbearing to start with.

C++ is another, though I generally recommend learning the basics of C first. C++ is probably the best language to learn overall, due to its heavy use in Windows. Plus, its easier to work with for things like threading and window management compared to more basic languages. C++ is a language you really have to LEARN though, because its quite easy to do a lot of things wrong if you aren't taught well.

Smalltalk, Java, and C# are the three primary languages to really dive into to learn OO programming. C# is probably the easiest of the bunch to learn and work with, ESPECIALLY paired with Visual Studio.

And for kicks, throw in a scripting language as well. Be it Python, Ruby, Pearl, Haskell, or even Javascript.
 

gamerk316

Distinguished
Jul 8, 2008
325
0
19,060
Based on my learning, you have to go through several steps to really learn how to program well:

1: Basic I/O: Self explanatory.

2: Mathematical equations: Teaches order of operations, use of parenthesis, and introduces variables for the first time. Also introduces precision (floating point numbers) and casting of variables.

3: Control Structures: If Else, For, While, Do While, and Case statements. Its important the user know when to use which one. Also introduces users to proper code layout (Read: Tab Indents) for the first time.

4: Functions: Its important to know when to create a function to compute certain code blocks.

Most any language can do the above, but these are more or less the bear necessities any programmer needs to learn at some point. These should best be learned in a simple language in order to avoid having to teach more then necessary to start with.

Once these have been learned, you can move up to the C-like languages:

5: Header files: Most modern languages separate their functionality into different header files. These are introduced for the first time.

6: Call-by-Value versus Call-By-Reference: Important to know the difference between the two. Brings us naturally into the next topic...

7: Pointers: Users must have a very through understanding of what a pointer is, and how to use them properly. This introduces us to the following topic...

8: Error handling: Try/Catch/Finally blocks are now introduced

Now we can get to the good stuff:

9: Classes: What is a class, how is it different from a function, etc. How to instantiate an object of a class, private/public/protected, and everything else related to classes. This is the first real OO introduced, and I've found most people learn wrong at the beginning.

10: Overloading functions: you now have two class objects, but you can't add them because the "+" operator for them is undefined. Time to fix that.

11: Memory Allocation: When to use "int i = 0" versus "int i = new int i". Seriously, most people don't have a clue when to use each of these.

At this point, the user can start to solve real world problems. This is a VERY good time to move to a real OO language, like C#.

12: Window management: Time to move out of the console realm, and start creating an application with a Window. (You CAN use C++ MFC if on Windows, but C# is so much easier to use, I highly recommend starting with that when learning how to interact with Windows)

13: Threading: When to thread, when not to thread, locks, palatalization, and thread management (how to create/start/pause/terminate threads).


I'm sure I missed a few things, but once all of the above are learned and understood, the user should be able to at least understand what they need to do to solve a given problem for a given platform. I consider these the essentials for a programmer to understand.
 

hdeezie80

Honorable
Jul 18, 2012
14
0
10,560
Learn procedural C/C++ first then move on to object oriented C++ after you get the basics down, objective oriented programming is pretty easy to jump into. C++ in my opinion is the best to start out with because learning anything else is a snap afterwords.
 

sodacycle

Distinguished
Mar 18, 2011
6
0
18,510
If you're interested in gaming there are options other than C/C++. I've made basic games using XNA 4 refresh and VB. I started out on VB.Net and It's my favorite to program with. I recently took an interest in C++ and coming from VB it's obviously more complicated. My analogy of the two are this;

VB will hold you hand and tell you when you mess up.
C++ and others expect you to understand what you're doing before you start, they are unforgiving.

But don't let that scare you away. You can start out on a Fairly easy language such as VB to get the gist of how functions, variables, etc. work and then move to something more complex.

There's a guy on youtube that goes by the ID of Chili who does great DirectX C++ tutorials. I had never done anything in C++ until I started his tutorials and I've learned a great deal about the way the language works. Any programmer will be biased towards the language they started out on, because most of the time it's the one they know the most about. So asking a question such as "which should I learn first?" will always have a ton of answers.

You should instead look at it this way; Which will teach me what I want to know in a way that will help me towards my goal?

In that lies the answer of C++ because at least 90% of games are programmed using C++. Don't expect learning any programming language to be easy, they can all be complicated. Don't be afraid to look like a noob on a forum when asking questions about problems you're having when coding either. Everyone was a noob at some point. Just be sure to do a web search for the answer before posting a question first, you're always expected to at least have exhausted your options first.
 

sirdki

Honorable
Mar 3, 2013
1
0
10,510
I think the best way to decide what lamguage to learn - to decide what you want to develop. If you want to make websites - php, python, java is better. If you want to create games, have a look at C++. When I chose the variant for me I prefered to make mobile apps. This Infographics shows which programming language every OS uses: http://www.brilsystems.com/mobile-app-programming-languages/
 

motube tube

Honorable
Mar 28, 2013
1
0
10,510
my first programming was in c++ and i didnt know much about how and when to if, than, else . and it was really complicated so i tried java and the javadoc was super help full so i writed my first game and than apps and i even made a few minecraft mods and than i went to html, css, php, javascript
 
Status
Not open for further replies.