Archived

This topic is now archived and is closed to further replies.

Calling all Newbies

This topic is 5501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys. To try and solve my coder''s Block and cure some boredom, I''m considering writing an article or maybe a few, answering basic coding questions you newbies might have. The really common stuff. So I''m putting the call out to you guys to hit this thread with your basic questions. Not "OpenGL? DirectX?" stuff so much as "How can I use command-line switches?". I think you get the idea. If I can get enough good solid questions, I''ll probably write an article for you guys. Have fun. -Ryan "Run_The_Shadows" -Run_The_Shadows@excite.com -The Navidson Record! The best film you''ll never see!

Share this post


Link to post
Share on other sites
ok here''s one.

we all know const int number;
but what does "const" mean in these sequences?

const int class::addNumber();
int class::addNumber()const;
int class::addNumber (const int);

and my favorite stumper:

const int class::addNumber(const int) const;

so how do they work/mean?

Share this post


Link to post
Share on other sites
Alpha_ProgDes - Replace const with volatile and the question suddenly becomes much more interesting

Run_The_Shadows - how about showing that C++ isn''t just ''C with classes ?''

- using C++ std::string and std::vector instead of C char* and arrays - without talking about pointers (yet) - get them to manipulate strings and vectors without worrying about the internals.

- using namespaces (notably std: and the C++ standard headers.

- using standard iostreams, including std::fstream and std::stringstream - and doing error-checking on them.

- using containers, iterators and algorithms.

Or maybe I should just do it...

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
How about a run down on proper program design. Including stuff defining the problem(like flowcharts, puesdo code, etc..), or C/C++ control structures and when to use them.

Maybe throw some stuff about realtime programming techniques as the example.

Even better explain why pointers should be used and when not to use them.

Share this post


Link to post
Share on other sites
when i master "const", i'll do volatile

i know there's a subtle difference between a for loop and a while loop. forgot what that difference is though (something about the last iteration...). if someone knows please do tell.

oh! why is that: if "delete" deallocates memory made by "new", then why doesn't delete/deallocate an array also (when made by "new")? isn't the array a block of memory?

that's all i have for now

[edited by - Alpha_ProgDes on November 9, 2002 1:11:39 PM]

new addition: maybe you might have wanna have a beginner game programming section also...

if so you'll want to explain: frames per second, how to calculate how many or what executions go during a passing frame, how to set up the game loop...

but as far as general programming goes: when using templates does your class declaration and implementation have to be in the
same file? how does that work?


[edited by - Alpha_ProgDes on November 10, 2002 11:58:28 AM]

Share this post


Link to post
Share on other sites
I can handle pretty much all those requests, and keep ''em coming. Given, you might not see this article for a bit(I''m known for needing tons of revisions before I get any piece of writing correct), but I''ll try and include as much as possible.

-Ryan "Run_The_Shadows"
-Run_The_Shadows@excite.com
-The Navidson Record! The best film you''ll never see!

Share this post


Link to post
Share on other sites
That''s what I''m shooting for with this. All our newbie areas are severely lacking last I checked. Sure, the info is there, but often it''s written poorly, or obfuscated among other things. I want to put together *the* guide, so all the new coders out there don''t have to dig and beg and plead and hope for answers on stupid things like File I/O like I had to do back in the day.

-Ryan "Run_The_Shadows"
-Run_The_Shadows@excite.com
-The Navidson Record! The best film you''ll never see!

Share this post


Link to post
Share on other sites
Considering the number of posts we recently had on various forums about this: please make clear, that function pointers != member function pointers, that they are not exchangeable, and that no dirty trick will change this fact...

Share this post


Link to post
Share on other sites
Ok, I know from the top you don''t want questions like what about DX or GL... But being a newbie I HAVE to ask.... Which one is better for the newbie to learn and to program with... I''m looking to learn stuff like WC3 and Gauntlet.... I know it''s years off, but I just want to take a step in the right direction.

Share this post


Link to post
Share on other sites
The *one* thing I will say about D3D/OGL, is the fact that if you get used to the D3D way of doing things, it may help you learn the other interfaces a bit faster.

-Ryan "Run_The_Shadows"
-Run_The_Shadows@excite.com
-The Navidson Record! The best film you''ll never see!

Share this post


Link to post
Share on other sites
Classes:
- general format
- constructors
- destructors
- inheritance
- polymorphism
- oddities (i.e. non-standard "tricks" and commonly used shortcuts)

(and maybe the toughest one...)

- When is it approprate to use a class rather than a function or a struct...

RM.

------------------------------------------------------------
Yes. it''''s true, I DO wield the ugly stick. And I see I have beaten you with it before!

Share this post


Link to post
Share on other sites
As a newbie, my biggest problem was and still is using COM (talking about DX8 of course). I can initialize different components but I have no clue of what each line does.

I also wold like to know how to compress all those bmp''s in one file.

Share this post


Link to post
Share on other sites
if you''re just talking about multiple bitmaps into a single file and tiling it out, that''s easy. If you''re talking about taking seperate bitmaps and compressing in the general(.zip/.rar/.ace) sense and using them...I suggest doing it the other way. Maybe I''ll do a quick bit on that as well.

-Ryan "Run_The_Shadows"
-Run_The_Shadows@excite.com
-The Navidson Record! The best film you''ll never see!

Share this post


Link to post
Share on other sites
I have once written a simple procedural tutorial to write a linked list. I could update it, add some more stuff to build it into a class and then tell about how to template it. Maybe I can post this so you have a little extra help. I was already thinking for working on it again because the big amount of questions about linked lists. How about that idea? Run_The_Shadows, if you like the idea you can always email me and we can discuss it.

Sand Hawk

----------------
-Earth is 98% full. Please delete anybody you can.


My Site

Share this post


Link to post
Share on other sites
My biggest problem is knowing what code to put where (what goes into the game loop vs getting it''s own function type of thing). All my code starts out looking ok, but by the time I''m 20% through the simple project, the code is such a mess I can barely figure out what''s going wrong.

I would also like to read more on when to use a class vs. when to just have a bunch of generic functions.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i think it would be nice to see something relating some of the standard c functions to their equivalent c++ syntax, e.g., what to use instead of strcpy, strcat, sprintf, ...

it just seems that many new to this site are learning c++ before/instead of c, but many of the tutorials/demos/etc., still make use of the c functions.

Share this post


Link to post
Share on other sites
I''d like to hear a very newbie explanation of pointers and when and where to use them and not use them like someone said in a previous post. Also polymorphism, inheritance and most importantly what to do before you start a project. If you decide you want to make something do you just sit down and start coding or do you think about the design. Do you write notes on paper before you start programming or do you just start writing code and think about design along the way.

Share this post


Link to post
Share on other sites
quote:
Original post by Shenron
I''d like to hear a very newbie explanation of pointers and when and where to use them and not use them like someone said in a previous post.

I view this topic as being slightly furry. It''s relatively simple to come up with bad explanations of when to use pointers, and people on these forums take it on themselves to do so with alarming frequency. The problem is that there is often a big mismatch between what people on these forums say and what is actually wise to do, which is a result of any random strategically shaven monkey being allowed to say what they like. This leads to a self-perpetuating situation where the "I believe everything I read" people read something written by the "strategically shaven monkey" people, think they understand and subsequently decide to promote themselves to the latter group.
quote:

Also polymorphism, inheritance and most importantly what to do before you start a project. If you decide you want to make something do you just sit down and start coding or do you think about the design. Do you write notes on paper before you start programming or do you just start writing code and think about design along the way.

Good question, recursive answer. You do whatever it is right to do.

Share this post


Link to post
Share on other sites