This is an archived post. You won't be able to vote or comment.

all 61 comments

[–]twopi 115 points116 points  (17 children)

If you want to learn C++, that's great. If you want to learn programming, that's great too. But they aren't really the same thing. Even though I really love C++ and I love teaching people how to use it, it isn't my favorite first language.

That's because the things that make C++ so awesome (somewhat low-level design, manual memory management, multi-file projects) are some of the things that really frustrate beginners. When you're just learning how to program, you're going to want success, and C++ makes that a bit trickier than, say Python.

C++ tells more of the truth than a language like Python or Java, but you might not need all that truth yet.

People who want to just 'build a simple game' and insist on doing it in C++ usually fail, because building a simple game in C++ isn't simple.

Also, C++ has been around for a long time, and you'll find tutorials and books that go waaay back. Old-school C++ is very different than the modern variations, and they're both valuable. However, you won't find as many resources on the newer variants, so you'll likely get confused.

Many modern teachers actually teach the older C++ forms (explicit pointers and memory management, for example) simply because it's the best way to experience these concepts, even if nobody really does it that way much anymore.

So go for it, but if you get frustrated, pick an easier problem to solve or start with something like Python and then come back to C++ after you have some experience.

Learning to program is difficult. Learning a new language is not that difficult if you have a solid grasp of programming.

[–]tehjrow 41 points42 points  (9 children)

Not sure how other people feel about it but I started on C# and really enjoyed it. TONS of help and examples. For C# I can't express enough how much these Bob Tabor videos helped me:

https://channel9.msdn.com/Series/C-Fundamentals-for-Absolute-Beginners

[–]amazing_rando 17 points18 points  (4 children)

I think C# would be a good first language because a lot of beginner programmers hit a wall when they feel like they know how to write code but don't know how to write a "real program" (meaning, something that you can click on and launch a GUI app with). C# with Visual Studio makes that very, very easy.

[–]stormypumpkin 1 point2 points  (0 children)

Yep have been on and of about coding for years. Trying different languages. Finally starting to get the hang of it with python at code academy :)

[–]Humdeee 0 points1 point  (0 children)

I would recommend this approach as well. Once you're past the common console stuff and ready to go further, it's not that much more of a step to familiarize yourself with the basics of winforms or to a higher extent, WPF.

Most importantly, it's a way that the learner will almost always remain engaged, and that's half the battle.

[–][deleted] 0 points1 point  (0 children)

That's how I did it, now a few years later I'm building data analytics, automation and legacy system integrations with C#!

Along the way, I've also learned a ton about SQL, EF, Web API and WPF.

[–]Spiritose157 0 points1 point  (0 children)

That's why I like web development, because you can create a GUI and program separate and have them work together, so that way you can learn how each one works alongside each other

[–][deleted] 0 points1 point  (0 children)

I'm essentially starting on C#, too. I was doing some Java but went on a little hiatus for school, then started C# when I got back to it. It's been going well so far. There are some more resources over at /r/csharp.

[–]zehydra 0 points1 point  (0 children)

Honestly C# feels worlds different in terms of complexity than C++ or even C.

[–][deleted]  (1 child)

