I said I'd do something like this before, so here I am.
I'm looking to see if anyone is interested in learning C++, I will only cover code, not any specific operating system libraries, compilers, etc. I've been to a number of talks where 50% of the topic was covering Linux/Mac/Win differences in compiling methods, so you'll have to setup your compiler yourself, but if anyone wants to learn the language, please continue reading.
If you are interested in crazy coding, check out my Object Orientated C thread where I put the C++ into C!
Introduction
C++ is my favourite language, but it has a LOT of problems. Personally; I value code legibility over speed of implementation as I enjoy writing clean and fast code, so I actually limit the features of C++ that I use.
So for the sake of readability, I will not be fully using the feature-set of C++ for these tutorials and I will try to teach at some kind of legibility standard.
The C/C++ standard I code by is my version of idSoftware's coding standards, basically I follow that guide up until the typedef examples given, I am more like this type of person:
All my typedefs are used to mask variable types.
Also, I do not use getters/setters unless it makes sense. If I want it to be read only, then I use a getter, if I want it to be write only, then I use a setter. I will not use both unless getting/setting the value requires additional processing (EG: SetFOV() may need to rebuild some 3D matrices, GetFOV() would simply return the value).
A lot of teachers enforce this one, Notch famously never cared about it, but I believe that it's importance was lost at some point and now people either do it religiously because they think they should or don't do it because they don't see the point/understand the concept.
I also enforce const-correctness, this practise is only good for readability and stopping people from breaking your code when you pass it onto the next employee, it's probably not really an issue for closed-sourced personal projects.
Okay, that's the introduction over, now for some questions.
What would you like to learn?
I will probably start with Hello World, but from there, where should I take this? C++ game tutorial? C++ 2D graphics? I don't really know so some input on what people actually want to learn would be great.
Also, the dialect for C++ is very broad.
The way most people teach it is with GNU standards, here's the C GNU standard:
In the standard I use it would look like this:
The GNU way is what I learnt and I hate it, if you don't want me to enforce the idSoftware standards and would rather I taught the GNU standard (The usual way to teach it, however I don't think it is as readable) then just say so and I'll switch for this thread.
The main thing with GNU standard is that it assumes you don't have a wide-screen monitor so it splits up lines into multiple lines, which to me looks ugly, however a lot of people don't like it when lines are so long that you need to horizontally scroll, so keep this one in mind if you'd rather I did my examples in GNU standard, but I recommend idSoftware's standard when it comes to games.
I'm looking to see if anyone is interested in learning C++, I will only cover code, not any specific operating system libraries, compilers, etc. I've been to a number of talks where 50% of the topic was covering Linux/Mac/Win differences in compiling methods, so you'll have to setup your compiler yourself, but if anyone wants to learn the language, please continue reading.
If you are interested in crazy coding, check out my Object Orientated C thread where I put the C++ into C!
Introduction
C++ is my favourite language, but it has a LOT of problems. Personally; I value code legibility over speed of implementation as I enjoy writing clean and fast code, so I actually limit the features of C++ that I use.
So for the sake of readability, I will not be fully using the feature-set of C++ for these tutorials and I will try to teach at some kind of legibility standard.
The C/C++ standard I code by is my version of idSoftware's coding standards, basically I follow that guide up until the typedef examples given, I am more like this type of person:
C++:
// Define with the suffix of _type
struct myStructure_s;
enum myEnumerator_e;
int ( * MyFunctionPointer_f )( const int );
class myClass_c; // I don't use this one
// Typedef these as such:
typedef struct myStructure_s myStructure_t;
typedef enum myEnumerator_e myEnumerator_t
typedef int ( * MyFunctionPointer_f )( const int ) myFunctionPointer_t; // I don't use this one
typedef class myClass_c myClass_t; // I only use this with namespace forwarding without using namespace and I use it very rarely
Also, I do not use getters/setters unless it makes sense. If I want it to be read only, then I use a getter, if I want it to be write only, then I use a setter. I will not use both unless getting/setting the value requires additional processing (EG: SetFOV() may need to rebuild some 3D matrices, GetFOV() would simply return the value).
A lot of teachers enforce this one, Notch famously never cared about it, but I believe that it's importance was lost at some point and now people either do it religiously because they think they should or don't do it because they don't see the point/understand the concept.
I also enforce const-correctness, this practise is only good for readability and stopping people from breaking your code when you pass it onto the next employee, it's probably not really an issue for closed-sourced personal projects.
Okay, that's the introduction over, now for some questions.
What would you like to learn?
I will probably start with Hello World, but from there, where should I take this? C++ game tutorial? C++ 2D graphics? I don't really know so some input on what people actually want to learn would be great.
Also, the dialect for C++ is very broad.
The way most people teach it is with GNU standards, here's the C GNU standard:
C:
<div class="c" id="{CB}" style="font-family: monospace;"><ol><span style="color: #993333;">void my_function()
{
<span style="color: #993333;">int my_variable = <span style="color: #cc66cc;">2;
}
C:
<div class="c" id="{CB}" style="font-family: monospace;"><ol><span style="color: #993333;">void myFunction() {
<span style="color: #993333;">const <span style="color: #993333;">int myVariable = <span style="color: #cc66cc;">2;
}
The main thing with GNU standard is that it assumes you don't have a wide-screen monitor so it splits up lines into multiple lines, which to me looks ugly, however a lot of people don't like it when lines are so long that you need to horizontally scroll, so keep this one in mind if you'd rather I did my examples in GNU standard, but I recommend idSoftware's standard when it comes to games.