Sign in to follow this  
wwx

Hello. I'm oldschool and this is my story.

Recommended Posts

I just wanted to say hi to everyone at gamedev.net. I've been a bit of a lurker for a long time here. The past year I had many life changing things going on and backed off of game programming for a bit. Now I'm back and ready to get started. I'm an old school top down kind of guy, always have been and probably always will be. I know we live in an object oriented world but, when you grew up learning BASIC on a Commodore Vic 20, at the impressionable age of 9, your brain's wiring becomes soldered all together to work one way. I've been into BASIC all my life but, never was much of a programmer. I just dabbled in it for a long time, just learning enough to write some simple programs like text based games, calculators, and database type stuff I picked up in school. Although I did spend some time with blitz basic and completed a few old school graphical games I never got much further into programming. Time moved on and I ended up getting a degree in music of all things, got a job in the telecommunications industry, became good at trouble shooting and building computers, built a few websites for fun, and eventually got back into programming. I decided to try and move on to C++ but, being old school like I am, I got really confused with the Object Orientation stuff and coming from BASIC C++ was a much more complicated language to decipher. I tried many different books, read many forums and tutorials online but never really got it. I decided to just take a break from learning to program and re-teach my brain how to learn. I know that might sound strange but, I had developed bad study habits, had a lack of patience, kept trying to associate C++ with BASIC, and I never really took the time to fully understand what I was reading. Finally, I've arrived and I'm ready to do this. My goal is to understand C++ enough to make a 3D game engine, or at least make a fully functional 3D game of my own so I can re-use the code in it to make even more games. First thing is first though, so it looks like I won't be programming any type of game at all until I get more of this C++ learned. Since I think a bit different than most people finding the right kind of teacher has been a bit difficult but, I just picked up "Sams Teach Yourself C++ in One Hour a Day" and I'm loving it so far. I'm in chapter 5 right now and haven't had any problems in fully understanding everything so far. I'm sure there are other books out there, I probably own most of them but, for me, at this moment in time, I've got the right book. At the moment I'm using Code Blocks for the compiler but, I read that either DJGPP or Microsoft Visual C++ would be a better choice. I'm actually still not sure what to use as I want something that is fully ANSI compliant so I won't have any problems learning with my new book. I also want something that is easy to set up and configure when I decide to move to graphics and sound so, perhaps MS Visual C++ is the way to go in the long run. Then again, the thought of open source and platform independent makes me want some kind of G3D/OpenGL/SDL/GNUC++/Amalgamation that isn't going to take a rocket scientist to assemble together. Well, my tooth is starting to hurt again and my meds are wearing off so I better wrap this up. If anyone has any thoughts, comments, recommendations, etc feel free to send them my way. Until my next post, farewell.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
Any particular reason you're fixated on C++?


That's a great question and I actually do have somewhat of an answer.

-For one, it's a challenge for me. Going from a relatively easy language to one that has a higher degree of difficulty will give me a big sense of accomplishment.

-From what I've read C++ sounds like an extremely flexible language. If I'm going to spend a great amount of my time learning something at my age I want to learn a language I can always use.

-It runs fast. Going by the research I've done, C++ produces very fast running code. This is a good thing for someone like me as I don't consider myself skilled enough to think of the most efficient way to program.

-lots and lots of resources. I don't think I'll have any problems finding help on the subject of C++.

I suppose those are a few reasons. There's other languages I'd like to learn, such as Python, and other languages I do know a little about, like Fortran and Cobol, from my college days. I guess C++ just sounds like something that would really fit the bill for me. It sounds like a well rounded language. And learning it should make learning other languages that much easier too.

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
when you grew up learning BASIC on a Commodore Vic 20, at the impressionable age of 9, your brain's wiring becomes soldered all together to work one way.
Hmm well I disagree, I was programming my Commodore 64 at the age of 4. Synaptic pathways are definitely strengthened but that doesn't prevent you picking up other programming paradigms along with or on top of any existing ones you're already comfortable with.

Quote:
coming from BASIC C++ was a much more complicated language to decipher.
Aye, C++ is a far vaster language than conventional BASIC with many more pitfalls and rife with undefined behaviour. I don't doubt there's a good reason why the B stands for Beginner's [smile]

