Re: C++
Posted by Crono on
Wed Jul 4th 2007 at 10:42am
Posted
2007-07-04 10:42am
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
Attempted and conquered. I'm almost done with my Computer Science degree as well. I've been using Java more than anything else lately though.
If you don't know ANY programming language ... C++ is NOT what you want to start with. Especially if all you have is a book (which is most likely not even written well, since 98% or so of C++ books, specifically, are actually incorrect in many aspects of the language).
I would suggest starting with something more simple that has similar or identical syntax ... like PHP. Using something like Java would allow you to learn how to use objects and things like that without worrying about memory management. (The most common errors stem from poor memory management).
Also be aware that when regarding C++, there's a different between "C++" and "Visual C++", the latter being Microsoft's significantly altered version of the language, which I do not suggest using to start out with. It will do nothing but make you an even worse programmer.
As far as programming goes, in general, you really should learn the semantics of programming before jumping into (like, how languages generally work and what data structures are and how they're important. Otherwise there's no way in hell you'll be able to pick up someone else's code and read it), arguably, the most difficult language around.
And if you think you're just going to learn this and jump over to work on some half-life mod code ... well ... good luck, you'll need it.
Blame it on Microsoft, God does.
Posted
2007-07-04 11:08am
1260 posts
345 snarkmarks
Registered:
Apr 7th 2002
Occupation: post-student
Location: Connecticut (sigh)
I make a terrible C++ coder. I took Comp Sci in college and I'd
understand the algorithms, but I just can't sit down and code. I
lose sense of what I'm doing, forget all my commands and make stupid
mistakes that constitute big errors. Also, I find it
boring.
That said, I find I'm pretty decent with highly constrictive
object-oriented coding. Hypercard, Visual Basic, Standard HL
Entities... I once made Tic-Tac-Toe as a CS map. You'd play
the game by shooting at a grid and then it would kill the loser.
Granted, it was STUPID and a completely backass way to play Tic-Tac-Toe
(aka Naughts and Crosses you silly limeys) so after a small prime
number of games between myself and my roommate I nuked it. It was excellent entity practice though.
Basically, I like trying to break constraints. C++ doesn't really
have that many. Halflife has a ton, but they're breakable.
Re: C++
Posted by BlisTer on
Wed Jul 4th 2007 at 1:59pm
BlisTer
member
801 posts
1304 snarkmarks
Registered:
Jun 10th 2004
Location: Belgium
I followed 2 classes of Java in uni. I understood it quite well back then, with the hardest program i wrote something that used backtracking.
I forgot most of it, untill i started fiddling with LUA scripting for HL2 last month. It proves the object-oriented approach really sticks :wink:
Re: C++
Posted by G.Ballblue on
Wed Jul 4th 2007 at 6:25pm
1511 posts
211 snarkmarks
Registered:
May 16th 2004
Occupation: Student
Location: A secret Nuclear Bunker on Mars
The best bit of help I can suggest would be to, like what Crono said, start with something a bit easier. Visual Basic .Net is what I learned/am learning first. It's not any where near the realm of C++, in terms of complexity and power, and it shows you that even writing a smiple data base program can be a real mind f**k at times.
Breaking the laws of mapping since 2003 and doing a damn fine job at it
Re: C++
Posted by Crono on
Wed Jul 4th 2007 at 11:05pm
Posted
2007-07-04 11:05pm
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
Introductory purposes? Boolean Algebra and Logic?
The entire point of learning a high level language as a beginner is so you don't need to focus on those things. (However, knowing the terminology of how memory works is recommended)
But actually knowing how gates work and arithmetic in various number bases is really not needed. Knowing those things wont actually make you a better programmer, though you may become more aware of memory use, but that can be leaned without knowing the ins and outs of how the hardware works. Okay, so, if you're making an AI agent for some game it would be nice if you know how to get your entire state space to be stored in cache since you're going to be working with an enormous branching factor and want to stay away from memory ... but that's hardly introductory.
Leaning these things from the start would probably make things much more difficult, since you wouldn't have any frame of reference. Generally, when you learn about how the hardware works you can relate it to what you know about your programming language. If it's C or C++ then that makes a pretty nice connection, since you're actually dealing with memory there.
To be honest, programming in Java is even easier if you have reference to a programmer memory control language like C++. It allows you to understand how to use Java more efficiently.
Anyway, I wouldn't, personally, suggest jumping into any hardware architecture stuff until you at least know one language and general programming ideas (for starters it's much easier to learn boolean operators at that level)
Blame it on Microsoft, God does.
Posted
2007-07-05 12:43am
1260 posts
345 snarkmarks
Registered:
Apr 7th 2002
Occupation: post-student
Location: Connecticut (sigh)
I miss the days when everyone's first language was BASIC.
Re: C++
Posted by Yak_Fighter on
Thu Jul 5th 2007 at 1:26am
1832 posts
742 snarkmarks
Registered:
Dec 30th 2001
Occupation: College Student/Slacker
Location: Indianapolis, IN
I took two years of computer science and all I remember is
cout >> "Hello World";
I did make a kickass poker game in collaboration with a much better coder though, he did all the mechanics and I made the debugger and the AI, which had five different skill levels and would randomly select which to use in order to give the game some variety :cool:
Re: C++
Posted by G.Ballblue on
Thu Jul 5th 2007 at 2:33am
1511 posts
211 snarkmarks
Registered:
May 16th 2004
Occupation: Student
Location: A secret Nuclear Bunker on Mars
The most impressive thing I've done with VB.Net was a space invaders game. My instructor actually got the best sample of the source code I had, since I turned it into him with a few improvements that I had made that morning.
I've actually got the thing on my hard drive; at some point, I should see what I could do with it. I always wanted to try and add some movement into the game, like the classicial space invaders games, such as Gorf.
Breaking the laws of mapping since 2003 and doing a damn fine job at it
Re: C++
Posted by mazemaster on
Thu Jul 5th 2007 at 3:40am
890 posts
438 snarkmarks
Registered:
Feb 12th 2002
If you just want to be able to hack some things together, then just learning a single language like java or c++ or whatever will be fine. However, if you want to gain greater understanding and become a "good programmer", it is useful to learn several different types of languages. Even if you never use the crazy ones again, just knowing them will make you a better programmer in your language of choice.
Preferrably learn 1 from each of these 5 categories:
1) Object-oriented (C++, java, etc)
2) Functional (scheme, lisp, etc)
3) Declarative (prolog, etc)
4) Assembly (any will do)
5) Array/math based (Matlab, GNU Octave, etc)
Re: C++
Posted by Crono on
Thu Jul 5th 2007 at 7:09am
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
The book is talking about inheritance at the same time as comments? ... I do not recommend this book. Next it probably suggests to use templates whenever possible and discusses operator overloading in great depth before discussing pointers, classes, or structures.
Blame it on Microsoft, God does.
Posted
2007-07-06 12:48am
1260 posts
345 snarkmarks
Registered:
Apr 7th 2002
Occupation: post-student
Location: Connecticut (sigh)
QuArK's in Python. It's why they've been able to have so many user-created addons.
Re: C++
Posted by Yak_Fighter on
Fri Jul 6th 2007 at 6:46am
1832 posts
742 snarkmarks
Registered:
Dec 30th 2001
Occupation: College Student/Slacker
Location: Indianapolis, IN
its red cause he's just that damn cool
Re: C++
Posted by Crono on
Fri Jul 6th 2007 at 7:37am
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
If you want a pretty end all be all well explained wonderfully written (and correct) book on the actual C++ language, when you're ready, seek out C++ Primer Plus by Prata. I think it's in like the sixth or seventh edition. As far as I can tell the newer editions only add some explanation of newer standards and cost a great deal more. I think the current edition runs for almost $60 and I bought mine (3d edition) for $35. If you live anywhere near a college campus take a trip to their book store and you'll find more books (at an okay used price, if they have some used copies) than you can shake a stick at.
The great thing about the book is it goes about as deep as Stroustrup's books (primary designer/creator of the C++ language) but is far simple to understand. From what I've heard, his book is incredibly complicated and difficult to understand ... for people who've been using the language professionally for over a decade. Yikes.
Aaron, I would suggest ignoring the rest of this post. It might scare you away from programming.
Omegaslayer:
In general, I would recommend against using templates. Why you ask? Because you can't possibly guarantee what a template guarantees. It says "Any data type that can be created from now to the end of time can be used with this template" ... and there's no way IN HELL you can guarantee that because it encompasses user defined data types.
Now, of course, if you're very experienced and you just don't want to write yet another binary tree ... then by all means use the template in the STL, but in general ... they're really just not implemented properly. The reason why is because C++ is not inherently an object oriented programming language. It's C with a bunch of stuff on top. Now a language like Java is designed for that type of thing, which is why it's pre-made structures DO work for most all objects and the portions that you need to define for your class are, most generally, abstract and need to be overloaded locally.
In addition, most people just plain use templates when you don't need them. Templates are really something you should learn after you know the ins and outs of the language and can build these structures on your own (not to mention building a complete binary search tree with hash table nodes will teach you much of what you need to know about pointers)
Blame it on Microsoft, God does.
Re: C++
Posted by Crono on
Fri Jul 6th 2007 at 7:03pm
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
Something else I forgot to mention.
You'll want to pick up a Data Structures book at some point (or else you wont know what to do with your newly created data).
The book I have is okay. It's better than most, but you could probably do better. What you want to stay away from are books that say use templates for everything (which is much more predominant in data structure books) and I already explained why that's a bad idea.
Blame it on Microsoft, God does.
Re: C++
Posted by Crono on
Sat Jul 7th 2007 at 7:11am
Crono
super admin
6628 posts
700 snarkmarks
Registered:
Dec 19th 2003
Location: Oregon, USA
Well, if you can get the data sorted in a binary structure that's best since you got that gorgeous O(lg n) time complexity. Merge sort is better all-around though, for most situations. :smile:
I learned C++ when I stated by degree, and I've been doing that for awhile. I took is slow for a couple years and only recently (last two or three years) really started taking heavier course loads. But, six years.
But, I'll tell you that the actual act of learning C++ was the easiest and least important part of my degree and programming in general. Design is where it's at, if you can't do that, you can't do s**t (I've ran into many people like this and it always astonishes me that you'd get this degree specifically to get a job as a code when your skill set allows you to do things far more interesting and rewarding). You're basically an assembly line worker who can code other people's designs, which is boring and often times very frustrating. After all the entire point of learning programming methodology and languages is to solve problems. If someone learns "to code" just so they can, it's a horrible and completely useless reason, and their skills will be in the same shape, most likely.
Blame it on Microsoft, God does.