I'm planning on quite a huge project that handles lots of details (don't they all), and would like to teach myself a clear, good style for coding. I understand this is partially personal, but if I'm doing something utterly forbidden by <fill in the blank> or downright stupid, I'd like to know beforehand
Some questions:
1) I'm adapting hungarian notation, but hate the "standard", so here it is:
- (u)int: (u)i_...
- float: f_...
- double: d_...
- string: s_...
- size_t: sz_...
- (u)intptr_t: (u)ptr_...
- vector<string>: v_s_...
- vector<class T *>: vptr_...
- Constructor and simple set-function arguments meant to be put in the initializer list are not prefixed (data members are clear enough): say a class has an int and a float as data member, then the Class would look like this (I know, implementation in header is bad...):
class MyClass
{
public:
MyClass(const float myFloat, const int myInt)
: myFloat(f),
myInt(i)
{ };
private:
float f_myFloat;
int i_myInt;
};
class MyClass
{
public:
MyClass(const float myFloat, const int myInt)
: myFloat(f),
myInt(i)
{ };
private:
float f_myFloat;
int i_myInt;
};
To copy to clipboard, switch view to plain text mode
That last bit just to avoid stupid mandatory renaming of the arguments.
2) The project is a build system for c/c++ and eventually other stuff as well. I read online that CMake has some (optional?) dependencies and that that sucks for a "build system", especially or using it on a tight-kept Linux install. But this means that stuff like directory listing and file access will have to be handled by me, in contrast to Qt's great functions/classes for exactly that. Thoughts?
3) Going on from point 2, for example getting directory listing (to resolve a search for all *.cpp files), there are two ways (except Qt of course):
- system(dir) and system(ls) platform specific and output parsing
- platform specific messes with native OS function calls.
The first is simpler in principle, but probably slower and harder to get right. The second will require lots of research by me.
Any comments are welcome, I appreciate all help/input/contribution.
Bookmarks