Personally, I prefer thisStyle - thisStyle for functions. This is really for personal taste, maybe for Java influence, but I really like functions and classes to look different.
If I had to argue about this, I would say that the difference is somewhat more than just aesthetic. This saves a little thought when you come across a temporary style design. On the contrary, you can argue that it doesn’t really matter if Foo(1,2,3) function call or not - if it is a constructor, then it acts just like a function that returns Foo by value in any case .
The convention also avoids the fiasco with function-with-that-and-ah-ah-ah-ah, which C ++ inherits, since C has a separate tag namespace:
The bar, after all, is both a noun and a verb, so it can be reasonably defined as a class in one place and a function in another. Obviously, there are better ways to avoid collisions, such as using namespaces correctly. So, as I say, this is actually simply because I prefer the appearance of functions with lower initials, and not because it is actually necessary to distinguish them from classes.
Steve Jessop Nov 22 '09 at 2:54 2009-11-22 02:54
source share