Author Topic: So, I'm learning C++...  (Read 11516 times)

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
So, I'm learning C++...
« on: 2010-06-15 22:13:20 »
...and Japanese, finally. At the moment, I know absolutely nothing of the former and a little of the latter.

Does anyone have any advice/funny anecdotes about learning C++? (i.e. what books/online guides to read, what tools to use, etc)

DarkFang

  • Pirate
  • *
  • Posts: 730
  • Ponies! <3
    • View Profile
Re: So, I'm learning C++...
« Reply #1 on: 2010-06-15 22:17:44 »
Sams Teach Yourself C++. I have Sams Teach Yourself Java but it makes absolutely no sense to me.

http://www.amazon.com/Sams-Teach-Yourself-One-Hour/dp/0672329417/ref=sr_1_1?ie=UTF8&s=books&qid=1276640212&sr=1-1

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: So, I'm learning C++...
« Reply #2 on: 2010-06-15 22:24:43 »
I have Sams Teach Yourself Java but it makes absolutely no sense to me.

So, will his book on C++ make any more sense? ;D

Jaitsu

  • *
  • Posts: 1067
  • DON'T FWOOSH ME BRO
    • View Profile
    • Jaitsu Studios
Re: So, I'm learning C++...
« Reply #3 on: 2010-06-15 22:28:38 »
good luck, im still stuck in turing, and im trying to get a pong game working (not that it'll work, i ain't smart enough for dat)

so yeah, good luck in C++ and hopefully you figure it out

Lion

  • *
  • Posts: 172
  • Sleeping Lionheart
    • View Profile
Re: So, I'm learning C++...
« Reply #4 on: 2010-06-15 22:53:42 »
lol i got a funny anecdote about C++. I took C++ in high school and I sat with a bunch of my friends. They're kinda ass programmers so they just copy off me all the time. i would do the program and my friend would look at my screen. then my other friend would look at his screen and it'd keep going. So one day we do this program where we have to use a loop to find the least common factors of a number input (500 was what we had to use)
Me: I know how to do this program. Gonna take me like 5 mins max. Then you can copy me
Friend: Yo, brah, i'm not gonna copy off you no more
Me: You sure?? Lemme move my monitor closer so you don't gotta squint when you copy my program. *moves monitor*
Friend: Nah chill brah, I got it.
Me: You want me to email it to you, so when you fail, you can just copy and paste it?
Friend: Nah seriously I got this
Me: Aight whatever

So after like 5 mins, I'm done my program. Looks something like this
cout << please enter number to find the LCF's of << endl;
cin >> number;

for (counter = 0; counter <= num; counter++)
{
if (number % counter ==0)
{
cout << counter << endl;
}
}
So friend looks over.
Friend: Can you help me brah. I can't find the LCM's of 500. My program doesn't work.
Me: Aight.
Other friend: Your suck so much at programming. haha you're horrible.
Me: Look at this. Look at his program.

His program:
If (number != 1) && (number != 2) && (number != 4)  && (number !=5)