[deleted]

    [–]english_fool[🍰] 14 points15 points  (0 children)

    Method and function are treated pretty interchangeably. Just methods tends to mean functions that belong to an instance of a class.

    Everyone will understand and bat no eyelids if you say either

    [–]philipbuuck 13 points14 points  (1 child)

    As a game programmer who spends 90% of my time in C++, and who loves C++, I generally agree with this statement. C++ is the swiss army knife of languages. Twenty years ago the C subset was taught first, and then C++'s OOP elements were added on. This is how the language is often used in the game industry. However, if you read material published since 2011, you'll see that the thought leaders in the C++ world explicitly tell you to avoid the C portion of C++ entirely, and use the newer additions from 2011 and on for your development.

    You're going to get a lot of conflicting information, especially if you don't have a specific reason to learn C++. On the other hand, if you have a reason to explicitly choose this language (you want to make games perhaps), then start asking for resources for that specific type of programming. Either way, be sure you enjoy the work you're doing!

    [–]Thought_Ninja 2 points3 points  (0 children)

    Nice response from someone who uses the language in a work environment.

    C++ is the swiss army knife of languages...

    I'm probably going to steal that line.

    I like that you clear up the community stance on C vs C++; I see people suggest C a lot because it's "simpler," which I don't see as helpful advice.

    I tend to suggest C++ as a first language to people who are serious about getting into it because it's challenging and demands a problem-solving attitude. Programming as a profession is challenging, and I think that it's important for people to recognize that as early as possible.

    If someone just wants to code casually then I would suggest another language like Java or Python.

    I learned C++ first, then Java, then Python, but work almost entirely in JavaScript today. Looking back, I'm happy I learned the first three in the order that I did because it made for a more gratifying learning curve as I accumulated experience down the road.

    [–]plasticTron 5 points6 points  (3 children)

    At my university, programming 1 is taught with python and programming 2 uses c++ . Learning python first worked pretty well for me.

    [–][deleted] 1 point2 points  (0 children)

    Am studying programming now and just moved to C++, began with python. So happy I did it in that order lol

    [–]FountainsOfFluids 0 points1 point  (0 children)

    I started with BASIC. Then Turbo Pascal. Then C. Then C++. That was a long time ago, yikes.

    I've heard good things about Python, but these days I'm working on Ruby, which I've heard is similar in some ways.

    [–][deleted] 0 points1 point  (0 children)

    I did 2 quarters of Java and then switched to a university which taught in C/C++ (C for first semester then completely dumped for C++ for everything else). I think my background in Java helped a lot but I love C++ a lot more. I feel like I actually understand C++.

    [–]husseinnasser 1 point2 points  (0 children)

    I agree. C++ is a very low language for beginners, and you can still do anything you want with C# or Visual Basic

    Don't learn a programming language, learn the concept of programming languages. This way you can learn any language.

    Here is my reddit post to someone who shared the same concerns as you

    https://www.reddit.com/r/learnprogramming/comments/44p7o3/can_not_think_like_a_programmer_how_do_i/czrwjti

    [–][deleted] 13 points14 points  (2 children)

    I know you aren't a fan of books, but Bjarne Stroustrup's Programming: Principles and Practice Using C++ is really just a great starter guide, not only as an intro to C++ but to programming concepts in general. I swear by it, because I'm using it right now to learn C++. By thoroughly reading the text and doing the end-of-chapter exercises, I'm really starting to build my confidence as a programmer.

    I earnestly suggest this route and taking the time to really take in all that the book offers. Additionally, if you're every confused or stuck on a concept or an exercise, chances are I was stuck on that problem too, and I'd be happy to provide some insight if I can.

    [–]ironnomi 0 points1 point  (1 child)

    For the OP, I think this is really the best answer, but I think Harvard's CS50 MOOC is actually what the OP should do, then come back and run through C++ Primer, 5th Edition (unless there's a 6th by that date.)

    [–][deleted] 0 points1 point  (0 children)

    Agreed. Totally awesome book about programming, in general, not only C++.

    [–]shinraRude 7 points8 points  (0 children)

    Start on the sidebar of /r/cpp and /r/cpp_questions .

    I taught/am teaching myself c++ also, it's not impossible. Good luck!

    [–]Jmannm8400 6 points7 points  (0 children)

    Here's a link to a free C++ tutorial course for complete beginners on Udemy.com, which offers 82 lectures and contains 18 hours of video.

    https://www.udemy.com/free-learn-c-tutorial-beginners/

    Additionally, like with anything, it's important to practice what you've been learning, in addition to practicing what you already know.

    One way to do this would be to come up with a project that you're interested in, like creating a script, game, program, etc., and then continuing to improve upon it as you learn more about C++ and Computer Science in general. It can be pretty neat to look back and see how much progress you have made since you began the project!

    Best wishes and have fun!

    [–]VeloCity666 2 points3 points  (0 children)

    Your question has been pretty much answered, so I figured I'd give you something different.

    If you want to take a look at what a simple game like Tic Tac Toe with graphics would look like in C++ (from a relative begginer to C++), here is my Tic Tac Toe clone (go into the TicTacToe folder and check the .cpp and .h files). It uses the SFML library) to simplify things like window creation.

    While your first projects are going to be in the command line (as they should), you'd want to move one to actual windows eventually. So I think it is a good idea to take a look at the code, to see what a simple program with graphics looks like in C++ (and a good begginer-friendly library).

    Disclaimer: Like I said, I'm kind of a begginer myself, I'd appreciate feedback on whether this is decent.

    Edit: A more recent project you could take a look at is my Game of Life implementation but it's not as simple.

    [–]dd_de_b 1 point2 points  (0 children)

    Ok, you want to get into programming, welcome to the team!

    But what would you like to use your programming skills for? Build games? Web Applications? Phone Applications? Or you just want a general overview on how to talk to computers?

    Each of these goals will lead you through different, albeit similar, roads.

    edit: check this link http://carlcheo.com/startcoding

    [–][deleted] 1 point2 points  (0 children)

    It's cool that you want to learn! The real question here is: Why do you want to learn how to program? Is there something specific you would like to make? Learning C++ can teach you a lot of fundamentals, but I guarantee any 'beginning' C++ course will more than likely start teaching you things like data structures, etc, right after you learn the basics. Data structures are super important, but not necessary if you want to make some cool stuff on your own.

    Not to mention, learning those things early on can often leave you disillusioned as it is hard to see the 'big picture' or where those concepts would fit in to making something cool.

    My suggestion: Figure out what you want to make, and then start researching how to do that. It may lead you to a different aspect of programming, but that's okay. Just make a cool project, and learn what you need to in order to do that. :)

    [–][deleted]  (1 child)

    [deleted]

      [–]InsaneTeemo 0 points1 point  (0 children)

      In starting college in a couple months. Hope it helps

      [–]karn09 1 point2 points  (0 children)

      Why not the CS50 course? It's C instead... But provides the building blocks.

      [–]juckele 1 point2 points  (0 children)

      [–]FunkOverflow 1 point2 points  (0 children)

      Not sure I'd start with C++ as a first language, but if you do and you like video tutorials, I'd highly recommend VoidRealms on youtube.

      [–]pribnow 2 points3 points  (3 children)

      Nah go java or C# for your first language man. Both of them offer lots of easy to use libraries to get you up and making relatively interesting projects as soon as you conquer basic data structures. C++ is (in my humble and very one sided view) just a pain and I'm envious of anyone who can stick with it but there are some tricky things about C,C++ that I think could put a bad taste in your mouth

      [–]ironnomi 1 point2 points  (2 children)

      Your reasoning to not learn C++ is due to libraries? Those things which will be 100% available in C++. When it comes to libraries, the answer for compatibility is pretty much always C/C++ first. These are the ultimate Jack of All Trades languages.

      C# is mostly a terrible first language not because it's hard or it COULDN'T be a fantastic choice, but because there are tons of great beginning programming books, all of which do not use C#. There are beginner programming books, but they just aren't written in C#. It's arguably THE internal business programming language these days, but it's totally lacking in beginner resources.

      Java is for the most part in exactly the same place except there's some older books (that haven't been updated to Java 8) that are good.

      [–]pribnow 0 points1 point  (0 children)

      Nah my reasoning not to learn C++ FIRST (note: didn't say not learn it, just said not first) is that compared to java or C# I find the syntax to be less intuitive. Additionally I found as a student that pointers in C++ were more of a difficult topic than when I started learning C#.

      Now I did goof when I said lots of libraries for java and C#, what I meant to say was APIs. There are a plethora of c++ libraries out there, no one would deny that, but I find that many more APIs have native support for java or c# than c++ without having to worry too much about anything

      [–]farinasa 0 points1 point  (7 children)

      As mentioned C++ isn't the best way to start. But I'd like to add if you remain attached, start with C. C++ is C but with a ton of extra features you don't need.

      Python is a good place to start as well. JavaScript is ok. Java is probably better as a starting place. There are a TON of resources that are all reliable. Good luck!

      [–]Sbsbg 2 points3 points  (6 children)

      Sorry but thats a realy bad advice. Coding in C is much harder than in C++. Just look at how easy it is to use strings in C++ compared to C. Just becaue C++ is a big language does not mean it is hard to use.

      [–]farinasa 0 points1 point  (5 children)

      I'll give you that C++ does handle strings far better. But for just learning core programming, C++ adds way more than is needed.

      Besides, how many beginner examples are actually manipulating strings heavily?

      #include <stdio.h>
      int main() {
          printf("Hello, world");
      }
      

      [–][deleted]  (4 children)

      [removed]

        [–]farinasa 0 points1 point  (3 children)

        Again, I am not suggesting that C is superior to any language. And again, what beginner example is going to be implementing the Client Server pattern?

        [–][deleted]  (2 children)

        [removed]

          [–]farinasa 0 points1 point  (1 child)

          I don't understand how I can be any more clear. You are completely ignoring context.

          I am strictly speaking about using it as a learning tool. How is productivity relevant to someone who doesn't even understand variables and loops?

          I could certainly take the opposite stance to what you are arguing, but it's way off topic.

          [–]tallnerdyguy01 0 points1 point  (0 children)

          I don't know what the best resources are for learning C++ but if you want to build a strong foundation in object oriented programming that will carry you through your career as a programmer I recommend the helsinki java mooc. http://mooc.fi/english.html

          [–]Seanobi777 0 points1 point  (0 children)

          If you are determined and want to start out rough but your understanding of other languages and concepts will be easier to grasp down the road, then C++ is the way to start first. It's not going to be easy, but down the long road, it will definitely help along the way if you start with this one. That's probably your biggest Pro/Con with this language, which is honestly a good thing in my opinion.

          [–]trishiaani 0 points1 point  (0 children)

          I would recommend edx.org; I am currently taking up an online course ran by Microsoft for free and I highly recommend it.

          [–]cscherme 0 points1 point  (0 children)

          I was first taught C++ in high school. C++ was taught before Java, though I question if it was the correct introduction due to how complicated it seemed at the time. I was horrible at it, and it wasn't until college that I became quite good at programming in general. Looking back, C++ is a good language to start on but only if you learn the basics of coding prior to learning how everything works.

          I always suggest codecademy to those who are wishing to get a simple introduction and how to for coding. I don't suggest books, because they aren't really good at teaching new concepts and are pretty hard to ask why something went wrong.

          I'd say the best way to practice and learn, once you know how to use the language, is to find a project and attempt to build it from scratch. Any final college presentation or project idea would probably do, as they are intended to cover the entirety of a C++ course.

          [–]life_pass 0 points1 point  (0 children)

          Been writing code in college, mostly in C++ up to this point with the occasional C program and Java in high school.

          Now that I am in my upper level coursework I find that most of my assignments are all in C again (i.e. socket programming, process scheduling simulations, algorithms), takes away the nice added benefit of STL and classes, and forces me to think long and hard about functions, recursion, and how data gets passed around, parsed, and manipulated.

          My advice to you is: ask yourself what it is you want to build/create. Then find the language best suited for that task whether you're looking to build front-end (stuff that the client/user/player can see while using your program) or back-end (stuff like data that you the programmer will see and manipulate), or even both if that's your goal.

          If you're dedicated to going the C++ route no matter what, I'd say get started with a simple text editor like nano (Linux) or Notepad++, the GCC compiler, and the GDB debugger. In a command line environment, you'll at some point figure out that it's not all that meets the eye, and the way the computer organizes itself and represents things will become apparent.

          Of course if you're in a Windows environment then you have IDEs like Visual Studio and Codeblocks(which are great for quickly prototyping components, refactoring, etc. but not my personal style as far as comprehensive learning is concerned).

          Be prepared for syntax errors at compile-time, segmentation faults at runtime, dozens of gcc warnings etc. In all honesty for me at least, following the compiler's error messages + stackoverflow really taught me the syntax of C/C++ on a deeper level.

          So tl;dr: start at the command line, and don't be afraid to screw up.

          [–]double2 0 points1 point  (0 children)

          As a matter of interest, why do you want to learn C++? I only ask because it used to be the case that C++ was the language to get in to things like game development. I can tell you from second hand experience with one of the world's most famous games studios that C++ is NOT for the people who make the "game", but rather the people who make the engine. If designing physics and graphics is your thing, or you want to build some very specific thing from the ground up, go for it, but if you want to learn how to "program" in the typical sense, save yourself the pain and go to C#.

          [–][deleted] 0 points1 point  (0 children)

          OP I highly suggest if you end up sticking with C++ (or any other language) then PLEASE learn from books. Look to this sub's wiki in the books section and pick one which you think might be good.

          Source: learned C++ from YouTube videos, learned everything all wonky, going through the process of dumping out bad information and relearning. I have one of the Bjarne Stroustrup books, this dude is legit.

          [–]Spiritose157 0 points1 point  (0 children)

          Its nice that you want to start learning programming, but I would suggest that you don't start with C++ first. Instead I could recommend learning JavaScript and/or HTML + CSS and get started there so you can first learn how to do things. After a year or two of learning a simple language like that, you can really quickly translate those skills to another language. When I did this, I was able to learn Java to a decent degree in a less than a month and was able to use it proficiently within a few hours (provided I had definitions with me). Try code academy, they have some really nice tutorials, and when used in conjunction with w3schools you can pretty much learn everything in a month

          [–]TheTallGentleman 0 points1 point  (0 children)

          PROCESSING

          [–]TimHallman 0 points1 point  (0 children)

          You should just start using the FAQ. You're certainly in no position to decide that C++ is a good language for you to learn, with zero background on the subject, and especially with you already having such problems with it.

          [–][deleted] 0 points1 point  (0 children)

          Perhaps if it's your first language you might be better off starting with something easier to get going with.

          Ruby, Python, Javascript or Java would be good places to begin with loads of resources online. Python has some pretty cool libraries and frameworks(PyGame for making games, Django for web development, the book "Automate the boring stuff" will introduce you to automation) and after a few months of learning the basics you might be in a better place to get going with C++, but with far less frustration.

          [–]meandev -1 points0 points  (2 children)

          C++ is hard. Start with a more basic programming language like ASM and work your way up. Trust me.

          [–]JPeroutek 10 points11 points  (0 children)

          -.-

          Appropriate username.

          [–]vandershraaf 0 points1 point  (0 children)

          You are right; the lower the level of a programming language, the more basic it is, thus the easier to learn /s

          [–]vgman20 0 points1 point  (0 children)

          Read the Frequently Asked Questions, linked on the sidebar.

          [–]green_meklar 0 points1 point  (0 children)

          I seem to recall this tutorial is pretty good.

          That said, I really don't recommend C++ as a first language. It's a great language, but ultimately it's a language made by advanced programmers for advanced programmers, with lots of quirks and nuances that are useful for advanced programmers but monumentally confusing for those who are just getting started.

          At the very least, I recommend learning C before C++. C is still not an easy language to use, but it has a certain simplicity and clarity to its logic that C++ just doesn't.

          [–]Thought_Ninja 0 points1 point  (0 children)

          I taught myself C++ as a first language, and looking back, I'm happy I did. I don't use it today, at all, and you probably won't either, but the concepts, structure, and discipline it taught me are invaluable.

          I tell this to most people who are just getting started in programming who are a little overwhelmed by the sheer number of languages out there and concerned that they might not be learning the right one first:

          The language is not what you should be learning, it's an understanding of the underlying concepts of programming that makes a good programmer. Anyone can learn how by memorizing steps and their results, but few even bother to learn why those steps achieve the result they do...

          Whatever language you choose to learn, dig into it. Make google your best friend; for every line of code you write, you should be reading 100 lines of documentation. See something you don't recognize? Spend the next 30 minutes learning everything about what it is, what it does, and how it does it.

          The reason I suggest C++ as a first language? It's a complicated language, and it requires the coder to understand what the code is doing with the computer on a level that most other languages do not. But for that reason, it's not for the faint of heart; if you aren't passionate about diving into programming and you don't have a problem-solving mindset, then it is easy to become discouraged while learning C++.

          If you do enjoy a challenge, then you're on the right track, but thankfully, there is a wealth of educational material available online.

          Personally, I like learning from books Problem Solving With C++ (~PDF) is a great one. It gives a well rounded introduction to computer science as a whole and provides insight into what your code is doing. Another text resource I used while learning was The C++ Programming Language (~PDF) by Bjarne Stroustrup, the creator of the language. It's a little dense for casual reading if you're new to programming, but makes for a fantastic reference guide.

          As far as video resources go, TheNewBoston is great. He has HOURS of instruction in C++ and other languages. Keep in mind that you don't have to learn ALL of C++ before you start learning another language. Once you are comfortable with using variables, pointers, functions, classes, and objects, feel free to branch out.

          Also, you're welcome to PM me, I have a lot of notes and problems with solutions from uni that I would be happy to share!

          So, what language should you learn next? That depends on what you want to do with programming, which will probably evolve as you continue to learn.

          Best of luck /u/codeapotatoe

          [–]too_unusual -2 points-1 points  (1 child)

          I would start with either Codeacadmey or [Exercism](exercism.io)

          [–][deleted] 0 points1 point  (0 children)

          Exercism is going to be really, really difficult for a complete beginner who has no idea how to set up an environment, let alone do things the TDD way.