Comment On The Andy Pattern

Although Andy had left for greener pastures generations ago, everyone on Julius's team knows Andy. Actually, it's hard not to know him. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: The Andy Pattern

2011-11-28 09:03 • by Andy (unregistered)
Andy was here frist

Re: The Andy Pattern

2011-11-28 09:03 • by SeySayux (unregistered)
Frist!

(Yea yea akismet)

Re: The Andy Pattern

2011-11-28 09:08 • by ubersoldat
public class Andy extends Object{
...
}

public class X extends Andy

Where X is every class in your codebase.

Re: The Andy Pattern

2011-11-28 09:09 • by Lockwood
My database stuff seems to have a small trait of Andyism in it. There are little bits of Andy (75%) throughout:
SELECT foo FROM bar WHERE a = @a AND b = @b AND ...

Re: The Andy Pattern

2011-11-28 09:10 • by Anonymous (unregistered)
367888 in reply to 367886
ubersoldat:
public class Andy extends Object{
...
}

public class X extends Andy

Where X is every class in your codebase.

It's too early for horror stories.

Re: The Andy Pattern

2011-11-28 09:11 • by frits
Andy must have been part of a pair programming team (evidenced by the frequent use of "we"). Unfortunately for his partner, Andy was the only one allowed to drive. Andy mut've been some kind of Senior Software Engineer.

Re: The Andy Pattern

2011-11-28 09:15 • by nag_geoff (unregistered)
Personally I see this as a failure of the code review team. How did this code reach beyond the development machine is a mystery to me?

A "propah" code review would have eliminated such errors in the future.

It is imperative that the programming team mend its ways and have some sort of process before releasing code to production.

Does anyone care about variable names if the code does what it is supposed to?

Re: The Andy Pattern

2011-11-28 09:19 • by Franky (unregistered)
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Re: The Andy Pattern

2011-11-28 09:21 • by Steve The Cynic
Andy would be the reason why a baseball bat is an essential tool for code reviews.

Re: The Andy Pattern

2011-11-28 09:22 • by nag_geoff (unregistered)
367894 in reply to 367893
Steve The Cynic:
Andy would be the reason why a baseball bat is an essential tool for code reviews.


Resorting to violence or threats thereof, will halt the meteoric rise of human civilization.

Re: The Andy Pattern

2011-11-28 09:27 • by Oregon Trail (unregistered)
Here lies andy
peperony and chease

Re: The Andy Pattern

2011-11-28 09:28 • by YF (unregistered)
367896 in reply to 367892
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Not only that, but if the snippets are accurate, it does not follow consistent identation/spacing, consistent word case, consistent naming convention, etc etc

Captcha: valetudo... ouch, just perfect, I'm afraid

Re: The Andy Pattern

2011-11-28 09:29 • by The poop of DOOM
367897 in reply to 367892
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D

Re: The Andy Pattern

2011-11-28 09:31 • by YF (unregistered)
367898 in reply to 367893
Steve The Cynic:
Andy would be the reason why a baseball bat is an essential tool for code reviews.

I regularly think about a baseball bat when facing some of the ex-coders of my current project... should I worry?

Re: The Andy Pattern

2011-11-28 09:33 • by The poop of DOOM
367899 in reply to 367896
YF:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Not only that, but if the snippets are accurate, it does not follow consistent identation/spacing, consistent word case, consistent naming convention, etc etc

Captcha: valetudo... ouch, just perfect, I'm afraid

You got inconsistencies in languages themselves, too. In PHP, for example, some functions start with, eg. str_, while others don't have the underscore. You also have parameters that follow ($needle, $haystack) for some functions, and other, similar functions have ($haystack, $needle). If such things are built into a language, then can you still call it a WTF? It seems more like that guy's been coding the same way languages've been made.

Re: The Andy Pattern

2011-11-28 09:39 • by Severity One
367900 in reply to 367899
The poop of DOOM:
In PHP, for example, some functions start with, eg. str_, while others don't have the underscore. You also have parameters that follow ($needle, $haystack) for some functions, and other, similar functions have ($haystack, $needle). If such things are built into a language, then can you still call it a WTF?
About here, somebody would make the obligatory remark about PHP and TRWTF.

Re: The Andy Pattern

2011-11-28 09:44 • by YF (unregistered)
367901 in reply to 367900
Severity One:
The poop of DOOM:
In PHP, for example, some functions start with, eg. str_, while others don't have the underscore. You also have parameters that follow ($needle, $haystack) for some functions, and other, similar functions have ($haystack, $needle). If such things are built into a language, then can you still call it a WTF?
About here, somebody would make the obligatory remark about PHP and TRWTF.


