Learning c++

Completely new to coding just thought I should know how things work that I use every day and I have no idea what I'm going to do with my future but I like computers so I decided to try to learn c++. I'm just looking for a good guide or If you guys suggest a different language I'm open to whatever. So if you guys could recommend something that would be awesome. :-) 

I have said this in a few other posts.  Don't start with C++.  It is too hard of a language to learn as a novice coder.  You will have to learn too many concepts, coding techniques, and methodologies all at once.

Many people will tell you to start with a scripting language like JavaScript, Python, or Ruby.  I would also not recommend this.  You will want to start with a compiled language.  The compiler will help you uncover, and more importantly, understand errors faster.  Scripting languages tend to mask errors, usually subtle errors that tend to frustrate novice developers.

I would recommend starting with Java.  It is probably the easiest language to learn how to program.  And it shares a common syntax with C++.  So if you really want to learn C++, after your learn Java you will know about 85% of C++’s syntax and understand Object Oriented programming, another key concept required for C++. 

If you do decide to start with a scripting language instead of compiled one, Python would probably be your best choice.  At least it is strongly typed.  That will remove at least some of the headaches you will face.

Fauntleroy said it. Everything you need to point you in the right direction. Java will teach you the basics properly, and probably the best language to start with and branch out from.

Hello,

I've been programming for around 8 years now and I completely agree with your post.

Though, I do have a question. I've programmed in C++, but not in Java (except for Minecraft modding). How much easier is Java to understand than C++? I've always wondered this, because I thought that you would run into many of the same errors (at least syntactically), because the syntax was very similar.

I found this forum helpful when I got stuck with stuff. They wont spoon feed you answers but guide you to figuring it out

http://www.javaprogrammingforums.com/

Java’s syntax is mostly more concise than C++, making it easier to understand.  Well, except that you explicitly say a class extends another class or a class implements an interface instead of using “:” which I think actually leads to more easily readable code.  And interface is a keyword in Java used to define a class that is an interface, and interfaces have specific purposes in Java.  Although, when Java 8 comes out in a couple of months Java interfaces will chance quite a bit, they will become more like C++ classes with non-pure virtual methods.

You will make a lot fewer syntactically errors in Java than in C++. One of the big things is there are no pointers, or I should say the pointers are really hidden from you.  Java has references, but there is no dereferencing them or passing the address something to a method.  The JVM handles all of this for you.

And in Java everything is pass by value.  There is no pass by reference.  This also helps to cut down on lots of syntactical errors, especially from novice developers who may not know when to pass the actual value of something or a reference to it, what the difference is, and how the code will behave if you mix the two up.  Even object references are passed by value.  This is the biggest mistake I have seen in some Java books and a common misconception. When you pass an object reference to a method, the method receives a copy of the reference not the reference itself.

Another thing Java will not let you make if statement assignments if you mistakenly use = instead of ==.

Another non-syntactical easiness with Java is that everything has to be class (enums and interfaces are just specialized classes).  When you write your code everything has to be defined inside of a class.  This might sound trivial or even cumbersome, but it is actually quite helpful.  With C++ you can certainly structure everything in classes, and write beautiful object oriented code using only C++ syntax.  But eventually, you are going to come across some C++ code written by a C developer that will utterly confound someone who is used to pure C++.

Wow, thanks for your post. It was well thought out.

I definitely can relate to your last paragraph of your post. WinAPI and OpenGL are written almost exactly like C. Where everything is a function call and you pass variables into those functions. (It also bugs me that those don't have their own namespace with their functions wrapped inside of it.)

 

Agree with C++ part, but interpreted languages help build useful stuff faster. Young dev might not sustain interest if he keeps building abstract excercises. JavaScript is the most practical language you can learn today (imho). Go with that or Python.

I don't mean to be giving bad advice here, but if you REALLY want to learn C++ (which I don't particularly think is a bad idea), it's definitely possible. I learned C++ as my first programming language, and it wasn't exactly the easiest thing in the world, but I feel like doing that gave me a better understanding of the way that most other languages work. I will say that, yes, it's significantly more complicated than something like C#. If you want to go in the C direction of things, rather than learning Java, I'd probably go with C#. It's somewhat similar (though a bit more complicated in many cases), but more importantly it'll be syntactically similar to C++, which is what you seem to be leaning toward right now. 

I was similar to you when I started. I learned C++ first, then Java shortly thereafter, followed by VB, html, php, sql, assembly, C# (yeah, was pretty far down the road), and lua. I've messed around with a few other scripting languages and stuff, but those are the ones I learned more fully. C++ isn't really a whole lot different than many of the other languages, just a lot more finicky, and not horribly kind to newer programmers. They aren't aware of how strict the syntax is, so they tend to make a lot of errors. Java and C# handle a lot of the crazier stuff for you, so you don't usually ever have to worry about a lot of it.

Again, though, if you REALLY want to get into C++, there's nothing that says you can't learn that first. If you don't want to take on such a challenge, C# is probably a good way to go. It's similar, and fairly easy compared to C++.

One thing worth mentioning is that if you go the C++ route, it may seem a lot less rewarding than going the Java/C# route. With Java and C#, you can create a relatively simple GUI, some basic games, and a bunch of other really cool stuff without doing much of anything. C++ will have you making some really advanced console applications that can add numbers together, or do something similarly simple (at least within the same time frame). It's all up to you, though. It's not like learning one thing or another is going to really set you back, and coding is open enough that you can change your mind whenever you want without losing too much from it. If you learned how to use if statements and loops in one language, you're pretty much going to know how to do it anywhere else. That means you can start learning one language, and a lot of the fundamentals you learn in that language will also apply everywhere else, meaning that even if you don't want to use that language ever again, you still haven't wasted your time.

Just do whatever it is you want to do. If you want a tutorial site that I really like to use when looking into new languages, here's a link: http://learnxinyminutes.com/

AS A WARNING -> the C tutorial is standard C, not C++. This website doesn't have any C++ tutorials, unfortunately. You could very easily use this to learn C# though, alongside some sort of formal tutorial or something.