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

Selim873

Nunnayobeesnes
OP
Member
Joined
Jul 31, 2010
Messages
1,275
Trophies
0
Age
30
Location
Chillin' with Bob Ross
XP
1,112
Country
United States
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.
 

Julizi

Well-Known Member
Member
Joined
Jul 3, 2015
Messages
110
Trophies
0
Age
123
XP
338
Country
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.
 

Julizi

Well-Known Member
Member
Joined
Jul 3, 2015
Messages
110
Trophies
0
Age
123
XP
338
Country
Germany
With C# you will go nowhere if you want to make homebrews.
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++.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
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.
 

Fat D

Well-Known Member
Member
Joined
Nov 18, 2006
Messages
1,136
Trophies
0
XP
454
Country
Germany
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++.
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.
 

Lucifer666

all the world needs is me
Member
Joined
Apr 22, 2011
Messages
1,626
Trophies
1
Location
The Fourth Dimension
XP
2,160
Country
United Kingdom
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.
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
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,256
Trophies
4
Location
Space
XP
13,812
Country
Norway
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.
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.
 
  • Like
Reactions: Selim873

Selim873

Nunnayobeesnes
OP
Member
Joined
Jul 31, 2010
Messages
1,275
Trophies
0
Age
30
Location
Chillin' with Bob Ross
XP
1,112
Country
United States
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
That's the exact book I saw! Lol I may buy it, but I'm definitely going to look at other languages.
 

Monado_III

Well-Known Member
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
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.
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.
 

osirisjem

I miss the Wii remotes
Member
Joined
Jun 19, 2011
Messages
1,116
Trophies
1
XP
1,157
Country
Canada
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.
Firm up your goal.

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

C++ is very difficult.
 

filfat

CTO @ Nordcom Group Inc.
Member
Joined
Nov 24, 2012
Messages
1,261
Trophies
1
Location
Gothenburg, Sweden
Website
www.sweetsideofsweden.com
XP
1,749
Country
Sweden
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.

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. :)

--------------------- MERGED ---------------------------

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++.
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++.
 

Issac

Iᔕᔕᗩᑕ
Supervisor
Joined
Apr 10, 2004
Messages
7,025
Trophies
3
Location
Sweden
XP
7,343
Country
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.
 
  • Like
Reactions: ilman

ilman

Gbatemp's Official Noise Eraser
Member
Joined
Jul 25, 2010
Messages
1,128
Trophies
0
Age
25
Location
Shibuya
XP
570
Country
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! ;)
 

TheToaster

Kishore
Member
Joined
Aug 11, 2015
Messages
467
Trophies
0
Location
USA
XP
979
Country
United States
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
 
  • Like
Reactions: Monado_III

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=uLN9qrJ8ESs