Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: starting coding in C++  (Read 1722 times)

greatorder

  • Guest
starting coding in C++
« on: September 15, 2011, 03:59:14 pm »

I'm thinking of starting coding in C++

I want to use it as an extra curricular activity (if you have no idea what that is, look it up :P) and I want (to start off) something easy to do. any ideas on what I could do? in the end I want to be able to make at least simple games.

also, don't expect replies for about 19 hours after this post, my brother's on the internet and I have school tomorrow :(
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: starting coding in C++
« Reply #1 on: September 15, 2011, 04:08:38 pm »

The simple program you want to make is called "Hello world!", try looking that up.

Sidhien

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #2 on: September 15, 2011, 09:16:43 pm »

XD I think he means something a bit more advanced than that.

My first project was a simple text based game where you could move around from zone to zone and interact with objects. That's good for getting started, and once you're comfortable with basic programming you can try some OpenGL tutorials for making graphical games.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: starting coding in C++
« Reply #3 on: September 15, 2011, 09:19:23 pm »

Eh, I always make one to test out the environment. Never hurts to know everything is running like it should.

Sidhien

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #4 on: September 15, 2011, 09:22:18 pm »

Same, but I'm guessing he was wanting more of a long term goal type of thing than a quick program.
Logged

RulerOfNothing

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #5 on: September 15, 2011, 09:57:51 pm »

If you want something to do in C++, you could always join Project Euler and try to solve the problems there.
Logged

Muz

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #6 on: September 16, 2011, 04:24:50 am »

I learned quite a bit from these lecture videos:
http://www.youtube.com/watch?v=hE7l6Adoiiw&feature=results_main&playnext=1&list=PL6B940F08B9773B9F

Great lecturer, it also teaches you more on coding in general than simply C++. It's an ivy league level start-up course for computer science majors, but easy enough that non-computer scientists can pick it up. The MIT/Stanford lectures on programming have more views, but I like Buckland's lectures because they have a lot of humor, as entertaining to watch as an educational documentary.
Logged
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Stargrasper

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #7 on: September 16, 2011, 10:13:50 am »

My favorite (unexpectedly involved) project when playing with languages is to write a simple calculator.  If you do this on the command line, you'll have to practice parsing strings (or possibly char arrays).  If you do it with a GUI, you'll have to practice events (like button presses).  And if you're ambitious, you'll implements a GUI that allows you to type as well.  If you're feeling really ambitious, make it respect order of operations.

Even if all you do is a four-function calculator, the project is surprisingly involved for a new programmer to accomplish, but you'll learn quite a bit doing it.
Logged

Stargrasper

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #8 on: September 17, 2011, 10:16:30 am »

My favorite (unexpectedly involved) project when playing with languages is to write a simple calculator.  If you do this on the command line, you'll have to practice parsing strings (or possibly char arrays).  If you do it with a GUI, you'll have to practice events (like button presses).  And if you're ambitious, you'll implements a GUI that allows you to type as well.  If you're feeling really ambitious, make it respect order of operations.

Even if all you do is a four-function calculator, the project is surprisingly involved for a new programmer to accomplish, but you'll learn quite a bit doing it.
so doing this is very useful for learning a languagem then?

I think so.  If you've never done anything with programming before, this has potential to be an awfully hard project.  Admittedly, this might be a bit beyond your skill level, but I feel you'll progress faster if you have a legitimate challenge, as opposed to a whole bunch of tutorials.

This calculator I'm suggesting...obviously there's more than one way to pulling it off.  But every way I can think of pretty well forces you to utilize the fundamentals of the language and programming in general.  And if you find it's a bit difficult, shelve it for a week.  Figure out what it is has got you stuck, and write a mini-program to teach yourself that function.

You don't have to write a calculator.  I'm just suggesting it because it's a challenging project.  But as I said, it might be a bit beyond your skill level.  Just pick a project more in line with what you understand if that's the case.  I'm big on learning by doing, so I believe a great way to learn a language is to pick a challenge and attack it.  Ideally, your challenge should be both challenging and utilize the specific skills you want to practice.  In your case, this is the basic fundamentals of programming.

I know you said you wanted to do a game, but realistically, I feel like that's just beyond your skill level if you're as new to programming as you said you were.  You'll get there...but that'll be project number five or ten, not number one.  Work your way up with practical programs and you'll get to the fun ones in due time.

EDIT: I should note that I've never done this particular project in C++.  I do have a pretty good idea how I'd do it, but I haven't actually done it.  I've focused on other projects when it comes to C++, but I see no reason this should stop you.

Also, C++ is a bit of a challenge for a new programmer.  You'll learn a lot doing it, but it'll be hard.  You could consider learning programming with Java or Python and then come back to C++ when you understand programming in general a bit better.  I am getting the right impression from you posts that you have zero programming experience, right?
« Last Edit: September 17, 2011, 11:26:17 am by Stargrasper »
Logged

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: starting coding in C++
« Reply #9 on: September 20, 2011, 12:30:05 pm »

I've yet to delve into C++, but I have tooled around with C lately (been using Java for quite a few years though).

The only really tricky bit is pointers: that stopped me dead several times before. This last time it clicked pretty easily (to the point that I thought "what was so hard about this?")

From what I've heard C++ is a whole new can of worms though... I'll probably look into it eventually.

The most important thing: don't give up!
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

Stargrasper

  • Bay Watcher
    • View Profile
Re: starting coding in C++
« Reply #10 on: September 20, 2011, 05:58:29 pm »

I encourage you to dive in and just ask when you have questions.  I like to have a project and learn while doing that, but if that's not your style, do what helps you.  You should be able to learn to eventually solve problems yourself, but if you aren't there yet, then feel free to ask for help.  You may have seen what I did for that Java thread recently.  There's no particular reason we can't do that for you.  My life is getting a bit hectic, but I can still stop in and try to give detailed help from time to time.  I'm also quite sure others would.  Or if you're feeling ambitious, find a programming-centric forum to go to.

As already said, the most important thing is to not give up.  Decide you're going to do something and then actually do it.
Logged

Heron TSG

  • Bay Watcher
  • The Seal Goddess
    • View Profile
Re: starting coding in C++
« Reply #11 on: September 21, 2011, 08:30:38 am »

Ivor Horton's Beginning Visual C++ is a really good book, but you'll need to know the basics of how most coding languages operate first. Being able to read binary is also a plus.
Logged

Est Sularus Oth Mithas
The Artist Formerly Known as Barbarossa TSG

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: starting coding in C++
« Reply #12 on: September 21, 2011, 08:43:06 pm »

Being able to read binary is also always a plus.

;)
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

Angle

  • Bay Watcher
  • 39 Indigo Spear Questions the Poor
    • View Profile
    • Agora Forum Demo!
Re: starting coding in C++
« Reply #13 on: September 21, 2011, 11:11:03 pm »

Heres a site I found helpful.

learncpp.com
Logged

Agora: open-source platform to facilitate complicated discussions between large numbers of people. Now with test site!

The Temple of the Elements: Quirky Dungeon Crawler