TRWTF is PHP

There! Lunch time, can I go now?

Re: The Andy Pattern

2011-11-28 09:45 • by My Name Is Missing (unregistered)
What would come of coupling between Andy and the Brillant Paula Bean?

Perhaps a new horror movie series for programmers?

Simple Math

2011-11-28 09:58 • by DoucheBag (unregistered)
367903 in reply to 367902
My Name Is Missing:
What would come of coupling between Andy and the Brillant Paula Bean?

Perhaps a new horror movie series for programmers?


Two negatives Make a positive...

Re: The Andy Pattern

2011-11-28 09:58 • by frits
367904 in reply to 367897
The poop of DOOM:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D
Actually, it's an optimization using string interning ;).

Re: The Andy Pattern

2011-11-28 09:58 • by zelmak
367905 in reply to 367888
Anonymous:
ubersoldat:
public class Andy extends Object{
...
}

public class X extends Andy

Where X is every class in your codebase.

It's too early for horror stories.


Sorry, we already have that:

public interface LoggableObject {
...
}

public abstract AbstractLoggableObject implements LoggableObject {
...
}

and everything is a descendent of AbstractLoggableObject.

Re: The Andy Pattern

2011-11-28 10:00 • by TPS Reports (unregistered)
367906 in reply to 367899
The poop of DOOM:

You got inconsistencies in languages themselves, too. In PHP, for example, some functions start with, eg. str_, while others don't have the underscore. You also have parameters that follow ($needle, $haystack) for some functions, and other, similar functions have ($haystack, $needle). If such things are built into a language, then can you still call it a WTF?


If that language is PHP, then yes, we can definitely still call it a WTF.

Re: The Andy Pattern

2011-11-28 10:00 • by Weps
if x and y then uh oh

Re: The Andy Pattern

2011-11-28 10:01 • by Zapp Brannigan (unregistered)
Writing to an LCD? Is this code for an embedded system?

Re: The Andy Pattern

2011-11-28 10:01 • by thylux (unregistered)
That reminded me of the song by The Killers: Andy You're a Star! (www.youtube.com/watch?v=xY0y-gOe78c)

Re: The Andy Pattern

2011-11-28 10:05 • by WC (unregistered)
367910 in reply to 367908
Zapp Brannigan:
Writing to an LCD? Is this code for an embedded system?


.pde is an extension commonly used by Arduino code, so I'm guessing that it is, yes.

Re: The Andy Pattern

2011-11-28 10:06 • by Nagesh
367911 in reply to 367904
frits:
The poop of DOOM:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D
Actually, it's an optimization using string interning ;).


Why not use constant here?

Re: The Andy Pattern

2011-11-28 10:06 • by mikedjames
Its an RFID reader for a tennis game featuring Andy Murray. Simples.

Re: The Andy Pattern

2011-11-28 10:12 • by C-Octothorpe
367913 in reply to 367889
frits:
Software Engineer
This made me giggle because it reminds me of a the "Systems Engineer" I once worked alongside who would lay lan cable all day...

Re: The Andy Pattern

2011-11-28 10:12 • by steenbergh
Reminds me of Rachelle.

//TODO: Andy

Re: The Andy Pattern

2011-11-28 10:12 • by C-Octothorpe
367915 in reply to 367911
Nagesh:
frits:
The poop of DOOM:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D
Actually, it's an optimization using string interning ;).


Why not use constant here?
He did... Didn't you see the quoted 'R'?

Re: The Andy Pattern

2011-11-28 10:14 • by boog
367916 in reply to 367889
frits:
Andy must have been part of a pair programming team (evidenced by the frequent use of "we"). Unfortunately for his partner, Andy was the only one allowed to drive. Andy mut've been some kind of Senior Software Engineer.
Or maybe the partner was so ashamed, he advised Andy to sign his code this way.

Re: The Andy Pattern

2011-11-28 10:14 • by PedanticCurmudgeon
367917 in reply to 367894
nag_geoff:
Steve The Cynic:
Andy would be the reason why a baseball bat is an essential tool for code reviews.
Resorting to violence or threats thereof, is how governments operate.
FTFY

Re: The Andy Pattern

2011-11-28 10:24 • by The poop of DOOM
367918 in reply to 367911
Nagesh:
frits:
The poop of DOOM:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D
Actually, it's an optimization using string interning ;).


