|
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.
|
|
|
|
|
Exception-driven development, my dear Brady!
Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon
Judah Himango
|
|
|
|
|
Exception-driving development, my dear Brady!
Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon
Judah Himango
|
|
|
|
|
It is just a JIT compiler test. A "good" compiler would deduce the intent and eliminate all of the excess excpetion handling and place optimized code inline on the first pass. This eliminates the need for the programmer to think because the compiler has implemented the new DWIM (Do what I mean) facility.
Seriously in MVS Assembler it would be
XR R0,R0
L R1,VALUE
D R0,=A(2)
JZ EVEN
process odd number
J M_010
EVEN DS 0H
process even number
M_010 DS 0H
.
.
.
Sam
|
|
|
|