Quote:
I never really took the time to fully understand what I was reading.
That's the real problem I guess, give it time and you'll get it. C++ requires more time than most language to pick up mind you.

Quote:
At the moment I'm using Code Blocks for the compiler but, I read that either DJGPP or Microsoft Visual C++ would be a better choice.
I don't know about a 'better' choice, but certainly a different one.

Quote:
I'm actually still not sure what to use as I want something that is fully ANSI compliant so I won't have any problems learning with my new book.
One of the side effects of C++ being so damn complicated as a language is that compilers themselves struggle. This is such a problem in fact that I am not aware of any compiler that is 100% compliant, they all have unique little niggly bits where they don't do what the standard says they should do. As a result, the best advice is to choose a modern compiler and don't worry about it - unless you're dealing with the more advanced aspects that aren't wells supported or just not overly portable, but that's not very likely.

Quote:
perhaps MS Visual C++ is the way to go in the long run.
The choice is yours. It's the compiler I use and I think the IDE is great, I don't develop for other platforms but I do keep my code standards compliant so I shouldn't have much problem porting it to another compiler should I ever want to.

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
Quote:
Original post by Promit
Any particular reason you're fixated on C++?


That's a great question and I actually do have somewhat of an answer.

-For one, it's a challenge for me. Going from a relatively easy language to one that has a higher degree of difficulty will give me a big sense of accomplishment.

-From what I've read C++ sounds like an extremely flexible language. If I'm going to spend a great amount of my time learning something at my age I want to learn a language I can always use.

-It runs fast. Going by the research I've done, C++ produces very fast running code. This is a good thing for someone like me as I don't consider myself skilled enough to think of the most efficient way to program.

-lots and lots of resources. I don't think I'll have any problems finding help on the subject of C++.

I suppose those are a few reasons. There's other languages I'd like to learn, such as Python, and other languages I do know a little about, like Fortran and Cobol, from my college days. I guess C++ just sounds like something that would really fit the bill for me. It sounds like a well rounded language. And learning it should make learning other languages that much easier too.

C++ can also be quite frustrating and confusing, as it sounds you already found out, if you don't have the right teacher or book.
With computers being faster everyday speed shouldn't be as big of a concern anymore unless you plan on making a ray-tracing 3D engine?
And with multicore cpu's nowadays Java and other languages built with concurrentcy in mind can actually be faster in some scenario's than C++.
It's true there is ton of books/websites that cover game programming using C or C++ as it seems to be the default language of the game programming world. 90% of my game programming books use it but there are more choices nowadays with some of my books using Python, C# or some other .net language for games.
Visual Studio's C++ is the standard these day for game programming so you can't go wrong there.
Only other thing I can think of is that if you can't get through your C++ in a reasonable amount of time switch to another one and make sure you get around to reading a book that covers modern C++ eventually like Stroustroup's book or Lippman. I will assume you haven't really learned modern C++ until you read one of these 2 books(I must've read about 10 or more C++ books myself and most of them teach C++ as a better C ,like Deitel for instance, which I just recently used for my C++ college class. You can find a list of the C++ books I mentioned on C++ faq website. Actually, you should check out the questions on that website as it might answer some that you might have about C++.
Oh and I know this might seem obvious but actually get into the practice of writing non-trivial C++ programs while reading these books since that's the only way you'll get better and it will sink into your brain. You don't know how much work a decent command line calculator in C++ can take let alone a game until you try it! Also, try using SDL, Allegro, DirectX,etc so you get a feel for how the theory and what your books say differ from the real world.