Why not use constant here?

Because the week after, it'd be "S". That's not very constant, is it, if he has to change it each week?

Re: The Andy Pattern

2011-11-28 10:34 • by Nagesh
367919 in reply to 367915
Yes, but i am saying use constant like this.


private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
const string andy = "R";
serialPort1.Write(andy);
}
}



I thinking that andy like to see his name in coed all time. So this blatent misuse of variable naming conventions.

Re: The Andy Pattern

2011-11-28 10:36 • by Nagesh
367920 in reply to 367918
The poop of DOOM:
Nagesh:
frits:
The poop of DOOM:
Franky:
I like how every sample contains an additional little wtf in the from of an unused variable, etc. etc.

Reread it again and just noticed that little pearl

private void button34_click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
string andy = "R";
serialPort1.Write("R");
}
}

Yup, not used at all :D
Actually, it's an optimization using string interning ;).


Why not use constant here?

Because the week after, it'd be "S". That's not very constant, is it, if he has to change it each week?


Who is passing the "S" in that case? Are you seeing thing that I am not seeing or are you his boss / coleage / subordinete?

Re: The Andy Pattern

2011-11-28 10:38 • by frits
367921 in reply to 367919
Nagesh:
I thinking that andy like to see his name in coed all time.
Who doesn't like to see their "andy" (or whatever you call yours) in a coed?

Re: The Andy Pattern

2011-11-28 10:44 • by _ (unregistered)
367922 in reply to 367921
frits:
Nagesh:
I thinking that andy like to see his name in coed all time.
Who doesn't like to see their "andy" (or whatever you call yours) in a coed?
I don't like to name mine because then I feel bad when I beat it...

Re: The Andy Pattern

2011-11-28 10:46 • by Andy (unregistered)
No I'm not this Andy!

Re: The Andy Pattern

2011-11-28 10:46 • by zirias (unregistered)
367924 in reply to 367897
The poop of DOOM:
string andy = "R";

Yup, not used at all :D

So, Andy is useless you say?

Re: The Andy Pattern

2011-11-28 10:50 • by OldCoder (unregistered)
367925 in reply to 367894
nag_geoff:

...the meteoric rise of human civilization.

Now you're being silly!

Re: The Andy Pattern

2011-11-28 10:51 • by tragomaskhalos (unregistered)
I assume that the intention of the dramatic comment

// activate help variable

is to impress readers who might otherwise think that Andy is an idiot who's overly fond of superfluous temporaries.

Re: The Andy Pattern

2011-11-28 10:56 • by Paul (unregistered)
367927 in reply to 367890
nag_geoff:
Does anyone care about variable names if the code does what it is supposed to?


Depends. Were you planning to maintain or re-use the code at all?

Re: The Andy Pattern

2011-11-28 10:56 • by randyandy (unregistered)
367928 in reply to 367890

Does anyone care about variable names if the code does what it is supposed to?

No, variable names are superfluous. To be sure we're not mislead by variable names, we have a SCM commit hook that runs the source through an obfuscator.

Re: The Andy Pattern

2011-11-28 10:59 • by #254 (unregistered)
Andy walks with me,
Andy talks with me,
Andy tells me I am his own.

Re: The Andy Pattern

2011-11-28 11:09 • by Zylon
This article gave me visual hallucinations. By the second code snippet, I was starting to see the code written in crayon.

ANDY MADE THIS. I'M HELPING! FRANK AND BEANS! FRANK AND BEANS!

Re: The Andy Pattern

2011-11-28 11:14 • by Jonathan (unregistered)
367931 in reply to 367910
TRWTF is Arduino used in production.

Re: The Andy Pattern

2011-11-28 11:22 • by Rick
367932 in reply to 367898
YF:
Steve The Cynic:
Andy would be the reason why a baseball bat is an essential tool for code reviews.

I regularly think about a baseball bat when facing some of the ex-coders of my current project... should I worry?

If you own a baseball bat, but don't actually play baseball, then yes you should worry.

Re: The Andy Pattern

2011-11-28 11:28 • by CrisW
367933 in reply to 367925
OldCoder:
nag_geoff:

...the meteoric rise of human civilization.

Now you're being silly!


Totally. Meteors don't rise, they fall.

Re: The Andy Pattern

2011-11-28 11:28 • by Toon (unregistered)
This WTF just put a smile on my face. I wouldn't smiling if I'd been the poor sap who mailed this in, though.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment