|
And what's that ex != null for? 
|
|
|
|
|
For a moment I thought about that, but then I just gave up try ing.
|
|
|
|
|
I think he got NullReferenceException so added that condition to avoid the error
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
Well, eventually it will, but detrimentously: the StackOverflowException won't be dealt with at this place.
|
|
|
|
|
The code is complete bullshit!
- What is the point of using ref?
objWord is not assigned any value. I guess, the author has never heard of reference types and value types, doesn't differentiate them and also is a former C++ developer. - If an exception is generated, a variable, representing it, can NEVER be
null . And the check
ex != null just looks stupid. - Also, it will sound very upsetting for the author, but if the exception mentioned above is ever generated, he is about to face an infinite recursion, hence he will also face the full power of the
StackOverflowException .
Summarizing the above, I'd say he better work in McDonald's. To get a chance to become a manager , that is a real chance to afford Ford Mustang GT... someday .
lifecycle of a lifecycle of a lifecycle
|
|
|
|
|
Lol. Btw, to add some background, I'm a contractor at a company that bought another company in the same business. A very successfull software came in the bundle (and of course they plan to merge its features into their own software), but little to no documentation came along and now people are having a hard time figuring bugs things out.
It is BS at so many levels, indeed, but the other products make up for it.
|
|
|
|
|
The good news is that developer's probably not writing code anymore. Probably your boss by now!
"If Crime Fighters fight crime, and Fire Fighters fight fire, what do Freedom Fighters fight?" - George Carlin
|
|
|
|
|
<voice type="Ebeneezer Scrooge"> Bah. dumb bugs </voice>
|
|
|
|
|
Few days back I came across following code
if(gender.contains('male'))
{
DoMaleThing();
}
else
{
DoFemaleThing();
}
Was not sure whether my colleague was knowing that 'female' option also contains 'male' in it.
Had a great laugh with my TL when I showed him this.
Do not go where the path may lead. Go instead where there is no path and leave a trail.
|
|
|
|
|
Well... Didn't you know it would have been discriminating otherwise 
|
|
|
|
|
Ohh..now I understood the code who wrote this is a lady
Do not go where the path may lead. Go instead where there is no path and leave a trail.
|
|
|
|
|
If you put some effort to it you can mess up an enum too.
|
|
|
|
|
Lost in translation? It would work in most other languages.
Also, he could consider: ladies first!
|
|
|
|
|
Years ago, I worked on a pension system and one of the calculations was to find the retirement age, the standard function was [converted to C# as I can't remember Prolog]:
int normalRetirementAge()
{
if (isMale())
{
return 65;
}
else
{
return 60;
}
}
Now, one client had everyone on their scheme retire at 60 irrespective of sex, the proposed solution by the PFY:
int normalRetirementAge()
{
if (isMale())
{
return 60;
}
else
{
return 60;
}
}
speramus in juniperus
|
|
|
|
|
Sure, gotta leave the if/else logic in there in case it is needed later.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
|
RyanDev wrote: Perhaps it's like mailman.
which evolved to "letter carrier" (because "mailperson" still sounds like it is referring to "male")
like "stewardess" became "flight attendant"
|
|
|
|
|
After Jenkins built the setups, it starts a virtual machine, installs our programs there, and performs some integration tests.
Just recently our server has been migrated from VMWare Server to vSphere.
In order to start with a "clean" machine, a snapshot is restored - that can be done only when the machine is powered off. But I get an error when trying to power off the virtual machine:Quote: The attempted operation cannot be performed in the current state. Well, true, the virtual machine is already powered off, and consequently it cannot be powered off... Logic, isn't it?
|
|
|
|
|
Yes, it is. But it would be more logical if we wouldn't be able to power off the machine, which is already powered off. 
|
|
|
|
|
AFAIK, VBox simply returns 0 (Success) if you try to power off a machine that is already powered off through the VBox Management API, which makes sense to me.
<voice type="Ebeneezer Scrooge"> Bah. dumb bugs </voice>
|
|
|
|
|
As found in some VB code:
Try
Catch ex As Exception
End Try
I may be posting a lot of these things here, as I finally got hold of the VB code that was for the previous system, that we're re-writing in C#.
It's bound to be full of gems like this.
Marc
|
|
|
|
|
The .net equivalent of On Error Resume Next
|
|
|
|
|
I have seen that kind of code fail. Don't ask how, as I don't know.
Getting information off the Internet is like taking a drink from a fire hydrant.
- Mitchell Kapor
|
|
|
|
|
You mean there was no code at all between Try and Catch , nor between Catch and End Try ?
At least, he ought to have added an empty Finally then.
|
|
|
|
|
Bernhard Hiller wrote: You mean there was no code at all between Try and Catch , nor between Catch and End Try ?
That is correct. I did not remove any code. It was a completely empty try-catch block.
Marc
|
|
|
|