![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
![]()
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#12 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Off-topic: Ruben, your PM box is full. Contact me by email.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#13 |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 3
![]() |
I usually start the variable names with the first letter(s) of it's type.
e.g: char chLetter; char szText[10]; char* pszText; std::string strText; int iMax; bool bIsSomething; ... ect. |
|
|
|
|
|
#14 | |
|
Expert Programmer
|
Quote:
![]() |
|
|
|
|
|
|
#15 | |
|
Programming Guru
![]() ![]() ![]() |
Quote:
However, I have came across names like iv2, qrz, bobFox, fred, asdfw2etgha, a, aa, aaa, aaaa, aaaaa and so on. Obviously, these programmers didn't want anyone to maintain their code, giving them a false sense of job security (they were wrong, as the code was rewritten). More often than not, the variables are named in such a way that you know their purpose, not necessarily their type. IE: thermalIndex, heatSignature, balance, firstName, zipCode, etc. The type would normally be derived from how the variable is utilized within its code block in relation to other lines.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
|
#16 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
I remember calling my variables "John", "Thingy", "Thangy", "counter1", "counter2", "Jack", "Blah", "Blahdieblah", "Blahdieblah1", "YourMom", etcetera when I was young
.Yeah, the good old times... |
|
|
|
|
|
#17 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Listen to IR, forget Hungarian notation. countThangy is considerably more useful than intBlahBlah. By the time you stack enough of those to know that you have a long pointer to a zero-terminated string running on hemorrhoid juice, you have made me puke in my boots, fire you, and hire another. You are, of course, entitled to your own opinion. Let us hope you don't declaim it loudly while standing in the unemployment line.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#18 | |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#19 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Wasn't directed at you, Poly, just a general observation exacerbated, no doubt, by writing Win16 code. You ever read all those types, and THEN move on to the macros?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#20 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|