Advertisement

Ran into a wall with Liberty - please help.

Started by September 01, 2002 02:16 PM
11 comments, last by Northchild 22 years, 3 months ago
It seems like most of the free world is able to learn C++ from the ground up from TY C++ in 21 Days, but I haven't had as much luck with it. After weeks of going over the first seven chapters and basically running away from the problem, I tackled Chapter 8 about a week ago... or rather, Chapter 8 tackled me. This was my third try with it. The chapter is about pointers and starts out with some fairly easy examples, but after two days of trying to make sense from the stuff in the middle of the chapter, I gave up and picked up a book by Heller, (Learning to Program in C++). After a few days of reading, I've learned more about what goes on under-the-hood when I'm programming. I'm even comfortable with some of the memory related terms and some of how Assembly language does what it does. I'm going to go over the first few hundred pages again before I go over classes. Once I've learned a topic, I have a feeling that the Liberty book will be more of a reference manual... like having taken decent notes in class. Before I move on, does anyone have any additional advice or encouragement? I'd like to eventually know C++, the Windows API, and Direct X (in that order). This seems like a long... long... way to go. I'm even considering grabbing a book about Assembly language before I move on to C++ classes, but I'm not sure what book about Assembly language would be relevant given my machine (I put together an XP 2100+ system a few months ago). Should I buy a C++ language reference or would that be no help at all given my current lowly stage of development? Also, this could be just me, but I find that copying code from a book is one of the most painful things in the world for me to do. On one hand, I want the experience of typing code for myself because it helps me to understand things. On the other hand, I get so dizzy looking from the book to the display and back that I want to puke. I also often get motion-sick with many 3D games (unless they have good frame rates and good view distance). I'm wondering if the two are related. Code from discs or web sites is nice, but I haven't found code that is typed AND explained on the same screen... usually one or the other. Anyway, any thoughts are appreciated. I'm really frustrated because I've buckled down and have been at this for weeks and can still only understand like 5 percent of what people talk about at GameDev. [edited by - Northchild on September 1, 2002 3:18:31 PM]
Dont worry I went through about the same thing. How often do you practice coding using the features of c++ that you understand well? For me reading too much and not hacking apart the sample programs and not writing my own before moving ahead screwed me up. Once you get enough practice it should start to click in your head and you''ll begin thinking like a programmer. Pointers and functions and many other features of c++ are designed with neatness and structure in mind. To keep your data organised and clean. Dont even bother with assembly right now. Later on when you are writing programs that are speed critical you can learn assembly and optimise them but for now you have little use for it. The first book I bought to learn c++ I gave up on after about a month. Then I bought ivor hortons beginning visual c++ and quickly everything came together. Don''t give up, if you start going crazy get away from the puter and do something else and hit it again the next day. A fresh mind can do wonders. After I got a decent understanding of c++ I just read win32 tutorials on the net and now I''m playing with directx which also has many good tutorials around the web. It actually didn''t take that much work to get this far. You just have to keep at it. And yes copying code from a book onto the monitor can be annoying and hurt your eyes.
Advertisement
I wouldn''t suggest anyone new in programming to learn C++ as the first language. Although there will always be some people who will get around with learning C++ first somehow, but still i dont think its a good idea. This however DOES''T mean that u should learn assembly as ur first language. I think learning C first would be a better idea. Now, there are some people who think C/C++ [ whatever ] is the toughest language on earth and one should learn something like PASCAL before even touching C/C++. THIS IS ONE HELL OF A BULLSHIT IDEA. If you want to learn C, just bang in it. Rather you will find C is lot easier than PASCAL when it comes to dealing with pointers, trust me. Once you get hold of C you can then jump to C++.... i guess that would be a smooth transition, and this will help you in many ways [ very difficult to explain in this small text box ]. Once you master C/C++ , try learning ASM although its not a must, but it will help a lot.
Z
Thanks for the words of wisdom! I''ve noticed that there are a ton of libraries that come with Visual C++ NET, are there any good guides about what these various library objects do? Do real software writers use things like the standard library?
quote: I wouldn't suggest anyone new in programming to learn C++ as the first language. Although there will always be some people who will get around with learning C++ first somehow, but still i dont think its a good idea. This however DOES'T mean that u should learn assembly as ur first language. I think learning C first would be a better idea. Now, there are some people who think C/C++ [ whatever ] is the toughest language on earth and one should learn something like PASCAL before even touching C/C++. THIS IS ONE HELL OF A BULLSHIT IDEA. If you want to learn C, just bang in it. Rather you will find C is lot easier than PASCAL when it comes to dealing with pointers, trust me. Once you get hold of C you can then jump to C++.... i guess that would be a smooth transition, and this will help you in many ways [ very difficult to explain in this small text box ]. Once you master C/C++ , try learning ASM although its not a must, but it will help a lot.


Why shouldn't anyone new in programming learn C++? Java is often taught as an introductory language, and it, like C++ is object oriented. Also, there are those who say that learning C first might be a mistake, especially if you're interested in learning object oriented concepts, as some people find it difficult to leave behind the procedural style of C vs. the OO C++.

[edited by - ares32585 on September 1, 2002 7:14:29 PM]
I learned c++ as my first language, and up until the point where it introduced class''s I programmed like a C programmer. OOP is really a pretty simple concept it just takes some getting used to. So if you''ve gotten that far I can''t see why you''d suddenly become confused beyond help. It took me all of 2 minutes reading the introduction to class structure to get a basic understanding of how it works and for what reason. I will admit dealing with object''s was kinda weird at first. Took me a few minutes of deep thought wondering wtf.
Advertisement
While I feel that I have a fairly good grasp of objects, I still don''t understand pointers as explained by Liberty. The infuriating thing is that I understand something like half of the chapter on pointers, but then it all falls apart somehow.
i started reading the TY c++ in 21 days book but i never really finished it..i´m kind of comfortable with the first 9 chapters, then i just skipped some chapters and read some stuff here and there..then i got kind of sick of doing pure c++ so i started learning win32 and openGL, and i did so for a while. but then i felt i needed to learn c++ better, so i jumped back into my c++ book and read some more in it..

see, when i had done some opengl, i started to understand how to use pointers and stuff..maybe this is the way u should do it to..
What dont you understand about pointers? Not sure what the point of them is? No pun intended. Pointers are just a tool that allows you to manipulate data in a more flexible way.
Yes, I really don''t get the point.

I understand the part about accessing and writing variable values via pointers, but things start getting fuzzy on page 221, (paperback 4th ed), when I start seeing things like:

unsigned short int * pPointer = new unsigned short int;

Ok, he''s just declared an integer named pPointer that exists in the free store (due to the new unsigned short int assignment). This means that this (2 byte?) integer persists and is accessible beyond the function that it''s created within, (whereas auto variables don''t persist and static variables do persist but can''t be accessed?) This isn''t the same as a global variable, but I just don''t see how the end results are different. Wouldn''t everything have access to this pointer the same way that everything has access to a global variable? Do any of the little console programs in this book actually need pointers or will I see this once and then not again until I''ve advanced a couple of months?

The rest of the chapter is like wading through mud. I am taking some advice and going over basics again, writing small programs, etc. Hopefully I''ll get by this block. Thanks again.

This topic is closed to new replies.

Advertisement