|
Every once and a while I find a little gem in my own code. I encountered this one today:
if (new Project(pid).HasSubstatus)
useSubStatus = true;
else
useSubStatus = false;
if (useSubStatus)
...
|
|
|
|
|
Don't we all...
I've today found (my code) that was something like:
set
{
if(value!=null)
{
DoSomething();
Trace.Write(value.ToString());
}
else
{
Trace.Write(value.ToString());
}
}
Apart from ugly way to set boolean variable,
eggsovereasy wrote: new Project(pid).HasSubstatus
this just screams "static method"*.
*assuming the language supports it and there aren't any hidden side effects in Project constructor
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
|
dnh wrote: eggsovereasy wrote:
new Project(pid).HasSubstatus
this just screams "static method"
It is not a static method.
*jaans
|
|
|
|
|
But it should be, so I can do:
Project.HasSubStatus(projectId);
|
|
|
|
|
Maybe to determine whether "HasSubstatus" full loading of an object is required AND the object itself is not used anymore AND the useSubStatus is used later.
Anyway, nothing justifies writing
if (new Project(pid).HasSubstatus)
useSubStatus = true;
else
useSubStatus = false;
instead of
useSubStatus = new Project(pid).HasSubstatus;
Greetings - Gajatko
|
|
|
|
|
<br />
If Var1= True then<br />
M_1:<br />
Do some stuff<br />
Else<br />
DO other Stuff<br />
Goto M_1<br />
end if
-----------------
If Var1=True then Goto M2<br />
'Some Code.<br />
Goto M3<br />
M2:<br />
'Other Code<br />
Exit sub<br />
M3:<br />
'Code
------------------
Class Order<br />
'Some Definitions and code<br />
End Class<br />
<br />
<br />
Module1<br />
Public Sub SaveOrder (order as Order)<br />
Code to save the Order<br />
End sub<br />
End module
--------------------------
You have no idea what it's to work with someone like that!!! the worst thing..... He is my boss!!!!!!
-- modified at 23:36 Saturday 18th August, 2007
|
|
|
|
|
I share your feelings, gladdly our boss stopped programming
at least on the projects I work on.
But I can see the madness in the eyes of the guy who have the
benefit of his help.
Thats one of the reasons that dinosaurs shouldn't be allowed to
program in the first place.
codito ergo sum
|
|
|
|
|
The thing is, you can be a young crocodile today but you never know when you're becoming a dinosaur.
|
|
|
|
|
Think about your future or at least your career...
Greetings from Germany
|
|
|
|
|
I am your boss. YOU'RE FIRED! BE OUT OF THE BUILDING IN 5 MINUTES!
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
martin_hughes wrote: I am your boss. YOU'RE FIRED! BE OUT OF THE BUILDING IN 5 MINUTES
But first i'm getting my can of soup
|
|
|
|
|
lol, i just hope my boss could visit this site and learn a little!
|
|
|
|
|
martin_hughes wrote: YOU'RE FIRED! BE OUT OF THE BUILDING IN 5 MINUTES!
Rephrasing the sentence a bit; If the building is fire, everyone should evacuate it sooner the better. 5 minutes is too long time to survive the flames.
|
|
|
|
|
I just remember another one!!!!!
Public Class Order<br />
Public Sub New (CmbClient as Combobox, dtpOrder as DatePicker, etc. etc.)<br />
End Sub<br />
End Class
That's what i call OOP!
|
|
|
|
|
Have you ever seen FORTRAN 66, BASIC as it was implemented on an Apple IIe? In the light of those languages, this code seems quite reasonable. If you can, try to find out the background of your Boss' and that will help explain why he does what he does.
Phil
|
|
|
|
|
Think of it like this: he didn't hire you to fire you because you think his coding is bad. In fact he hired you because you're the better programmer
--
Thany
|
|
|
|
|
thany.org wrote: In fact he hired you because you're the better programmer
True. The recruitment process should weigh the most optimistics ones and how best it can be benefit for the organization's growth besides helping out the candidate's career mutually.
|
|
|
|
|
This is why some bosses should not be programmers
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
RoswellNX wrote:
xthumbnail-orig-image
But I can not find this attribute in W3C HTML description also?
|
|
|
|
|
Well, i didn't even bother checking if such thing existed, but it's the first time i'm seeing something like this as well. I'm assuming it's just some auto-generated IE-specific Microsoft crap. At least the the meta generator is labeled as Frontpage 6.0
Roswell
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
RoswellNX wrote: At least the the meta generator is labeled as Frontpage 6.0
I agree. The HTML generated by it (and its successor) is horrendous really. It makes the applications to just get locked down to IE Shop, making us shiver before our Project Manager on accounts of cross-browser compatibility.
|
|
|
|
|
And this Frontpage behavior is what pushed me to writing my own markup (and later code as went into web dev) four years ago (otherwise i would have stuck to computer graphics and illustration). When i found out that on Macs even under IE, the "IE-specific" stuff rendered horribly. Apparently Ms stepped into their own pile of sh*t :->
Roswell
P.S. I hope you've seen the updated 1st post, now that i've realized that i forgot to escape a few of the angle brackets
"Angelinos -- excuse me. There will be civility today." Antonio VillaRaigosa City Mayor, Los Angeles, CA
|
|
|
|
|
RoswellNX wrote: Apparently Ms stepped into their own pile of sh*t
Ewwwwwwwwwwwww
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|