HAHA bad coding

Discussion in 'macOS' started by carlosbutler, May 27, 2008.

  1. carlosbutler macrumors 6502a

    carlosbutler

    Joined:
    Feb 24, 2008
    Location:
    London City
    #1
    [​IMG]

    yes i know that this isnt true, or at least i think it isnt. but its true what it states...

    thought id just share it, see what you all thought
     
  2. Tallest Skil macrumors P6

    Tallest Skil

    Joined:
    Aug 13, 2006
    Location:
    1 Geostationary Tower Plaza
    #2
    You forgot a line...

    "sudo delete viruses; spyware; trojans"

    Wait, that's UNIX... no wonder Vista didn't work!
     
  3. NT1440 macrumors G4

    NT1440

    Joined:
    May 18, 2008
    Location:
    Hartford, CT
    #3
    even as someone who barely understands coding, i found that to be funny

    i think the thing that got me was "int workingnewfeatures=0" :p
     
  4. Hemingray macrumors 68030

    Hemingray

    Joined:
    Jan 9, 2002
    Location:
    Ha ha haaa!
    #4
    I found this particularly humorous, as I am currently taking Java classes. Thank you for the laugh! :)
     
  5. carlosbutler thread starter macrumors 6502a

    carlosbutler

    Joined:
    Feb 24, 2008
    Location:
    London City
    #5
    no problem. interstingly enough i put it on a xbox/windows based forum, and i think i got banned or somthing.

    thought id see what they thought (kind of relised i would be winding them up:p)
     
  6. deputy_doofy macrumors 65816

    deputy_doofy

    Joined:
    Sep 11, 2002
    #6
    Fixed the code a bit.
    const int workingNewFeatures=0;

    :D
     
  7. NT1440 macrumors G4

    NT1440

    Joined:
    May 18, 2008
    Location:
    Hartford, CT
    #7
    :( and youve lost me.

    i start AP comp sciences for my senior year next year tho! hopefully that will start me on my way, we are only learning java tho:(

    is it a relativly simple switch to C coding when youve learned the basics of how coding works?
     
  8. NT1440 macrumors G4

    NT1440

    Joined:
    May 18, 2008
    Location:
    Hartford, CT
    #9
    well thats excellent news:D:apple:
     
  9. deputy_doofy macrumors 65816

    deputy_doofy

    Joined:
    Sep 11, 2002
    #10
    It's been so long since I've done any C++, but don't feel lost.

    int workingNewFeatures=0;
    This is a variable. At any point, you can change its value.
    workingNewFeatures++;
    workingNewFeatures+=5;
    etc.

    However, this...
    const int workingNewFeatures=0;
    This is a constant value. Any reference to workingNewFeatures is 0. It's ALWAYS 0. You cannot change it.
    Most older textbooks would prefer to see constants in all caps...
    const int WORKING_NEW_FEATURES=0;

    A constant might make more sense to you, if you used it like this:
    const float PI=3.14;

    You cannot change PI, since it's always 3.14.

    Ok, done teaching for today. :)
     
  10. NT1440 macrumors G4

    NT1440

    Joined:
    May 18, 2008
    Location:
    Hartford, CT
    #11
    wow, that actually mad sense, i guess its good that i could follow that while having literally no experience in coding whatsoever?

    thanks man:D:apple:
     
  11. deputy_doofy macrumors 65816

    deputy_doofy

    Joined:
    Sep 11, 2002
    #12
    Yes. The big mistake most people make - myself included - is that they try rushing into stuff too fast. One example at a time... you'll get there. :)
     
  12. NT1440 macrumors G4

    NT1440

    Joined:
    May 18, 2008
    Location:
    Hartford, CT
    #13
    lol the thing that confused me was i didnt know what const even meant, had i known that it meant constant i would have gotten it.

    thanks alot tho man, and in reguards to ur username, scary movie one was the only one i could actually sit through lol
     
  13. deputy_doofy macrumors 65816

    deputy_doofy

    Joined:
    Sep 11, 2002
    #14
    Definitely. Scary Move 1 is the only one I own. lol :D
     

Share This Page