|
Thats really a nice example for not thinking while coding.
Cheers
You have the thought that modern physics just relay on assumptions, that somehow depends on a smile of a cat, which isn’t there.( Albert Einstein)
|
|
|
|
|
We should request the thread to be clipped from there and pasted over here.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Might I suggest using a permalink[^] to the horror instead? Otherwise it'll soon be necessary to click the next page button 20x before getting to the post in question.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
modified on Wednesday, June 17, 2009 3:27 PM
|
|
|
|
|
Yeah, that got me there, the other didn't.
|
|
|
|
|
|
Wow...Just wow !!! I live for piece of crap like that...
And after the laughter eventually one thing crosses my mind.
"Is that man paid for his programming services ?".
|
|
|
|
|
I have fallen in love in this part:
int num = 0x20;
int num2 = num / 4;
int num3 = num / 2;
int num4 = 13;
int num5 = 0x37;
int num6 = 10;
int num7 = 10;
double num8 = double.Parse(this.lblZoomFactor.Text) / 100.0;
int num9 = (int)(num * num8);
int num10 = (int)(num2 * num8);
int num11 = (int)(num3 * num8);
int width = (int)(num5 * num8);
int num13 = (int)(num6 * num8);
int height = ((num4 + num9) + num10) + num11;
int num15 = ((bitmapWidth - 0x10) - (2 * num13)) / width;
int num16 = (bitmapWidth - (2 * num6)) - (width * num15);
...
int num18 = (num17 / num15) + 4;
int num19 = num18 * (height + num13);
int y = num13;
int num21 = 0;
num21++;
int num23 = num21 % num15;
...
int num25 = (y + num4) + num10; (not so funny, though)
Greetings - Jacek Gajek
|
|
|
|
|
Parts of it look like some autogenerated VS code
modified 19-Nov-18 21:01pm.
|
|
|
|
|
I think, this code is a result of Reflector disassembling
|
|
|
|
|
Saw this one yesterday via DotNetKicks[^]:
public static class NumberHelpers
{
public static ApplicationException EvenOrOdd(int integer)
{
if (integer % 2 == 0)
{
return new ApplicationException("The integer is even.");
}
else
{
return new ApplicationException("The integer is odd.");
}
}
}
Usage:
protected void btnTest_Click(object sender, EventArgs e)
{
try
{
throw NumberHelpers.EvenOrOdd(Convert.ToInt32(txtIntToTest.Text));
}
catch (ApplicationException ex)
{
litResult.Text = ex.Message;
}
}
Brilliant! I'm going to utilize this beautiful exception-based development pattern into our code base immediately!
Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon
Judah Himango
|
|
|
|
|
I can bet that this gem is created from a former Java programmer.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word.
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
Why would you assume that?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
Can't you see the really GOOD think this solution is?
If the string is not a number you will also get the right message. It can't be simple, can it?
Hahahahaha
|
|
|
|
|
Well...that's the beauty of that Snippet.
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
Finally, a usage of exceptions that I whole-heartedly support!
--Mike--
|
|
|
|
|
|
This is too unreal, you must have posted it in DotNetKick yourself to get a good line here.
|
|
|
|
|
People wouldn't really write code which is that bad in a production environment would they?
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
|
Oh they would. And the worst thing is it (almost) works, so unless someone reviews the code they'll never learn.
|
|
|
|
|
That is probably the most insane piece of coding I've seen in all my years of programming.
I might print it out and make a poster of it, to serve as a warning to our junior programmers
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Next interview question, if the candidate does not fall off the chair laughing don't hire him/her
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I had to work with a state machine library that was somewhat similar. Worker threads would change states by throwing an exception. It was the most ridiculous stuff I have ever had to deal with but, of course, customers are always right and they wrote it.
|
|
|
|
|
Just WTF is that supposed to achieve?
You really gotta try harder to keep up with everyone that's not on the short bus with you.
- John Simmons / outlaw programmer.
|
|
|
|