|
|
|
| Non-WTF Job: C++ Developer at Good Grievance (Ronkonkoma, NY) |
| « Announcement: Free Sticker Week Reminder & Update | The Case of the Clueless Candidate » |
"Actually," the lead on Chris G's team said defensively, "this is a quite elegant solution for displaying data in a JSP. This way, we don't have to use the real object and can save memory."
And unlike the previous version checked in source control that only went up to ten, this ListBean goes to fourteen...
package com.initrodeglobal.util.presentation;
import java.util.ArrayList;
public class ListBean
{
String one="",two="",three="",four="",five="",six="",seven="",
eight="", nine="", ten="", eleven="", twelve="" ,
thirteen="", fourteen="";
public ListBean()
{
}
public ListBean( String one)
{
this.one=one;
}
public ListBean( String one, String two)
{
this.one=one;
this.two=two;
}
... snip ...
public ListBean( String one, String two, String three,
String four, String five, String six,
String seven, String eight, String nine,
String ten,String eleven, String twelve,
String thirteen , String fourteen)
{
this.one=one;
this.two=two;
this.three=three;
this.four=four;
this.five=five;
this.six=six;
this.seven=seven;
this.eight=eight;
this.nine=nine;
this.ten=ten;
this.eleven=eleven;
this.twelve=twelve;
this.thirteen=thirteen;
this.fourteen=fourteen;
}
public ListBean(ArrayList params)
{
for (int a=1;a<=params.size();a++) switch (a)
{
case 1 : if (params.get(0) != null)
this.one=params.get(0).toString();
break;
case 2 : if (params.get(1) != null)
this.two=params.get(1).toString();
break;
... snip ...
case 14 : if (params.get(13) != null)
this.fourteen=params.get(13).toString();
break;
}
}
// -- Setters
public void setOne( String one)
{
this.one=one;
}
public void setTwo( String two)
{
this.two=two;
}
... snip ...
//ED: By the setter of the ninth attribute, the argument name was
// understandably changed to entry. All those numbers are tiring
// to write!
public void setFourteen( String entry)
{
this.fourteen=entry;
}
// -- Getters
public String getOne()
{
return this.one;
}
public String getTwo()
{
return this.two;
}
... snip ...
public String getFourteen()
{
return this.fourteen;
}
}
|
Hooray!
Finally, we see someone who has mastered the FOR-CASE paradigm. Actually, he managed to mix it with the OO paradigm, making a new paradigm altogether. All we have to do is name the new paradigm and teach them to the new generations of programmers! |
|
This code is so elegant, it makes me want to poke out my own eyes with a fourteen pronged fork.
|
Re: These Go To Fourteen
2008-01-08 05:22
•
by
dkf
(unregistered)
|
If it was a good old sturdy IBM keyboard, you could use it to beat the programmer to death instead. Which would be doing the world a better favour. |
| « Announcement: Free Sticker Week Reminder & Update | The Case of the Clueless Candidate » |