1
Development / Re: A Proper Statistics / Detailed SQL Log System.
« on: December 14, 2010, 04:22:51 pm »
pretty cool. will try it out some time later =)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
I personally don't see the point behind using outdated hungarian notation by putting m on all the member variables.
Both Microsoft and Bjarme Stroustup recommend against it and that's enough for me. We're not coding in C and need to keep check of if our variables are "members" of our "class"
this->m_foo.. you already know it's a member of the object you're calling.
I also suggest putting brackets on all if statements as it's very easy to create a bug by proxy of someone else editing your code. The only reason no one really does is simply laziness (myself included).
I think the most important thing however is the way people write code and the names they use for methods. I think it's more important then general syntax and how many spaces an indent is.
A bad example with difficult to read code..Code: [Select]if (obj)
{
// insert many lines of code
if (foo)
{
// insert many lines of code
if (bar)
{
// insert many lines of code
}
}
}
return;
A better way of doing the same thingCode: [Select]if (!obj) { return; }
if (!foo) { return; }
if (!bar) { return; }
A bad example with method naming simply because everyone uses a different name for getting similar data across classes.Code: [Select]Foo foo;
Bar bar;
foo->getName();
bar->getTitle();
My personal experience is that when working in teams the previous two examples are much more important then making sure everyone's syntax is similar.