|
I have a library with an ExecuteScaler method (instead of ExecuteScalar ). I wanted to change it when I first noticed it was wrong but I was scared at the prospect of having to find which other programs where using it and update them all.
Everybody is entitled to my opinion
|
|
|
|
|
Marc Clifton wrote:
I ever encounter a variable like "gr8" I will kill that programmer!
And I'll be more than happy to provide the weapon.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I use camel caps, although until today I didn't know it had a name.
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Me blog, You read
|
|
|
|
|
Gary Kirkham wrote:
A working Program is one that has only unobserved bugs
false. it is also an easy "debuggable" one...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
it is also an easy "debuggable" one
I am not sure what that means, however, if one of my programs has a bug then I don't know about it...because any bugs that ARE found are corrected immediately...and if my program has a known bug, then, by my definition, it is not a working program. So my statement is true based on my stipulations. I cannot evaluate your statement due to lack of understanding on my part.
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Me blog, You read
|
|
|
|
|
ok. two things...
imagine the case you develop a software, but not alone... you're in a big team, and you cannot do whatever you want 'cause the guys working with you won't understand what you tryied to do...
the second case is when you read back a project (of your own of not) to give it some updates... if you cannot read it, you just let like it is, or throw it to the "Windows Recycle-Bin"...
understand what i want to explain here ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Gary Kirkham wrote:
am not sure what that means, however, if one of my programs has a bug then I don't know about it...because any bugs that ARE found are corrected immediately...and if my program has a known bug, then, by my definition, it is not a working program. So my statement is true based on my stipulations. I cannot evaluate your statement due to lack of understanding on my part.
Not true! Some year ago I had a Medical billing program that worked correctly until I notice a bug and fix it... there was another bug that I didn't find at that time that acutally made the application work correctly. So two wrongs made a right and the buggy program was a working program!
|
|
|
|
|
Rick Crone wrote:
worked correctly until I notice a bug and fix it
If it worked correctly then it didn't have a bug. Why would you need to fix something that wasn't broken? By my definition, a bug is something that causes a program to not function as designed.
If the following if statement produces the correct results
if(x)
{
....
}
Is the following statement a bug?
if(!!x)
{
....
}
No
now, if I decide that the programmer got carried away and meant to have only one ! and I correct the "bug" by doing this
if(!x)
{
....
}
I have now created a bug that didn't exist before...now I have to "debug" it again
if(x)
{
....
}
The fact that your "Two Wrongs" program worked as designed doesn't necessarily mean it had bugs, maybe it just wasn't optimally coded. That is by my definition...you might consider a consistently misspelled variable name to be a "bug" and feel the need to correct it...I do not.
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Me blog, You read
|
|
|
|
|
|
|
|
i learned one thing... didn't know that my naming convention was Hungarian one...
i'm with you mike
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
|
What kind of formating is CListCtrl?
-prakash
|
|
|
|
|
Looks more like a classname than a variable name.
--
Meski
|
|
|
|
|
following an official directive a few years ago that everyone had to use hungarian notation in our UNIX code i started doing so.
given that we were using VI as our editor, were writing in C, and often ended up with long complicated functions (long story, but often the best solution) encoding basic information in the variable names turned out to really help me.
of course, most people didn't bother following the directive to use hungarian, and i found i needed to settle on a tweaked form of "standard" hungarian. all of the windows types didn't exist, so codes for them were of limited use
when i moved to VIM i gained access to word completion, and to better features for finding out the type of a variable. still i found it easier to tell strings, ints, bools and other such basic types apart at a glance based on their names.
having got used to naming variables this way, and finding that it helps to reduce code errors i have stuck with it now that i have started windows programing in the .NET IDE. i know the IDE will tell me things about the variables, but this tends to require moving the mouse
it is easier to have the info in the names, than it is to dig the mouse and mouse cable out from under a book, or pile of paper, and use it
zen is the art of being at one with the two'ness
|
|
|
|
|
Sometimes - DoSomethingButton
Sometimes - isVar
But hungarian notation - very bad style for present, because datatype doesn't have matter against functionality of variable.
|
|
|
|
|
private string codeValue
public string CodeValue
{
get {codeValue}
}
public bool TestValue(string valueToTest)
{
bool isValid;
...
return isValid;
}
I use Camel to private and internal variables and Pascal to methods and properties.
The classes and samples of MSDN follows this way, isn't?
Alexsander "Axia" Antunes
|
|
|
|
|
My convention is fairly simple: The name of the variable has to succinctly describe what it's for and the case style depicts the scope.
First of all, I write in straight C but I don't use C-style. All my names use a variation of Pascal and camel case. For global variables, the first character is a lower-case 'g', then I use PascalCase for the remainder. A function parameter gets PascalCase and a local (automatic) variable gets camelCase. Oh, and #defines are ALLCAPS (sometimes with an underscore between the words if that helps clarify the name).
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
|
I like to simply keep my variable names SHORT and consistently named so
that my code in turn is SHORT and easy to READ...
throwing all those extra consonants in there just makes the
legibility plummet...
I also carefully indent and whitespace my code.
I mean come ON, when was the last time you looked through your
code and went, hmmm, ah yes, that's a plptstr_something.
No need for me to look up 8 lines and see what it's declared as!
I can see right HERE that it's declared as a pointer to some
kind of long string thing... uhhh...
Hmmm, now what is this variable USED for again?
I can't make out WHAT this stupid loop is doing...
WHO WROTE THIS CRAP, anyway???
hungarian breaks KISS...
...Steve
|
|
|
|
|
Oh, so you're the one who wrote this code:
CVg vg;
CVG vG;
while(g != vg.g(G) && G == vG.G(g))
{
for(iG=gI; iG<Ig; ++iG)
{
vg.hnx(g.G(vG.hqX()));
vG.nx(G.qx(vg._i));
}
}
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
uhhh, that's short, but not consistently named...
whatever...
whenever I have to pick up someone else's code,
I totally reformat it into my preferred conventions.
Much easier to check for errors that way.
And well worth the time i spend doing it.
But if the code belongs to someone else,
I leave it ugly.
(Or convert it to my format to understand it and
make the changes in "ugly format")
When you get right down to it, the format you
use is the format that works best for you.
I'm picky.
You'll find my code rather terse and extremely
neat.
I don't particularly care how others write their
code... Whatever works...
It's a religious thing.
Not gonna try to force my beliefs on others...
...Steve
|
|
|
|
|
I was just giving you a hard time, Steve. Did you not see the: at the end...
~Nitron.
ññòòïðïðB A start
|
|
|
|