User made database for learning c++?

This is not going to be an article to start but I was not sure were else to put it.

I was thinking maybe it would be a helpful resource to others if there was a list of down loadable "Plug and Play" type code snippets.

For example, having one for a basic character class in an rpg.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Player{

public:
/*here put things like basic accessory methods for below variables
and other commonly found things in what may make up a Player class*/


private:
/* have some very basic member variables such as:
int itsHealth;
int itsMana;
etc
*/
};


Obviously it may look different but the idea is to make up several things like this as sort of a shared resource for others. The would be categorized from simple to advanced (relating to the concept they are based on and how much of it is made). This would also let new coders who don't have any other frame of reference have a database of example code. Another type of article that could be added would be such as the one I wrote on how to make a world map in console (its a few articles down). If we got together and even in people spare time put up a few example consistently I feel a solid reference could be built.

Now, obviously there our tutorials and such, even on this site. However many (most) tutorials you find use very vague examples and even some of the better ones can be too abstract for new coders.

Obviously we currently have an Articles forum, but really it is unorganized and can be hard to find what you want. My idea of this would be much like a game faq site. People can put up different topics/examples/snippets relating to (and labeled as such) specific coding topics. Also, I find that on forums once its written most people don't bother with it again. On Game FAQ sites and such you often see 6 walk troughs on the same game, but with different views and opinions. Obviously some are written better/clearer then others. That's why these sites have a rating system.

Another way to view this is like learning c++ from a book. I don't just use one book when going over/learning a topic, I use several. Even if the 3 books I am reading talk about the same thing there will still be differences (large or small) that may give me incite or make something more obvious.

To make this perhaps a wiki may be a viable form, or it may be necessary to make a whole separate website with custom database/search code.

So in summery:

I propose making a database of sorts of Articles, Code Snippets, and ready to use code examples (just change names around or such) that could be used by the beginner, as well as the intermediate and advanced coding community as a valuable resource for learning.

Thoughts please.

Edit: I realize this site has the /src/ and that looks to be a similar concept, however it is pitifully small and has topics many people learning or trying to get into c++ are nowhere near, plus contains only downloads with no articles.
Last edited on
What's the point of Player::itsHealth? Why not just Player::Health or something?
That is so far from the point of this it's not even funny...... I was just putting up a poorly written base idea of what I was thinking.... and *I*, personally, use the prefix "its" for member variables. To each there own.
There is a sourcecode section... granted not much of what's there is useful. I do however disagree with you on creating such an article... I don't think those new to programming should cut and paste code. That's not the way to learn at all and creates a weak foundation.

I agree... itsHealth is a bit odd and wouldn't cut it on a professional game dev team.
I was just mentioning it because to me, it seems clear that Player::Health is referring to the player's health. itsHealth just sounds weird.

But like you said, to each their own...
Topic archived. No new replies allowed.