Some people dont get it

This is a discussion on Some people dont get it within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Best ad ever, can you spot the problem??? Some people and their bad habits, i hate stupid stuff like this....

  1. #1
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

    Some people dont get it

    Best ad ever, can you spot the problem??? Some people and their bad habits, i hate stupid stuff like this.

  2. #2
    C(++)(#)
    Join Date
    Jul 2004
    Posts
    309
    It uses goto?
    To code is divine

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    suck.it.up won't do anything.

    Also...not sure what language it's written in, but I'm guessing C++, so the "end" is pointless.



    And, it's not using goto, it's assigning goto a value. Which, if it IS C or C++, then it's not a valid statement...

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Quote Originally Posted by 7smurfs
    It uses goto?
    I don't see anything wrong with goto, as long as it is used appropriately:

    Code:
    #include <stdio.h>
    
    #define goto i
    #define end }
    
    int main()
    {
      int goto;
    
      for (goto = 1; goto <= 5; goto++) {
        printf("goto = %d\n", goto);
      }
    
      goto = 0;
    
      return goto;
    end
    (I do see some potential evil in needless use of macros, however.)

    Regards,

    Dave

  5. #5
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    I was focused mainly on GOTO

  6. #6
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Quote Originally Posted by RoD
    I was focused mainly on GOTO
    Code:
    #include <stdio.h>
    
    #define goto i
    #define end }
    #define up hi()
    
    typedef struct _h_struct {
      void (*hi)(void);
    } h_struct;
    
    typedef struct _s_struct {
      h_struct it;
    } s_struct;
    
    int main()
    {
      void hello(void);
      int goto;
      s_struct suck;
      suck.it.hi = hello;
    
      for (goto = 1; goto <= 5; goto++) {
        printf("goto = %d\n", goto);
      }
      printf("\ngoto goto goto goto goto goto goto goto goto goto goto goto \n\n");
    
      printf("There! Did you get it out of your system yet?\n");
    
      suck.it.up;
    
      goto = 0;
    
      return goto;
    end
    
    void hello()
    {
      printf("\nHey! Are you talkin' to me?\n");
    }
    Regards,

    Dave

  7. #7
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

  8. #8
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Quote Originally Posted by jverkoey
    suck.it.up won't do anything.

    Also...not sure what language it's written in, but I'm guessing C++, so the "end" is pointless.



    And, it's not using goto, it's assigning goto a value. Which, if it IS C or C++, then it's not a valid statement...
    Well, in my post (compile it on your favorite C or C++ compiler), suck.it.up prints out a message. And if I left out the "end", it wouldn't compile. And since the preprocessor changed the "goto" to something legal, C or C++ compilers never see the badness.

    If certain macros are defined in certain ways, everything in that ad compiles and executes deterministically on all C and C++ compilers that I have tested today (all four).

    Now, ask me again why I hate unecessary and needless macros. (I also hate redundancy and needless repetition.)

    Regards,

    Dave

    p.s. With the right macro, I can get void main() through g++ with no warnings and no errors even though all warning flags are set. This is for professionals only (professional idiots, that is --- like me); don't try it at home (or on cprogramming.com).
    Last edited by Dave Evans; 03-13-2005 at 06:12 PM.

  9. #9
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    thank god anon its not just me

  10. #10
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    The code uses Braces where none are required but thats just personal taste.

  11. #11
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>The code uses Braces where none are required but thats just personal taste.
    Some people dont get it
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  2. Some people
    By Cgawd in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 11-27-2002, 05:15 PM
  3. I'm worried about some of the people wanting to program...
    By damonbrinkley in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 11-23-2002, 07:38 AM
  4. British people - Gibralter requests your support
    By stevey in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 05-17-2002, 11:10 PM
  5. Why do people thing viruses are cool?
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 11-12-2001, 04:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21