Posted By: Klaus Enevoldsen | Mar 14th, 2008 @ 12:11 AM
page 1 of 2
Comments: 32 | Views: 3237
Klaus Enevoldsen
Klaus Enevoldsen
Development has never been easier nor more complicated...

An old colleague of mine used to name member in code after Disney Cartoon Characters.

His code was very hard to read! I usually name the members with a relevant name, but there is just one little thing I always do... I always name members of the type System.Text.StringBuilder: “BobTheStringBuilder” Smiley

Do you have any funny/annoying habits like this?

Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda
Yeah, but usually it involves bad words Smiley
Maddus Mattus wrote:
Yeah, but usually it involves bad words


i dont think i want to use your library
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
I once noticed that MAPI has a structure called SExistRestriction. Big Smile

On a sidenote, prefixing classes with C is bad enough, but who thought prefixing structures with S was a good idea?
blowdart
blowdart
Peek-a-boo
while (!cowsComeHome)
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
blowdart wrote:
while (!cowsComeHome)

That'd work better in VB:

Do Until cowsComeHome

Loop

Tongue Out
zian
zian
Exploding heads since 1988

I've made literary allusions in variable names and documentation such as referring to a pile of Std_Logic_Vectors (in VHDL) as the 14 deadly sins.

In VB programs, I tend to give functions personalities such as calling a function "buildBadLocationMessage" for a function that cobbles together an error message.

Dr Herbie
Dr Herbie
Horses for courses

I used to know someone who always named for loop variables 'The SakeOfIt' so he would loop ...

for (TheSakeOfIt ...


Herbie

Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda
I've worked with a programmer who uses a bool instead of a void in his methods.

try
{
}
catch
{
return false;
}
return true;

blnContinue = DoSomething();

if(!blnContinue) MessageBox.Show("DoSomething went wrong");

Good luck finding the method that threw the exception!

I've developed a somewhat aversion for the name blnContinue now,..
Massif
Massif
aim stupidly high, expect to fail often.
I've tended to consistently name any parameters which get altered by a function "victim".

e.g.

void MakeLowerCase(char* victim)
{
...
}

(except of course, I never ever wrote a MakeLowerCase function, that's just an example.)
stevo_
stevo_
Human after all
Maddus Mattus wrote:
I've worked with a programmer who uses a bool instead of a void in his methods.

try
{
}
catch
{
return false;
}
return true;

blnContinue = DoSomething();

if(!blnContinue) MessageBox.Show("DoSomething went wrong");

Good luck finding the method that threw the exception!

I've developed a somewhat aversion for the name blnContinue now,..


Jesus Christ, how can you even work with someone who doesn't even understand the core concepts of the paradigm he uses..

That would be seriously damaging to a project to allow someone to develop it like that..

Tell me please that he doesn't refactor other peoples code to be his 'right'.
W3bbo
W3bbo
The Master of Baiters
Klaus Enevoldsen wrote:
Do you have any funny/annoying habits like this?


Exception handling.

If I were catching a simple Exception I'd just put:

} catch(Exception ex) {

If it's a different class of exception, I'd prefix the identifier, like:

} catch(DivideByZeroException dex) {

Then it follows:

} catch(SerializationException sex) {

...totally unintended btw.
Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda
stevo_ wrote:
Jesus Christ, how can you even work with someone who doesn't even understand the core concepts of the paradigm he uses..

Well,.. The projects were small enough for him to code at it alone. And the project managers really liked him because he could get the job done on time and without little fuzz.
stevo_ wrote:
That would be seriously damaging to a project to allow someone to develop it like that..

Tell me please that he doesn't refactor other peoples code to be his 'right'.

Last I heard he was lead developer of a small .Net group somewhere.

Most horrific thing I had to refactor what this guy wrote, was a XML parser. It compared two 60Mb XML files and injected records into a database. Ofcourse you and I would use XMLDiff, but this guy had a gazillion methods for reading nodes. ALL returned a boolean! So afther 1.5 hours of parsing, CompareXMLFiles() returned false,..

AAAAAAAAAAAAAAAAAAAAAARGGGGGGGGGHHHHHHHHHHH!!!!!!!!!!!

if(!blnContinue) blnContinue = RollBackTransaction();

Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda
W3bbo wrote:

} catch(SerializationException sex) {

...totally unintended btw.


You kinky perverted young man!
Harlequin
Harlequin
http://twitter.c​om/TrueHarlequin
I've always liked PixelFormat.DontCare Cool
harumscarum
harumscarum
out of memory
prcExecutePerson
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
I have lots of these in my (not work) code:

free(tibet);
free(beer);
free(four);
and
free(zer);

It makes reading my code more amusing, even if it is at the expense of clarity.
Tensor
Tensor
Im in yr house upgrading yr family
I allways abbreviate Assembly to (I need to watch my language). EDIT *sigh* the first three characters.
W3bbo
W3bbo
The Master of Baiters
evildictaitor wrote:
I have lots of these in my (not work) code:

free(tibet);
free(beer);
free(four);
and
free(zer);

It makes reading my code more amusing, even if it is at the expense of clarity.


I wrote this a few hours ago in production code:

        Object ICloneable.Clone() {
            Foo dolly = new Foo();
            dolly.Bar = Bar;
            dolly._exp = _exp;
            dolly._data.AddRange( _data );
            return dolly;
        }
Yggdrasil
Yggdrasil
Pour me a cab, 'cause I can't drink no more.
In my VB6 days I would always do error handling with On Error Goto Hell.
I had a guy do this on my team and I gave him a bad review, this is a sour topic of mine.  I hate it when people goof around with the code base it really irritates me!
Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda
ElucidWeb wrote:
I had a guy do this on my team and I gave him a bad review, this is a sour topic of mine.  I hate it when people goof around with the code base it really irritates me!


Why wait till the review? Seems like a bit late to me, he could have rewritten it.
Massif
Massif
aim stupidly high, expect to fail often.
Tensor wrote:
I allways abbreviate Assembly to (I need to watch my language). EDIT *sigh* the first three characters.


Abbreviating Assembly to "(I need to watch my language)" would have been funny.
I don't have anything that I do all the time, though I do occasionally tweak a variable name to be funny if I spot an opportunity too good to pass up.  I also like to turn Talk Like A Pirate Day into code like a pirate day, and make any variable names I write be pirate references.
figuerres
figuerres
???
Massif wrote:
I've tended to consistently name any parameters which get altered by a function "victim".

e.g.

void MakeLowerCase(char* victim)
{
...
}

(except of course, I never ever wrote a MakeLowerCase function, that's just an example.)


well I try to *NOT* modify params...

but then I come from the old "C" style of

f()  is a FUNCTION   so something like that would be

string MakeLowerCase( string TextIn){
}

I only use out x in C# when .net has already asked for it like with

Int32.TryParse() for example.
page 1 of 2
Comments: 32 | Views: 3237
Microsoft Communities