Tendo City
The Daily WTF - Printable Version

+- Tendo City (https://www.tendocity.net)
+-- Forum: Tendo City: Metropolitan District (https://www.tendocity.net/forumdisplay.php?fid=4)
+--- Forum: Ramble City (https://www.tendocity.net/forumdisplay.php?fid=44)
+--- Thread: The Daily WTF (/showthread.php?tid=3884)



The Daily WTF - Dark Jaguar - 10th July 2006

http://thedailywtf.com/

Behold unto some coder's lack of knowledge of existing features, and also just plain terrible code.

[code]
Function IsEven(N)
Dim LastDigit
LastDigit = int(N) mod 10
IsEven = (LastDigit = 0) or (LastDigit = 2) or _
(LastDigit = 4) or (LastDigit = 6) or (LastDigit = 8)
End Function

Function IsOdd(N)
Dim LastDigit
LastDigit = int(N) mod 10
IsOdd = (LastDigit = 1) or (LastDigit = 3) or _
(LastDigit = 5) or (LastDigit = 7) or (LastDigit = 9)
End Function
[/code]

[code]
enum Bool
{
True,
False,
FileNotFound
};
[/code]

I think this is one of my new favorite web sites.


The Daily WTF - etoven - 10th July 2006

Horribly inaficent, he must work for Microsoft :)


The Daily WTF - Weltall - 10th July 2006

The humor of that is completely lost upon me.


The Daily WTF - Dark Jaguar - 10th July 2006

I'll try to break it down. The first example shows two functions being created. They are for determining even numbers and odd numbers. Without going into further detail, the first thing you should be aware of is that compilers (programs that write other programs) as a general rule already have such functions built in, and are more efficiently done at that which can be called with a simple statement. Declaring these functions is pointless, reinventing the wheel, only it's an oval.

(There are other major issues, for example whether or not the function adequatly handles integers of various sizes and how it corrects for incorrect data types and so on and so forth which the built in function can generally be expected to already be optimized to deal with.)


The Daily WTF - Weltall - 10th July 2006

So it wasn't supposed to be funny, then, and is rather just an example of incompetent coding?

Because, you explained it (and I needed it, coding is hardly my forte), and I understood your explanation, and even still, it just isn't funny.

I don't mean to be a mugwump, I'm just saying that etoven is the new alien space marine, without the excuse of being French-Canadian.


The Daily WTF - Dark Jaguar - 10th July 2006

Except that etoven actually has talent.

As for it's comedic value, I suppose it loses something in the translation :D. Let's just say it is roughly like installing a convoluted power switch ala those crazy contraptions that sharpen a pencil on a computer that already has a perfectly functional power switch.

This site has massive examples of that, and for a lot of people who have knowledge of coding, it can be pretty funny. I think LL should enjoy it anyway.


The Daily WTF - etoven - 10th July 2006

Ryan Wrote:I'm just saying that etoven is the new alien space marine, without the excuse of being French-Canadian.

Hor.. ray..?


The Daily WTF - lazyfatbum - 10th July 2006

yuh huf bug nuples


The Daily WTF - Private Hudson - 12th July 2006

No, Uh huv bug nupples!