Programming

Luckymoose

The World is Mine
Joined
Jan 15, 2006
Messages
18,357
Location
Get Back
I'm in the process of teaching myself C++ and so far the text I'm using is really well done. I've been at it for a day now and gone through the first couple chapters and can say that I can mess around with a calculator with basic functions but not much else yet. Is there anyone else here who programs that could offer some advice on how to adapt my brain to thinking in C++? I find the hardest thing for me to do is not remember what things do but to remember all the little semicolons, spaces, colons, etc. I'm just looking for ways to help myself think in programming as that is the easiest way to transition.
 
Do not forget to count your {'s and }'s. And the ; is king. When you get a compiler error, first thing you do, make sure you didnt miss a brace or a semicolon. And with braces, sometimes it isn't really apparent that it's causing the error.
 
I'm in the process of teaching myself C++ and so far the text I'm using is really well done. I've been at it for a day now and gone through the first couple chapters and can say that I can mess around with a calculator with basic functions but not much else yet. Is there anyone else here who programs that could offer some advice on how to adapt my brain to thinking in C++? I find the hardest thing for me to do is not remember what things do but to remember all the little semicolons, spaces, colons, etc. I'm just looking for ways to help myself think in programming as that is the easiest way to transition.

I don't know that I'd use a book as my primary teaching resource.

If it were me, I'd look up an intro programming (which happens to use c++) course at a university which has all the course material online, and follow through that, using the book as a resource if I needed help with anything.
 
I learnt how to program C++ on the job.

All the people fresh out of university I have met had no idea how to debug, until taught.

EDIT: What book are you using? Hopefully not one by Herb Schildt

http://www.jargonwiki.com/wiki/Bullschildt
 
I find the hardest thing for me to do is not remember what things do but to remember all the little semicolons, spaces, colons, etc.

Practice, practice, practice. Oh, and practice some more.

Do yourself a favor and start with a good IDE like Visual Studio from the beginning. Syntax highlighting, brace matching and so on will help catch some of the syntax errors, and when you start having to diagnose problems in your programs (it won't be long) you can get a head start on learning to use a debugger.
 
I learnt how to program C++ on the job.

All the people fresh out of university I have met had no idea how to debug, until taught.

EDIT: What book are you using? Hopefully not one by Herb Schildt

http://www.jargonwiki.com/wiki/Bullschildt

I'm using C++ How To Program, 7th Edition. As for the online courses thing, I think I'm going to just minor in Computer Science when I go back to college in spring. I'm using my vacation time to get some learning in. I will be joining that group in hopes that questions I might ask can be answered.
 
I'm in the process of teaching myself C++ and so far the text I'm using is really well done. I've been at it for a day now and gone through the first couple chapters and can say that I can mess around with a calculator with basic functions but not much else yet. Is there anyone else here who programs that could offer some advice on how to adapt my brain to thinking in C++? I find the hardest thing for me to do is not remember what things do but to remember all the little semicolons, spaces, colons, etc. I'm just looking for ways to help myself think in programming as that is the easiest way to transition.

The semicolons, braces and etc will come with time. My first couple weeks programming way back when I too forgot all the little bits, but eventually it became second nature. I do still miss them occasionally, but thats more so cus I thought I typed them when I didnt.

Along with the suggestion of a good IDE (even if its basic) I reccomend finding a project you want to do. This is especially important if you're learning on your own. Its all too easy to get bored and drop it, or trudge through like a chore. Learning to program should be more fun imho. With all that said, dont pick something too ambitious at first. Simple little apps that would be interesting to do.
 
I will be joining that group in hopes that questions I might ask can be answered.

Well, depending on your school you might run into limits if you're seeking C++ specific help. Many schools tend to focus more on higher level and easier to learn languages like Java and Python.

One thing to bear in mind too with C++ - it's probably the most complex commonly used programming language, and can really be an ungodly beast to use well. As such there are reams and reams of articles and guides out there that give horrible advice pertaining to C++. If you're going to go looking for C++ help and advice, become familiar with sites that are frequented by professionals who know what they're talking about; sites like Codeguru, DreamInCode, GameDev.net, etc.
 
I've always heard that C++ is the most powerful language to use. Is Java just as powerful? Wasn't Civ 4 made with Python?
 
My one piece of advice is to do exercises from the book as practice.

I've always heard that C++ is the most powerful language to use. Is Java just as powerful? Wasn't Civ 4 made with Python?
All major languages are powerful. C++ has the advantage that at performance critical sections, it gives you the most fine control, excepting assembly, while still being a high level OOP language. There are other advantages and disadvantages, but Java and C++ are pretty comparable. That said, C++ does happen to be my favorite language.

C++ is the hardest commonly used language to start with. It has a very steep learning curve. Unless you have a specific reason you want to learn C++, I don't recommend starting with it. Java and Python are good starting languages. C#'s not bad either, from what I've heard. You can learn C++ later.

Civ 4, as far as I know, was written in C++ and Python both, with all performance critical portions written in C++.
 
I'm starting with c++ because it's the hardest while at the same time being the most used. I don't have trouble with learning curves and whether I learn it nor or later I'll still have to learn it. Besides once I get the basics down for c++ other languages won't take nearly as much work to learn.

As for practicing I have been using stuff I learned so far to make similar programs from scratch to keep my memory fresh on what everything does. Like a simple calculator without looking back at the book. I've only been at it a good day now so I will eventually understand everything. I have a goal of being somewhat competent in it by New Years. Not a master but atleast able to do things without always consulting a book.
 
I still have to consult a book to look up something about C++, and I've been a professional C++ programmer for at least 10 years now. It really is a complicated beast.
 
I've been doing some research on languages and while learning C++ is fun and exciting. I'm seeing some issues with it that maybe I shouldn't start with it? I don't want to be limited in my future programming by choosing Python or something like that as a first language. I keep reading that Python is slow and I would hope that it is atleast somewhat powerful. I'm not major software developer and probably never will be but if I want to make basic programs in the say next 6 months should I take up Python first? I would really like someone who knows about the languages to compare them and let me know what is a good course of action. Maybe it's just the classes in C++ that are twisting my mind up. :lol: ;
 
Python is a powerful language and easy to learn.

Speed isn't going to be a concern unless you want to start off writing games. Learn the basics of programming first.

However, if your long term aim is C++, I'd either stick with it, or start with Java or C#, which are quite similar and will provide a good basis for OOP.

C# doesn't have many good online tutorials though.
 
Is the speed issue really that noticeable between the languages? From my hour of research on Python it seems to be an ever evolving and improving language. So perhaps it wouldn't be such an issue in a few versions? Any game I would make wouldn't be hardcore enough, I'd hope, to need the tiniest amounts of fine tuning that C++ offers. Now I do plan to learn C++ eventually, but perhaps to get more immediate results and fun factor Python is the superior option? I'm sure learning one language greatly affects the ability to learn a second.
 
Don't worry about speed when learning.

Python is good, but Java and C# are more similar to C++ than Python is.
 
Yeah it is.

EDIT: Most languages are easier to learn than C++ ;)

C allows you to shoot yourself in the foot, C++ allows you to blow your whole leg off, and reuse the bullet.
 
It will never make sense to me why they won't just make a new language just a powerful as C++ but vastly easier to grasp and use. It would really improve everything. I'm going to continue fooling around with C++ and Python. Seeing which one flows better for me.
 
Back
Top Bottom