On Suday the 11th of February, 2007 -after 3 and a half years on InvisionFree, we have moved! This old board remains as a read only archive of years past, and registration has been disabled here. All new and current members should register at http://www.cpplc.net/forum .
| · Portal |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
| Welcome to C++ Learning Community. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Pages: (2) [1] 2 ( Go to first unread post ) | ![]() ![]() ![]() |
| C-Man |
Posted on Jan 6 2005, 09:36 PM
|
|
Lazy bum Group: Super Moderator Posts: 4,563 Member No.: 609 Joined: 29-February 04 |
lets say foobar is a class
-------------------- |
| Loki_Laughs |
Posted on Jan 6 2005, 09:44 PM
|
|
nerd Group: Members Posts: 81 Member No.: 1,050 Joined: 22-October 04 |
That depends on what the identifier is for. Different conventions for: MACROS variables member variables static member variables global variables local variables functions global functions static functions methods static methods Types Class you get the idea. Some of these overlap for me. -------------------- If you dont know where you are going, you can't be lost.
|
| KTC |
Posted on Jan 6 2005, 10:53 PM
|
|
std::freak Group: Members Posts: 1,465 Member No.: 420 Joined: 30-December 03 |
He said foobar was a class name
-------------------- Say NO to software patents !!
Newbie-FAQ : Archive of Informative Topics The D Programing Language : High Level Assembly |
| TheHawgMaster |
Posted on Jan 7 2005, 01:51 AM
|
![]() Offtopic Bum Group: Members Posts: 1,783 Member No.: 23 Joined: 7-July 03 |
FooBar for classes... Camel notation for most else
-------------------- Short ones, tall ones, skinny ones, bigger
Love is the gun and we pullin' that trigger - Toby Mac |
| Nintendofreak88 |
Posted on Jan 7 2005, 02:11 AM
|
|
Programming Addict Group: Super Moderator Posts: 757 Member No.: 374 Joined: 13-December 03 |
I use FooBar for classes, class methods, and functions. Camel for everything else, like THM.
-------------------- |
| ih8censorship |
Posted on Jan 7 2005, 04:22 AM
|
|
Megalomaniac Group: Admin Posts: 2,469 Member No.: 1 Joined: 20-June 03 |
moved to the general c++ forum since its not really a help topic. anyway for a class id use FOOBAR. im finding that i like types to be capitalized and then the object lowercase. i do all sorts of things with functionnames though
-------------------- ![]() The Windows Operating system is so buggy. most of my c++ programs wont run on it. i do not write programs with bugs. my programs just do random things. Join Marapets |
| Gmakermaniac!!! |
Posted on Jan 8 2005, 03:20 AM
|
![]() Zorro would kill Chuck Norris Group: Members Posts: 690 Member No.: 844 Joined: 21-June 04 |
FOOBAR for macros, FoObAr (or, like a sane person FooBar) for classes, functions, variables and members.
-------------------- the fail is strong with this one
"never leave the room when your code is running" http://zorro.nukelol.com (my website [unfinished]) |
| dorto |
Posted on Jan 8 2005, 06:51 AM
|
||
![]() geek Group: Members Posts: 268 Member No.: 1,143 Joined: 20-December 04 |
class id? you mean class name? though one can use any naming convention for naming classes, functions etc but using upper case for macros and constants is followed almost universally in c++ fraternity. so anything *other than* all-upper-case could be used for the class names etc. ofcourse, "underhanded names"(ones that begin with an underscore or that contain a double underscore) should NEVER be used. -------------------- dorto
Absolute Beginner(programming): 'You Can Do It' by Francis Glassborow Absolute Beginner(c++): 'Accelerated C++' by Andrew Koenig and Barbara Moo Free Online Book: http://mindview.net/Books/TICPP/ThinkingInCPP2e.html C++ Bible: 'The C++ Programming Language' by Bjarne Stroustrup |
||
| vbgamer45 |
Posted on Jan 8 2005, 07:40 PM
|
|
N00b!!! Group: Members Posts: 13 Member No.: 1,163 Joined: 3-January 05 |
I like CFooBar
Normally I like to have the first letter of the type lower case but in this case its better to keep the C upper case since thats what a lot of the classes use. And then I like to captialize each word. -------------------- SMF For Free - Free Simple Machines Forum Hosting.
|
| Gmakermaniac!!! |
Posted on Jan 9 2005, 12:43 AM
|
![]() Zorro would kill Chuck Norris Group: Members Posts: 690 Member No.: 844 Joined: 21-June 04 |
I dislike hungarian notation fore some reason. It kakes the names of everything more confusing when I can just place my mouse over the variable name to figure out it's type. It I were using notepad, I would consider using hungarian notation.
-------------------- the fail is strong with this one
"never leave the room when your code is running" http://zorro.nukelol.com (my website [unfinished]) |
| vbgamer45 |
Posted on Jan 9 2005, 01:51 AM
|
|
N00b!!! Group: Members Posts: 13 Member No.: 1,163 Joined: 3-January 05 |
Makes things more confusing? How so? I find it better as soon as you look at a variable you instantly know the type and general function of it and don't have to go around finding what type it is.
-------------------- SMF For Free - Free Simple Machines Forum Hosting.
|
| dorto |
Posted on Jan 9 2005, 04:02 AM
|
![]() geek Group: Members Posts: 268 Member No.: 1,143 Joined: 20-December 04 |
Hungarian Notation is dead - even in microsoft circles.
Herb Sutter says: "it has mixed utility in type-unsafe languages(like C), it is possible but has no benifits (only drawbacks) in object-oriented languages(like smalltalk), and it is impossible in generic programming. Therefore, no C++ programmer should use Hungarian notation." it has mixed utility in C like languages because: 1.(adv)it helps in identifying the type immediately by looking at the variable 2.(disadv)but when the type of a variable changes, it is not likely that you are going to hunt through all the code and change all occurrences of its name. For an example of this, look at the documentation for wParam in Microsoft Windows 32-bit: It changed from a 16-bit value (w stands for word) to a 32-bit value (which should have been dwParam) in OO languages, variables are typeless - they contain an object, the type of which depends on the object itself, not the variable. in generic code, ofcourse, hungarian notation is just impossible. -------------------- dorto
Absolute Beginner(programming): 'You Can Do It' by Francis Glassborow Absolute Beginner(c++): 'Accelerated C++' by Andrew Koenig and Barbara Moo Free Online Book: http://mindview.net/Books/TICPP/ThinkingInCPP2e.html C++ Bible: 'The C++ Programming Language' by Bjarne Stroustrup |
| ih8censorship |
Posted on Jan 9 2005, 05:00 AM
|
||
|
Megalomaniac Group: Admin Posts: 2,469 Member No.: 1 Joined: 20-June 03 |
actually it was class i would- contraction and forgot the ' so it would have been i'd
-------------------- ![]() The Windows Operating system is so buggy. most of my c++ programs wont run on it. i do not write programs with bugs. my programs just do random things. Join Marapets |
||
| dr voodoo |
Posted on Jan 9 2005, 09:26 AM
|
||||
|
c++ programmer Group: Super Moderator Posts: 1,986 Member No.: 11 Joined: 23-June 03 |
And I want to remeber what is a macro, what a class and what a variable: MACROFOO ClassFoo var_foo func_foo() or FuncFoo() or funcFoo() It's no problem to seperate all 4 things using there names. A special convention for functions is useless because they are the only which are followed by a (. -------------------- Conscience doesn't really keep you from doing anything wrong -- it merely keeps you from enjoying it.
My Site My Tutorial |
||||
| C-Man |
Posted on Jan 9 2005, 11:46 AM
|
|
Lazy bum Group: Super Moderator Posts: 4,563 Member No.: 609 Joined: 29-February 04 |
i dislike the hungarian notation cause it just looks plain ugly too me
and i can't decide witch looks better to me class_foo::funct_foo or ClassFoo::FunctFoo -------------------- |

Pages: (2) [1] 2 |
![]() ![]() ![]() |