• Login
  • Register
  • Login Register
    Login
    Username:
    Password:
  • Home
  • Members
  • Team
  • Help
User Links
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:

    Quick Links Home Members Team Help
    Tendo City Tendo City: Metropolitan District Ramble City The Daily WTF

     
    • 0 Vote(s) - 0 Average
    The Daily WTF
    Dark Jaguar
    Offline

    Administrator

    Posts: 19,628
    Threads: 1,572
    Joined: 10-12-1999
    #1
    10th July 2006, 1:07 PM
    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.
    "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." ~ Charles Babbage (1791-1871)
    Reply
    Reply
    etoven
    Offline

    Site Owner Operator

    Posts: 2,049
    Threads: 586
    Joined: 01-04-2019
    #2
    10th July 2006, 2:20 PM
    Horribly inaficent, he must work for Microsoft :)
    Reply
    Reply
    Weltall
    Offline

    Administrator

    Posts: 5,822
    Threads: 321
    Joined: 05-03-2000
    #3
    10th July 2006, 5:52 PM
    The humor of that is completely lost upon me.
    YOU CANNOT HIDE FOREVER
    WE STAND AT THE DOOR
    Reply
    Reply
    Dark Jaguar
    Offline

    Administrator

    Posts: 19,628
    Threads: 1,572
    Joined: 10-12-1999
    #4
    10th July 2006, 6:03 PM
    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.)
    "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." ~ Charles Babbage (1791-1871)
    Reply
    Reply
    Weltall
    Offline

    Administrator

    Posts: 5,822
    Threads: 321
    Joined: 05-03-2000
    #5
    10th July 2006, 6:31 PM
    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.
    YOU CANNOT HIDE FOREVER
    WE STAND AT THE DOOR
    Reply
    Reply
    Dark Jaguar
    Offline

    Administrator

    Posts: 19,628
    Threads: 1,572
    Joined: 10-12-1999
    #6
    10th July 2006, 6:38 PM
    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.
    "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." ~ Charles Babbage (1791-1871)
    Reply
    Reply
    etoven
    Offline

    Site Owner Operator

    Posts: 2,049
    Threads: 586
    Joined: 01-04-2019
    #7
    10th July 2006, 7:01 PM
    Ryan Wrote:I'm just saying that etoven is the new alien space marine, without the excuse of being French-Canadian.

    Hor.. ray..?
    Reply
    Reply
    lazyfatbum
    Offline

    Administrator

    Posts: 4,354
    Threads: 222
    Joined: 09-21-1999
    #8
    10th July 2006, 8:25 PM
    yuh huf bug nuples
    Reply
    Reply
    Private Hudson
    Offline

    Posting Freak

    Posts: 1,074
    Threads: 64
    Joined: 08-16-2001
    #9
    12th July 2006, 3:41 AM
    No, Uh huv bug nupples!
    If i had a dollar for every time i ran out of hair in the middle of a spoon making contest id only eat your children with a side of slaw and THOSE ARENT PILLOWS!!
    Reply
    Reply
    « Next Oldest | Next Newest »

    Users browsing this thread:



    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Toven Solutions

    Home · Members · Team · Help · Contact

    408 Chapman St. Salem, Viriginia

    +1 540 4276896

    etoven@gmail.com

    About the company Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Linear Mode
    Threaded Mode