Best way to learn C++? (Or other better languages)

Discussion in 'Computer Programming, Emulation, and Game Modding' started by Selim873, Aug 4, 2015.

  1. Selim873
    OP

    Selim873 Nunnayobeesnes

    Member
    1,174
    588
    Jul 31, 2010
    United States
    Chillin' with Bob Ross
    I want to get into programming, since I've always wanted to mess with basic programs and even homebrew on the 3DS and maybe even future systems. Mostly porting stuff. ;) Where would you point to for the best and easiest way to learn how to program in that sense? I saw a "One Hour a Day" book on Amazon for $30 and I was thinking of going that route, but I also wanted to see what some of you guys think. I'm sure a lot of people just started programming at a young age, I dropped out of college before I ever made it to programming because tuition is just way too expensive.
     


  2. Julizi

    Julizi Advanced Member

    Newcomer
    91
    17
    Jul 3, 2015
    Germany
    Don't start with C++, it's too difficult for a beginner.
    I recommend to start with C#. This language is much easier but you learn many concepts of C++ programming.
     
  3. ghjfdtg

    ghjfdtg Advanced Member

    Newcomer
    59
    42
    Jul 13, 2014
    With C# you will go nowhere if you want to make homebrews. Start with C and later C++. If you know C you know like 70% of C++.
     
    nastys, bkifft and zoogie like this.
  4. VinsCool

    VinsCool Comfortably Numb

    Member
    GBAtemp Patron
    VinsCool is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    11,857
    28,354
    Jan 7, 2014
    Canada
    Another World
    Trying, reading classes books, online tutorials and a lot of patience :)
     
    CosmoCortney likes this.
  5. Julizi

    Julizi Advanced Member

    Newcomer
    91
    17
    Jul 3, 2015
    Germany
    That's the price you have to pay. If you start with C++ it will go to nowhere. You need basic knowledge to be learned with an easy language.
    When he can C# somewhat, he can start with C/C++.
     
  6. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,514
    9,330
    Nov 21, 2005
    Best way to learn?
    Have a project you want to accomplish. I meet surprisingly few people capable of learning for the sake of learning, and even among those a project they want to accomplish is not a hindrance. I would probably only suggest C and/or C++ to a new programmer that did aspire to go into higher performance areas of programming (be it audio-video, some aspects of games, embedded devices, drivers and other high performance/low level stuff) or head into the computer scientist world rather than just needing to be able to knock out a bit of code to convert things, speak to other programs and other useful but not necessarily performance demanding tasks.

    As others said C++ is a variation on the theme of C, a substantial variation and not a bad one in the grand scheme of things, but being able to do C will at least leave you in a good place to tackle C++. I do not know if I want to link this to a new programmer but it is good
    http://www.slideshare.net/olvemaudal/deep-c

    After that I can suggest the following playlist, it is very good.


    More generally we do have a sticky on learning to program http://gbatemp.net/threads/so-you-want-to-learn-to-program.371255/

    If you are more into books then I liked Apress' Beginning C - From Novice to Professional (do a search). That said that comes with a large asterisk as I already knew quite a bit of digital electronics, ROM hacking and general concepts underpinning programming (including a working knowledge of assembly) and was bored of the normal C books holding my hand. It covers the basics but did not labour the points like other books I had tried.
     
  7. Fat D

    Fat D GBAtemp Maniac

    Member
    1,124
    53
    Nov 18, 2006
    Gambia, The
    If you want to start programming, it is better to start with simpler workflows like PC programs or web scripts, where deployment does not take ages. Starting with homebrew is a bit much.

    And even learning a completely different language from the one you are going to need eventually is not a problem, as any language helps practice the basic principles of programming, which are going to be helpful in any language. Of course, if two languages are of vastly different paradigms (say Haskell and C) there is less to reuse, but you can reuse lots of your Java learnings in C++, to give a single example. On the other hand, there is the risk of something that is a preferred practice in one language being a bad habit in the other, but dipping your toes into different languages can help sensitize you to those nuances.

    And that C/C++ thing is awful advice. Yes, almost all C code is valid C++ code, but treating it as C with some extensions is just scratching the surface of C++. And using much of the things you do in C in a C++ context is technically possible and valid, but also stuff no self-respecting C++ programmer would ever do because the tools C++ offers can do the same job maybe a little slower, but also more readable and maintainable.
     
  8. gudenau

    gudenau Largely ignored

    Member
    3,277
    1,250
    Jul 7, 2010
    United States
    /dev/random
    Get Minecraft and start makibg mods for it, that is how I started.
     
  9. Lucifer666

    Lucifer666 all the world needs is me

    Member
    1,494
    730
    Apr 22, 2011
    The Fourth Dimension
    rubbish, C++ was my first language and its easy enough

    I used the book 'Sams Teach Yourself C++ in One Hour a Day'. It really starts absolutely from scratch, even explaining to the reader what an interpreter and compiler are and whatnot. However it doesn't only explain C++ at a basic level, it is quite a massive book and following it through you'll see it actually does get quite complex

    good because it's comprehensive and noob-friendly so you won't have to buy like 10 other books to supplement your learning
     
  10. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    12,092
    5,166
    Mar 17, 2010
    Norway
    Alola
    College? Man I was like 11-12 when I got my first programming book :P
    Personally I think books are a pretty bad to learn programming, I learn better by figuring things out myself, that's just me though. Never learned much from that book, although it was Visual Basic 6 for Dummies which may have had something to do with it. It was just far too slow going for me.
    You can probably find good tutorials online if you look around that will teach you the basics and from there you can go on to learning more advanced stuff on your own, depends on how quick of a learner you are. I saw a large C++ guide somewhere that was supposedly better than the books, it was pretty detailed yet not needlessly long. I've long since lost the link though.
    I would recommend C#, as someone above me said, it's a lot easier to learn, and it's still a pretty modern language that's useful to know.
     
    Selim873 likes this.
  11. Selim873
    OP

    Selim873 Nunnayobeesnes

    Member
    1,174
    588
    Jul 31, 2010
    United States
    Chillin' with Bob Ross
    That's the exact book I saw! Lol I may buy it, but I'm definitely going to look at other languages.
     
  12. Monado_III

    Monado_III GBAtemp Advanced Fan

    Member
    637
    352
    Feb 8, 2015
    Canada
    /dev/null
    Using that book right now, first programming language I'm learning (I'm 14) and it feels like it's going a bit slow but I am normally a very fast learner so I'm sure most people would like the pace it goes at.
     
  13. osirisjem

    osirisjem Wii U: Y U No Sell ?

    Member
    1,075
    356
    Jun 19, 2011
    Canada
    Firm up your goal.

    Is this for fun ?
    Would you consider this a trial run for a possible future career ?

    C++ is very difficult.
     
  14. filfat

    filfat Musician, Developer & Entrepreneur

    Member
    1,229
    858
    Nov 24, 2012
    Hi, the answer really depends on what you want to do but I'm going to answer this as I would if I gave myself advice.

    These days HTML5 + CSS3 + JavaScript is a fast growing set of languages that not only allows you to create websites (obviously) but also full blown applications, games and much more. Now there will come times when using web technology isn't realistic, for example requiring low level access when you need the best performance you can get (though asm.js is on it way with close to if not native speeds) or developing for a platform that doesn't support it (those are rare these days). So my recommendation is: start with HTML and CSS to create some simple websites just to get the feel of the DOM, then move on to JavaScript and use it a lot. Now after that you should be able to quite easily learn C# which generally is a way better language than let's say Objective C or Java.

    If you need help with learning any of these there are great material out there, for example codeacademy.com or Channel9.msdn.com


    Cheers and good luck, and who knows out might be sitting in Silicon Valley one day making millions working on some next generation piece of software. :)

    — Posts automatically merged - Please don't double post! —

    That is so false, in my experience teaching friends/coworkers starting out with C# then moving onto C++ is way faster than both C -> C++ and moving directly onto C++.
     
  15. Isaac

    Isaac American

    Member
    319
    104
    Dec 8, 2012
    United States
    Here? Right here? What about, say... over there?
    codeacadamy.com is a pretty good place. It's free, instructs you on what to do, and explains what you're doing and why.
     
  16. Monado_III

    Monado_III GBAtemp Advanced Fan

    Member
    637
    352
    Feb 8, 2015
    Canada
    /dev/null
    codecademy doesn't do C/C++/Java and probably never will.
     
  17. Isaac

    Isaac American

    Member
    319
    104
    Dec 8, 2012
    United States
    Here? Right here? What about, say... over there?
    Oh, I thought they did. Never mind. Sorry.
     
  18. Issac

    Issac I

    Global Moderator
    GBAtemp Patron
    Issac is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,275
    2,380
    Apr 10, 2004
    Sweden
    Sweden
    It's perfectly fine to start out with C++. What you do need to learn beforehand is how to think in code. Or rather: know what you want to do, break it down into smaller processes, break it down, break it down, break it down, and write it all in a language you speak.
    For example:

    I want to sort a row of numbers.
    How?
    I want to look at the numbers, and I want to compare them with each other.
    How?
    Well I need to save the numbers somewhere, and then compare... and move them.
    How do I save numbers?
    Do an array of numbers, where each position has a number.
    How do I compare?
    Check position 1 with position 2... or position x with position x+1. I probably need to loop it to check other pairs of positions.
    How do I move?
    Save the number in position x in a temporary variable, replace position x with position x+1, and move the temporary variable to position x+1.
    So what would this be?
    Code:
    save array with numbers
    loop
      check pos x & x+1
      if pos x is larger than pos x+1
        swap x and x+1 (x to temp, x+1 to x, temp to x+1)
    go to next set in the loop
    
    This would be "pseudo code", it can look a lot like real code, and it can look more like text.
    But now it's fairly easy to look up stuff online in ANY progarmming language to do this think. You have to look up how to do a loop in C++, a loop in Java, a loop in C#... how to save an array of numbers, how to check positions in arrays... the language doesn't matter.

    You'll learn this WHILE you're learning a programming language though, but do have this in mind and it'll be a lot easier to contine learning other languages later.
     
    ilman likes this.
  19. ilman

    ilman Gbatemp's Official Noise Eraser

    Member
    1,130
    243
    Jul 25, 2010
    Shibuya
    In terms of learning and practicing programming I can recommend these free online sources:
    https://www.codecademy.com/learn - it doesn't have any C++ lessons, but the Python and other tutorials are great and I think, as a language, Python should be the first for a beginner to learn
    http://www.codeblocks.org/ - if you really want to start off with C++, I recommend using this program for coding, since it's free, open-source and multi-platform
    http://www.cplusplus.com/ - the ultimate C++ reference. If you need to know how exactly something specific works, look there. The forums there are also very helpful
    http://www.learncpp.com/ - the best C++ learning guide on the Internet in my opinion. It covers 99% of C/C++ in a fairly easy to understand and well-written
    http://codeforces.com/ - once you learn C++(or any other language) and want to practice algorithms, this site has a LOT of programming problems you can try to solve. There are also real-time competitions from time to time. Some problems have crap translations though, since the site is Russian.
    https://codefights.com/ - imagine you turn searching for errors in C++ into a game. This site is that game. You play against bots or other people to spot the mistake in the code as fast as possible. It's a great way to practice searching for errors.
    http://stackoverflow.com/ - if you have any questions/problems ask here, there's always someone to help.


    There are other sites, but I don't want to overwhelm you with too much stuff. For now, download Code::Blocks, open up learncpp and go through each chapter slowly and carefully. If you don't understand something, Google is your friend. Good luck! ;)
     
  20. TheToaster

    TheToaster Warrior of the Toast

    Member
    430
    163
    Aug 11, 2015
    United States
    USA
    For anyone that says C++ should not be a first language is inaccurate. C++ was my first language and the computer language that I have the most comprehensive understanding of, and I am self taught as well. I would suggest Learning just beginner C++ at the moment just to get fluent with conditionals, program flow, dynamic memory, etc. Once you have gotten through with the core language and built up a foundation for you to work on, read some intermediate/advanced C++ books to teach you about the STL, multithreading and atomic operations, advanced templates and also touch up a little on template metaprogramming. A hacker/Modder/Embedded systems developer has to know a lot about the programming language they are using and be fluent in it. You will need to wait a while before doing actual 3DS homebrew until you have mastered it on PC and learned about hardware restrictions on the 3DS. Again, C++ is a subset of C, and learning C would simolify the process of learning C++, but it is not hard to learn C++ on its own.

    Generally speaking, you can divide computer languages into 3 groups:

    High Level - a high level language like Java uses an interpreter to translate code to a machine language

    Compiled - a compiler is used to translate compiled languages and is closer to the hardware itself. This includes C and C++

    Assembly - an assembler is used to translate code into machine format. Using assembly is much more harder and much more dangerous than using the other types. This is about the closest you can get to the actual hardware

    Machine code - raw series of electrical signals (binary) that a computer can understand.

    If you need help, join the cplusplus forums. You can also PM me at @[gbatemp]~icestorm. Or at this account
     
    Monado_III likes this.