[Edited by - daviangel on September 17, 2008 11:00:37 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
-It runs fast. Going by the research I've done, C++ produces very fast running code. This is a good thing for someone like me as I don't consider myself skilled enough to think of the most efficient way to program.


C++ compilers can produce fast code, but they can also produce slow code. In fact, compared to languages which can do lazy evaluation, unless you put explicit thought into optimizing your program, C++ can end up much slower. This is often glazed over in C++ vs ____ benchmarks -- C++ was faster in the end, but only after a few rounds of confirmation bias induced optimization tweaking, usually far more thorough than one could hope to apply throughout the entirety of any reasonably sized project.

Quote:
Original post by wwx
-For one, it's a challenge for me. Going from a relatively easy language to one that has a higher degree of difficulty will give me a big sense of accomplishment.


The flip side of this is that this difficulty also affects your working speed -- it's a tradeoff that can (will) mean you can't produce as many programs.

Quote:
Sams

Eww :3

Share this post


Link to post
Share on other sites
C++ is a good way to go; its my personal favorite language. Besides wanting to go into computer software development (I currently work web dev), my reason for doing C++ is that it is a big challenge. I know some basic (blitz basic and VB), and I know how much easier things would be with it. But I would feel like I took the easy road if I made my games in that. I would work in assembly if it was practical or even remotely portable, I like challenges. But thats just me.

Now be prepared to do a ton of learning, C++ is not easy and 3d engines are hard no matter what you make them in. Also, how much math do you know? 3d engines are rather intensive on the math.

For learning, do not start directly with game programming C++ books. As a musician myself, I will make an analogy with what I found when learning guitar. It is best to learn the instrument for what it is then let your interests carry you to a particular genre. That way you can play anything, not just what you originally intended (interests change though time). Same goes for programming. Know C++ for what it is, then learn game programming. That way you have a well rounded sense of what the language is. You could also build anything you want should you want to.

Share this post


Link to post
Share on other sites
Quote:
Original post by VillageIdiot
But I would feel like I took the easy road if I made my games in that.


Making games is damned hard. Difficult enough that the vast majority of forum-goers have not even completed a non-trivial game, let alone made a good one. Don't hamstring yourself.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Quote:
Original post by VillageIdiot
But I would feel like I took the easy road if I made my games in that.


Making games is damned hard. Difficult enough that the vast majority of forum-goers have not even completed a non-trivial game, let alone made a good one. Don't hamstring yourself.


I'm in the process of my first non-trivial game (depending on ones definition). It is damned hard, but I know I will be in a small percentile of programmers when I am done. I don't stress out because I don't take game dev too seriously. School and work are first, then programming for fun. I am well aware my 2d engine could take a very long time to actually complete. I really enjoy doing it in C++, the challenge is like no other.

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
-It runs fast. Going by the research I've done, C++ produces very fast running code. This is a good thing for someone like me as I don't consider myself skilled enough to think of the most efficient way to program.


I think it is important to point out that C++ can produce very fast running code. I believe it is generally agreed on that you really have to know what you are doing to take advantage of this. It is extremely easy to write horribly inefficent, slow code in C++. At a closer to beginner level, chances are that code you write in a language like C# will run just as fast, if not faster than the C++ code you will produce. There are many, many nuances to C++ that will easily trip you up if you don't understand them. I don't believe "it runs fast" is a good reason to choose C++ for someone new to the language. Note: I love C++ and use it all the time. I have 10+ years experience, so I'm not just an anti C++ advocate.

Quote:
Original post by wwx
-lots and lots of resources. I don't think I'll have any problems finding help on the subject of C++.


This is a better reason to me. A very strong one actually. The amount of game programming related resources and libraries available to C++ is overwhelming. This is where some of the newer languages tend to fall short. Just be prepared, when working with C++, to realize that you know next to nothing about the language as soon as you feel like you know everything. ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
I'm an old school top down kind of guy [...] I know we live in an object oriented world

How does "old school" connect to "top down"? And given OO's abstraction mechanisms, isn't it even more "top down" than old school?

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx

-For one, it's a challenge for me. Going from a relatively easy language to one that has a higher degree of difficulty will give me a big sense of accomplishment.


Learn data structures and algorithms.

Quote:
-From what I've read C++ sounds like an extremely flexible language. If I'm going to spend a great amount of my time learning something at my age I want to learn a language I can always use.


C++ is mostly useless. It has its niche where it shines. Currently this would be legacy code, C interoperability and lack of alternatives. For everything else, C#, Java or Python will get the same job done in a fraction of time.

Quote:
-It runs fast. Going by the research I've done, C++ produces very fast running code. This is a good thing for someone like me as I don't consider myself skilled enough to think of the most efficient way to program.


Learn data structures and algorithms. It takes great skill to get C++ code to run fast, and reliably.

Quote:
-lots and lots of resources. I don't think I'll have any problems finding help on the subject of C++.


95% of resources on C++ are crap. 99% of all tutorials are even bigger crap. Even best of them need to be revised and approached with caution. Even best of them contain conflicting information which must be considered in context.

But most of them discuss things which are plain wrong, obsolete, outdated, platform, project or compiler specific. Even gurus often misunderstand certain aspects. Domains in which C++ is applied to day are closely tied to legacy/incomplete C++ compilers/projects, where doing things properly is often undesirable. Most resources directly shun core concepts of C++.

Quote:
I guess C++ just sounds like something that would really fit the bill for me. It sounds like a well rounded language. And learning it should make learning other languages that much easier too.


For someone with CS background, learning solid C++ takes 6-12 months of active work. Someone without those backgrounds will struggle to grasp the same in several years.

Yes, C++ is rich, can do everything, can run fast, can be extended. The price of that is productivity.

The real question when it comes to C++ is eventually budget. If you can write an application that runs "fast" in 1 week, is it better to use C++, which will take a month for 10% performance improvement.

Even when mastered, things in C++ take longer than in managed languages, and aside from a few specific areas, offer little opportunity for optimization (unless you're doing SIMD or other forms of assembly), whereas in most cases, optimization needs to be specifically considered - if using standard library to boost productivity, performance will be same as that in managed languages.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
95% of resources on C++ are crap. 99% of all tutorials are even bigger crap.

My sentiments exactly.

Share this post


Link to post
Share on other sites
Quote:
Original post by AntheusC++ is mostly useless. It has its niche where it shines. Currently this would be legacy code, C interoperability and lack of alternatives. For everything else, C#, Java or Python will get the same job done in a fraction of time.


That is more opinion than fact. Basically every video game and most pieces of large software are made in C++. Even the C# compiler was written in C++.

For a vastly incomplete list of programs made in C++, go here: http://www.research.att.com/~bs/applications.html

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Quote:
Original post by Antheus
95% of resources on C++ are crap. 99% of all tutorials are even bigger crap.

My sentiments exactly.


I definitely agree about tutorials. Tutorials can actually be very detrimental to your learning. How many times have you seen people who had trouble with their 'engine' and when you look at it, it is obviously a bunch of NeHe tutorials pasted together.

As far as resources go, I wouldn't only consider web sites as resources. I would include 3rd party libraries / engines, all the various books. There is a vast amount of very high quality 3rd party libraries available for C++. C# isn't there yet, but it is definitely getting there. Looking at the books available, I have seen all the books that cover the various 'gotchas' of C++ used as evidence of how flawed the language is .. and honestly I agree with it. Still, there is a very large existing base of C++ resources, once you filter through all the cruft on tutorial sites and other coding sites.

It is really a trade off, and to someone who is relatively new I would echo what other people have said and suggest you go with a language such as C# or Java instead (I'm partial to C#). If speed is your main reason for C++, I would bet with a base level of experience that you could write code that executed faster and more robustly, in a managed language.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dranith
Quote:
Original post by DevFred
Quote:
Original post by Antheus
95% of resources on C++ are crap. 99% of all tutorials are even bigger crap.
My sentiments exactly.
As far as resources go, I wouldn't only consider web sites as resources. I would include 3rd party libraries / engines, all the various books. There is a vast amount of very high quality 3rd party libraries available for C++.
There are also an insane quantity of books that are outdated, biased, or just plain wrong, and a great number of libraries that are outdated, unmaintained, good libraries written in bad code, bad libraries written in good code, or libraries that don't even have reason to exist in other languages.

Look at boost (and don't get me wrong, boost is an incredible set of libraries, written by many of the most august C++ programmers in existence) - but it is also the most incredible mishmash of obstfucated, unmaintainable code, and exists primarily to remedy shortcomings in the language itself.

Share this post


Link to post
Share on other sites
[quote]Original post by MaulingMonkey
Quote:
Sams

Quote:
Eww :3


The Eww doesn't surprise me, I thought the same thing of previous books. However, I'm more of a visual learner and this revision of "Teach yourself C++ in 21 days" has truly changed into a different book which makes the new name for the book very fitting. It's one of the few books that explains C++ in a way I can visualize it.

Think of it this way. I never liked Math, I failed College algebra 4 times before I finally passed it. The reason I was never good at math wasn't because of my lack of skills it was the poor instruction at the school. All math is addition, nothing less and nothing more. If I can't break a problem down into some form of simple addition then either the teacher hasn't explained it properly or the teacher doesn't actually understand it to begin with. Some people, most people, can simply learn advanced math such as algebra and beyond by using shortcut formulas. I can't learn that way, I simply cannot turn off the part of my brain that wants to know why and how. I have to see each process as it takes place in the real world before I can use any form of shortcut method. Sams "Teach yourself C++ in One Hour a Day" gives me more of the full understanding of what is happening than most other books I've read. Where other books give me the formula, Sam's breaks it all down into simple addition and actually explains how that formula works.

You can teach people that 10*10 = 100, but if you don't explain why then they never really learn anything. The why is because the multiplication symbol is a shortcut symbol for adding 10+10+10+10+10+10+10+10+10+10.




Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
All math is addition, nothing less and nothing more.

How do I prove the set of prime numbers isn't smaller than the set of natural numbers using only addition? :)

May I ask for an example where Sams Book opened your eyes while other books failed? I never read that book, so I have no idea how it's structured.

Share this post


Link to post
Share on other sites
Quote:

Quote:
Original post by wwx
All math is addition, nothing less and nothing more.

How do I prove the set of prime numbers isn't smaller than the set of natural numbers using only addition? :)


He meant 'All math I know is addition'

;)


Quote:
Original post by VillageIdiot
I really enjoy doing it in C++, the challenge is like no other.


That's not true. Imagine the challenge if you were doing it in C. Or assembly. Or, better yet, hex code. Oh boy.

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Quote:
Original post by wwx
All math is addition, nothing less and nothing more.

How do I prove the set of prime numbers isn't smaller than the set of natural numbers using only addition? :)


Add up all the prime numbers then add up all the natural ones and see which is larger. lol. They are both infinite are they not? Are you including Mersenne primes, Fermat primes, Fibonacci primes, etc? Are we starting at one or at zero?
Why don't you explain to me how you would do it, then prove to me that whatever formula you are using to calculate the data does not use any addition. (addition is subtraction, division, addition, and multiplication)

Quote:

May I ask for an example where Sams Book opened your eyes while other books failed? I never read that book, so I have no idea how it's structured.


Sure.

On page 44 the authors explain storing data in memory and use a visual aid that shows 7 boxes called RAM, a location number for each box called an address and a variable name as a label for one of these boxes. I've never read a book yet that has explained something so simply. Many books don't even bother to explain this much and simply explain that a variable name is a name for a variable. At least with this book I have a better understanding of a variable.

Share this post


Link to post
Share on other sites
Quote:
Original post by wwx
Quote:
Original post by DevFred
Quote:
Original post by wwx
All math is addition, nothing less and nothing more.

How do I prove the set of prime numbers isn't smaller than the set of natural numbers using only addition? :)


Add up all the prime numbers then add up all the natural ones and see which is larger. lol. They are both infinite are they not? Are you including Mersenne primes, Fermat primes, Fibonacci primes, etc? Are we starting at one or at zero?
Why don't you explain to me how you would do it, then prove to me that whatever formula you are using to calculate the data does not use any addition. (addition is subtraction, division, addition, and multiplication)


The point was that addition doesn't really apply when infinities are involved. Check this out:

2 + 4 + 8 + 16... = 2 + 4 + 8 + 16....
2(1 + 2 + 4 + 8...) = 2 + 4 + 8 + 16...
2 + (2 + 4 + 8...) = 2 + 4 + 8 + 16...
cancel out common "terms" and we get:
2 = 0
Right?

No, of course not. By "only using addition" this problem would seem to be a real proof, but clearly some things need more than addition.

And zero is not a prime number. Fibonacci, Fermat, and Mersenne primes are included in the set of all prime numbers.

Edit: Fixed the "proof" - needed a geometric series.

Share this post


Link to post
Share on other sites
Mikeman, weren't you taught long division in elementary school? It's a pain... but only uses addition if you reduce multiplications down to additions and disregard some minor human logic (could be done via repeated tests, anyways).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this