friend was like, what are you gonna do, count all the way up to 500?

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: So, I'm learning C++...
« Reply #5 on: 2010-06-15 23:00:43 »
I wish my high school had taught programming. :(

We had the worst IT teacher EVAR! (he was a shitty teacher and a shitty person)

We all did terribly in our GCSEs because he basically just left us to do everything for ourselves and barely even tried to teach us what was on the syllabus. It helped to put me off computers for a long time.

Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Re: So, I'm learning C++...
« Reply #6 on: 2010-06-16 02:24:30 »
Hey, I just started a thread on another forum I go to, about this exact thing.  I've been using learncpp.com although I kinda stopped for a week and gotta get back on that.  I've found it to be a great website, and coding has been kinda fun, I'm just not fully getting the different data types and how they work.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: So, I'm learning C++...
« Reply #7 on: 2010-06-16 02:27:38 »
C++ is a good language to start with. If you're attempting to attain marketable skills in it, consider learning Java and/or C# afterward. They're very similar and widely used.

Definitely look for forums if you're trying to teach yourself.   http://www.cplusplus.com/forum/   looks like a good place to start for C++. There are likely many others too. Just hunt around. Once you get the concepts down in one language of this level the rest will come pretty easy. There are just a lot of concepts to start with. I'm pretty advanced in VB.NET (and by relation, many concepts in other .NET language), but there are still things I learn that I didn't know.


Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Re: So, I'm learning C++...
« Reply #8 on: 2010-06-16 03:32:41 »
my main goal, is to be able to write Wii Homebrew, tbh =p

Mako

  • *
  • Posts: 669
    • View Profile
Re: So, I'm learning C++...
« Reply #9 on: 2010-06-16 06:54:21 »
Yeah I started with VB a couple of months ago...Seemed like a good place to start. Be forewarned its very difficult and tedious. 

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: So, I'm learning C++...
« Reply #10 on: 2010-06-16 10:10:07 »
Quote
Python here: C++ is lame.

As for learning the language, finding the right tutorial is hard. I actually dissent from a lot of people, in that I think it makes sense to understand the 'principles' behind a language before diving in to coding. Arbitrarily giving someone some C++ 'hello world' code doesn't really help. What's inclusion? What's a namespace? What's IOSTD? What's ...

I'm a firm believer that it's hard to understand anything as a set of arbitrary instructions. When they're logical, they make far more sense. That's why I'd suggest finding out about object-orientated programming and C in general.

Personally, I'd avoid .NET like the plague. Anyone who starts with proper C++ can easily adapt to C#, and can do work on embedded systems / UNIX platforms to boot. UNIX is important because, as the name (University X-Server) suggests, academic and technical research is centred around it.

To be honest, though, once you've learned a member of one 'class' of languages, it's easy to pick up the other members. BASIC users have no trouble switching to FORTRAN; C++ users to Java, etc. I think the only exception is LISP, which is... weird. At any rate, the real issue is understanding how to craft algorithms etc., thinking in 'orthogonal' terms when necessary, and being able to figure out quite different solutions to computing problems. There aren't many places to learn that, though.

hay

  • *
  • Posts: 211
  • If I had a buggy, I'd cross the southern desert
    • View Profile
Re: So, I'm learning C++...
« Reply #11 on: 2010-06-16 12:24:28 »
my main goal, is to be able to write Wii Homebrew, tbh =p

That's a good goal, better would be making a Wii game for WiiWare maybe but it's still a good start, hold on to it and you'll succeed.
I'm making with few other people PS3 game, it's tough but every little success is definitely worth it.


As for programming, object oriented languages aren't really that different. C++ is good way to start your adventure since it's kind of pro language, you can write here really nice software especially when you're performance and optimisation freak like I am and yeah, don't drown in mentioned .NET plauge. I worked with it, it's convenient, easy to use but limits your horizons. Or even DirectX for that matter. OpenGL is harder but better in many ways(performance, technology, multiplatform etc) and you're not limited to MS systems.

Quote
Python here: C++ is lame.
Python's fun, it's a prologue to new levels of convenience in programming. There's no indication which one is better. Just different strokes for different folks(including purpose).


...and Japanese, finally. At the moment, I know absolutely nothing of the former and a little of the latter.

Does anyone have any advice/funny anecdotes about learning C++? (i.e. what books/online guides to read, what tools to use, etc)
I'd suggest you to buy some books. Nothing better than good old cellulose. Bruce Eckel's "Thinking in C++" would be a good start but if you're complete beginner in programming I'd recommend Dawson's "Beginning C++ Game Programming". Didn't read the latter one but I heard it's good for beginners while the former may be a bit too much at the beginning.
« Last Edit: 2010-06-16 12:29:29 by hay »

sithlord48

  • *
  • Posts: 1634
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
So, I'm Learning C++
« Reply #12 on: 2010-06-16 14:29:03 »
don't waste your time leaning visual basic or C# unless you plan on only developing apps for windows. if you want a cross platform language Qt is C++ based,can be used w/ java and python. and has most the features that people like about vb (i.e ez gui design) also its GPL free.i highly recommend that everyone here learn and use qt for their projects. again C# and visual basic are a WASTE of time unless you only want to program for windows.

as for good c++ books, i can't really remember any, in school we used C++ for You ++ (love that title). basicly if i book is going to force you to use microsofts api's or AP headers its not a good book, since you will find that once you try to make a program with out them you have to relearn all the api calls.

for wii homebrew get devkitpro, and learn C not c++ most of the wii stuff is done in C. (very similar to C++ but lacking some features of C++)

that concludes my 2c worth of input.

p.s for gfx don't bother w/ directX again unless you only want to code for windows , learn openGL

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: So, I'm Learning C++
« Reply #13 on: 2010-06-16 18:43:58 »
don't waste your time leaning visual basic or C# unless you plan on only developing apps for windows. if you want a cross platform language Qt is C++ based,can be used w/ java and python. and has most the features that people like about vb (i.e ez gui design) also its GPL free.i highly recommend that everyone here learn and use qt for their projects. again C# and visual basic are a WASTE of time unless you only want to program for windows.

There's another reason non-MS platforms are convenient, too - closed standards / file formats are a b**** to reverse engineer. Open standards don't have to be. Besides, I'm a fan of the two unofficial tenets of GNU philosophy: write distinct tools that each do one thing well, and output everything that moves to text streams. It will save you headache in the end.

Java is a good choice for cross-platform, too. Java 'compiles' to bytecode, which is a bit like a generic low-level language which can quickly be interpreted via a virtual machine. MS is obsessed with virtualization at the moment, too. They seem to think it helps with security and means different engineers can maintain distinct parts of the system. I think it's another layer of crap to debug. But that's an issue for another time.

Quote
as for good c++ books, i can't really remember any, in school we used C++ for You ++ (love that title). basicly if i book is going to force you to use microsofts api's or AP headers its not a good book, since you will find that once you try to make a program with out them you have to relearn all the api calls.

The issue with .NET is the issue with many things: it takes time out of learning, but the loss of power will bite you in the ass eventually. You can get simple GUIs up and running quickly with VB and its many ActiveX controls, but once you run into the crippling deficiencies of the language (I'll admit, my experience is with VB *6*), you'll spend far more time trying to find workarounds. And the result, a complicated, Frankenstein's monster of an app held together with string, is going to be a nightmare to maintain.

As Sithlord suggests, it's far easier to move from generic, vanilla C++ for *nix platforms to MS stuff than the other way around.

Here's an analogy for you. It's like the difference between relying on Lattimore's translations of Agamemnon rather than reading the originary Greek (or at least cribbing from Loeb with a Greek dictionary, in my case). Sure, you'll get a basic essay that covers some trivial points early on, but you'll miss the power soon enough. Lattimore's translation will never teach you about dike. It never marks up Agamemnon-as-sacrifice, and it butchers Cassandra. And unless you understand them, your essay is mid 2:2 standard at best. Thus with C# and the like.

Quote
for wii homebrew get devkitpro, and learn C not c++ most of the wii stuff is done in C. (very similar to C++ but lacking some features of C++)

C++, to make clear, is just a superset of C. C code works in C++, but C++ adds new features (which you could often define in C libraries yourself anyhow).

Quote
p.s for gfx don't bother w/ directX again unless you only want to code for windows , learn openGL

It also helps that the industry by far prefers to work with openGL. Want to write for Nintendo or Sony hardware? Good luck with DX. openGL will also open up idTech engines etc, as id and most other FPS devs by and large prefer it as a platform.

Of course, it's also well-known that DX tends to be 18 months behind OGL from a technological standard. There's really few compelling reasons to choose DirectX, unless you specifically want to write for the XBox 360.

Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Re: So, I'm learning C++...
« Reply #14 on: 2010-06-16 18:46:19 »
my main goal, is to be able to write Wii Homebrew, tbh =p

That's a good goal, better would be making a Wii game for WiiWare maybe but it's still a good start, hold on to it and you'll succeed.

Yeah, that's not exactly going to happen, I don't have a dev studio, nor do I have X amount of experience, or Y amount of people.  Nintendo is stupid strict like that.

sithlord48

  • *
  • Posts: 1634
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: So, I'm learning C++...
« Reply #15 on: 2010-06-16 20:03:20 »
my main goal, is to be able to write Wii Homebrew, tbh =p

That's a good goal, better would be making a Wii game for WiiWare maybe but it's still a good start, hold on to it and you'll succeed.

Yeah, that's not exactly going to happen, I don't have a dev studio, nor do I have X amount of experience, or Y amount of people.  Nintendo is stupid strict like that.

i completely agree, nintendo is crazy w/ that stuff i once called them (for fun)and asked what i needed to write software for my ds legally and distrubite it. (where i started w/ devkit) and they told me i have to have working software for there system before i would even be able to be considered to code for their platform. then depending on my businesses financal situation they would then consider giving access to the tools needed.of course after i had paid for it. oh and fyi guys wii homebrew is the best homebrew for any system. the power of the wii is really in the homebrew, not the games.

m35

  • *
  • Posts: 52
    • View Profile
    • jPSXdec
Re: So, I'm learning C++...
« Reply #16 on: 2010-06-16 20:19:27 »
REAL MEN don't touch any other programming language until they have read SICP and mastered LISP ;)

I would never recommend anyone learn C++ as an introduction to programming, nor would I recommend it as an introduction to OOP. Nearly all the basic concepts can be learned in other languages, without the extra complexity C++ requires you to deal with.

Additionally, if you're fairly new to programming, issues such as vendor lockin, proprietary standards, marketability, language flexibility, etc. aren't going to be things you have to worry about anytime soon.

For anyone's first language, I suggest you start with whatever is easiest to pick up--or what meshes best with you (for me is was Borland Turbo Pascal oh some 15 years ago). It doesn't really matter how popular or practical it is, just so long as you enjoy working with it. Most people like to see output as quickly as possible, so maybe C# or VB.NET would be good choices.

If you already have a little programming experience, then maybe understanding the basics of OOP would be the next step. In that case Java, C# or VB.NET are all much simpler introductions to such concepts.

My suggestion is to learn C++ only after you've established a nice foundation of programming and OOP basics, because you'll spend more time battling the idiosyncrasies of C++ and learning its 'best practicies' (so you don't shoot yourself in the foot with the language) than actually learning much about programming.

sithlord48

  • *
  • Posts: 1634
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
Re: So, I'm learning C++...
« Reply #17 on: 2010-06-16 21:28:51 »
Additionally, if you're fairly new to programming, issues such as vendor lockin, proprietary standards, marketability, language flexibility, etc. aren't going to be things you have to worry about anytime soon.

i feel this is the time when vendor lockin happens the most when people start with vC++ or C#.

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: So, I'm learning C++...
« Reply #18 on: 2010-06-16 23:08:22 »
REAL MEN don't touch any other programming language until they have read SICP and mastered LISP ;)

I would never recommend anyone learn C++ as an introduction to programming, nor would I recommend it as an introduction to OOP. Nearly all the basic concepts can be learned in other languages, without the extra complexity C++ requires you to deal with.

Additionally, if you're fairly new to programming, issues such as vendor lockin, proprietary standards, marketability, language flexibility, etc. aren't going to be things you have to worry about anytime soon.

For anyone's first language, I suggest you start with whatever is easiest to pick up--or what meshes best with you (for me is was Borland Turbo Pascal oh some 15 years ago). It doesn't really matter how popular or practical it is, just so long as you enjoy working with it. Most people like to see output as quickly as possible, so maybe C# or VB.NET would be good choices.

If you already have a little programming experience, then maybe understanding the basics of OOP would be the next step. In that case Java, C# or VB.NET are all much simpler introductions to such concepts.

My suggestion is to learn C++ only after you've established a nice foundation of programming and OOP basics, because you'll spend more time battling the idiosyncrasies of C++ and learning its 'best practicies' (so you don't shoot yourself in the foot with the language) than actually learning much about programming.

But which, in your opinion, is the best to start learning OOP? Java has the advantage of being a decent language to learn in its own right...

titeguy3

  • *
  • Posts: 1283
  • A jack of all trades
    • View Profile
Re: So, I'm learning C++...
« Reply #19 on: 2010-06-16 23:25:51 »
C++ is a great place to start learning programming. However, to learn proper Object Oriented Programming, it's not very seamless. I'd recommend starting with C++ to get a handle on the basics, then transition to Java to learn proper OOP.

m35

  • *
  • Posts: 52
    • View Profile
    • jPSXdec
Re: So, I'm learning C++...
« Reply #20 on: 2010-06-17 05:10:36 »
REAL MEN don't touch any other programming language until they have read SICP and mastered LISP ;)

I would never recommend anyone learn C++ as an introduction to programming, nor would I recommend it as an introduction to OOP. Nearly all the basic concepts can be learned in other languages, without the extra complexity C++ requires you to deal with.

If you already have a little programming experience, then maybe understanding the basics of OOP would be the next step. In that case Java, C# or VB.NET are all much simpler introductions to such concepts.

My suggestion is to learn C++ only after you've established a nice foundation of programming and OOP basics, because you'll spend more time battling the idiosyncrasies of C++ and learning its 'best practicies' (so you don't shoot yourself in the foot with the language) than actually learning much about programming.

But which, in your opinion, is the best to start learning OOP? Java has the advantage of being a decent language to learn in its own right...

I think it depends on exactly what you're looking to learn and do. If you want to just get stuff working, then perhaps C# and VB.NET would be better. They are generally more lenient and flexible than Java in OOP design patterns (some might say that is a bad thing). If you are wanting to take a more disciplined and correct/rigid approach, then Java is probably the way to go.

Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Re: So, I'm learning C++...
« Reply #21 on: 2010-06-17 08:16:12 »
my main goal, is to be able to write Wii Homebrew, tbh =p

That's a good goal, better would be making a Wii game for WiiWare maybe but it's still a good start, hold on to it and you'll succeed.

Yeah, that's not exactly going to happen, I don't have a dev studio, nor do I have X amount of experience, or Y amount of people.  Nintendo is stupid strict like that.

i completely agree, nintendo is crazy w/ that stuff i once called them (for fun)and asked what i needed to write software for my ds legally and distrubite it. (where i started w/ devkit) and they told me i have to have working software for there system before i would even be able to be considered to code for their platform. then depending on my businesses financal situation they would then consider giving access to the tools needed.of course after i had paid for it. oh and fyi guys wii homebrew is the best homebrew for any system. the power of the wii is really in the homebrew, not the games.

To me, the Wii is just such an interesting platform, in the way that it runs (the whole IOS thing intrigues the fuck outta me).  However, I will say the Wii is better than most people think, because there is a SHITLOAD of shovelware, but there is equally a good deal of good games, you just have to look for them.  That being said, the homebrew is just amazing, but the same thing applies, there's a lot of shit as well.