Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The Anti-If Campaign

The Anti-If Campaign

Scheduled Pinned Locked Moved The Lounge
csharpc++comannouncement
46 Posts 27 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that? I was rather surprised to see that a switch on a bool is valid (in C#).. I mean come on, how is that ever going to make any sense?

    N Offline
    N Offline
    Nemanja Trifunovic
    wrote on last edited by
    #4

    harold aptroot wrote:

    So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

    Worse than that - they advocate using polymorphism instead of control structures.

    utf8-cpp

    C L S C C 5 Replies Last reply
    0
    • realJSOPR realJSOP

      Nemanja Trifunovic wrote:

      Now, I am thinking of starting an "anti-for" one;

      How about just starting with an anti-absurdity movement?

      .45 ACP - because shooting twice is just silly
      -----
      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
      -----
      "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #5

      John Simmons / outlaw programmer wrote:

      an anti-absurdity movement?

      Meh - the success of such a movement would make this world a dull place.

      utf8-cpp

      1 Reply Last reply
      0
      • N Nemanja Trifunovic

        harold aptroot wrote:

        So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

        Worse than that - they advocate using polymorphism instead of control structures.

        utf8-cpp

        C Offline
        C Offline
        Chris Austin
        wrote on last edited by
        #6

        Nemanja Trifunovic wrote:

        Worse than that - they advocate using polymorphism instead of control structures.

        :laugh: Somebody must have just picked up a GoF or Martin Fowler book.

        And above all things, never think that you're not good enough yourself. A man should never think that. My belief is that in life people will take you at your own reckoning. --Isaac Asimov Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell

        1 Reply Last reply
        0
        • N Nemanja Trifunovic

          harold aptroot wrote:

          So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

          Worse than that - they advocate using polymorphism instead of control structures.

          utf8-cpp

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #7

          They sound like object programmers. You know, programmers who write slow code using mostly objects instead of primitive types, the kind of programmer that uses a dictionary<point,T> instead of a T[,] even though it has a known fixed size and will be filled completely..

          1 Reply Last reply
          0
          • N Nemanja Trifunovic

            harold aptroot wrote:

            So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

            Worse than that - they advocate using polymorphism instead of control structures.

            utf8-cpp

            S Offline
            S Offline
            Single Step Debugger
            wrote on last edited by
            #8

            Nemanja Trifunovic wrote:

            Worse than that - they advocate using polymorphism instead of control structures.

            WTF? Ask them to implement a simple calculator using their polymorphism. Apart from been stupid this is not something new, we have predicates and the PROLOG from decades and if the memory serves, there is no conditional statements in this language.

            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.

            N OriginalGriffO 2 Replies Last reply
            0
            • S Single Step Debugger

              Nemanja Trifunovic wrote:

              Worse than that - they advocate using polymorphism instead of control structures.

              WTF? Ask them to implement a simple calculator using their polymorphism. Apart from been stupid this is not something new, we have predicates and the PROLOG from decades and if the memory serves, there is no conditional statements in this language.

              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.

              N Offline
              N Offline
              Nemanja Trifunovic
              wrote on last edited by
              #9

              Deyan Georgiev wrote:

              WTF? Ask them to implement a simple calculator using their polymorphism.

              Hey, don't shoot the messenger - I am not a member of their campaign :)

              Deyan Georgiev wrote:

              Apart from been stupid this is not something new, we have predicates and the PROLOG from decades and if the memory serves, there is no conditional statements in this language.

              Unfortunatelly, I am not familiar with Prolog. ML stlyle pattern matching[^] is sometimes a nice alternative to if-else blocks, though.

              utf8-cpp

              S 1 Reply Last reply
              0
              • N Nemanja Trifunovic

                harold aptroot wrote:

                So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

                Worse than that - they advocate using polymorphism instead of control structures.

                utf8-cpp

                C Offline
                C Offline
                Christopher Duncan
                wrote on last edited by
                #10

                :omg: They exploit shape shifting parrots? Does PETA know about this?

                Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                J 1 Reply Last reply
                0
                • realJSOPR realJSOP

                  Nemanja Trifunovic wrote:

                  Now, I am thinking of starting an "anti-for" one;

                  How about just starting with an anti-absurdity movement?

                  .45 ACP - because shooting twice is just silly
                  -----
                  "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                  -----
                  "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                  C Offline
                  C Offline
                  Christopher Duncan
                  wrote on last edited by
                  #11

                  Hang on... I'm buying you a ticket to Washington, D.C.

                  Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                  1 Reply Last reply
                  0
                  • N Nemanja Trifunovic

                    Deyan Georgiev wrote:

                    WTF? Ask them to implement a simple calculator using their polymorphism.

                    Hey, don't shoot the messenger - I am not a member of their campaign :)

                    Deyan Georgiev wrote:

                    Apart from been stupid this is not something new, we have predicates and the PROLOG from decades and if the memory serves, there is no conditional statements in this language.

                    Unfortunatelly, I am not familiar with Prolog. ML stlyle pattern matching[^] is sometimes a nice alternative to if-else blocks, though.

                    utf8-cpp

                    S Offline
                    S Offline
                    Single Step Debugger
                    wrote on last edited by
                    #12

                    Nemanja Trifunovic wrote:

                    Hey, don't shoot the messenger - I am not a member of their campaign

                    I know, it was a joke. :)

                    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.

                    1 Reply Last reply
                    0
                    • N Nemanja Trifunovic

                      harold aptroot wrote:

                      So instead of if (something) { ... } We now write switch (something) { case true: ... break; default: break; } Or something like that?

                      Worse than that - they advocate using polymorphism instead of control structures.

                      utf8-cpp

                      C Offline
                      C Offline
                      CPallini
                      wrote on last edited by
                      #13

                      Nemanja Trifunovic wrote:

                      Worse than that - they advocate using polymorphism instead of control structures.

                      There's nothing wrong: Microsoft is doing it since '92, with MFC, ...oooops :-D On the serious side, (IMHO) there's really nothing wrong in using polymorphism instead of control structures when the OOP nature of the project naturally leads to. :)

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                      [My articles]

                      1 Reply Last reply
                      0
                      • N Nemanja Trifunovic

                        Just in case you haven't noticed, there is an "anti-if campaign[^] out there. Now, I am thinking of starting an "anti-for" one; and "anti-switch" one; and - well you get the picture. Too bad anti-goto is an old news.

                        utf8-cpp

                        E Offline
                        E Offline
                        Ennis Ray Lynch Jr
                        wrote on last edited by
                        #14

                        Most developers have no understanding of Object Oriented programming beyond the text book definition. There are some great things you can do with correctly designed OO. One really neat pattern is the Null object pattern so instead of checking for null when you call a method you have a predefined action already established on null. But then I am a dreamer.

                        Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                        C B U M P 5 Replies Last reply
                        0
                        • N Nemanja Trifunovic

                          Just in case you haven't noticed, there is an "anti-if campaign[^] out there. Now, I am thinking of starting an "anti-for" one; and "anti-switch" one; and - well you get the picture. Too bad anti-goto is an old news.

                          utf8-cpp

                          C Offline
                          C Offline
                          Chris Losinger
                          wrote on last edited by
                          #15

                          soon, the only people who knows how computers actually work will be the people who write compilers.

                          image processing toolkits | batch image processing

                          C 1 Reply Last reply
                          0
                          • N Nemanja Trifunovic

                            Just in case you haven't noticed, there is an "anti-if campaign[^] out there. Now, I am thinking of starting an "anti-for" one; and "anti-switch" one; and - well you get the picture. Too bad anti-goto is an old news.

                            utf8-cpp

                            N Offline
                            N Offline
                            Nelek
                            wrote on last edited by
                            #16

                            [quote] The perfect gift for programmers who decide to quit using IFs Price: € 20.00 (+20% VAT) + Shipping Minimum quantity: 5 T-Shirts ... Quantity (one size) [/quote]

                            If (size != yourSize)
                            { you_have_110€+_less = true;
                            you_are_fucked_up = true;
                            ]

                            :laugh: :laugh: EDIT: I just saw the slogan at the bottom of this part[^]: "Anti-If Campaign you can quit if you want to join us" :doh: :doh: :doh:

                            Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpfull answers is nice, but saying thanks can be even nicer.

                            modified on Monday, January 4, 2010 3:28 PM

                            B 1 Reply Last reply
                            0
                            • C Christopher Duncan

                              :omg: They exploit shape shifting parrots? Does PETA know about this?

                              Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

                              J Offline
                              J Offline
                              Jim Crafton
                              wrote on last edited by
                              #17

                              Rumor has it that the parrots are kept in the same bunker that Dick Cheney is staying in and that both receive a healthy supply of crackers for good behavior.

                              ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                              R 1 Reply Last reply
                              0
                              • realJSOPR realJSOP

                                Nemanja Trifunovic wrote:

                                Now, I am thinking of starting an "anti-for" one;

                                How about just starting with an anti-absurdity movement?

                                .45 ACP - because shooting twice is just silly
                                -----
                                "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
                                -----
                                "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

                                J Offline
                                J Offline
                                Jim Crafton
                                wrote on last edited by
                                #18

                                That would cause the internet to implode. Too bad, it's a good idea! :)

                                ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                1 Reply Last reply
                                0
                                • S Single Step Debugger

                                  Nemanja Trifunovic wrote:

                                  Worse than that - they advocate using polymorphism instead of control structures.

                                  WTF? Ask them to implement a simple calculator using their polymorphism. Apart from been stupid this is not something new, we have predicates and the PROLOG from decades and if the memory serves, there is no conditional statements in this language.

                                  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.

                                  OriginalGriffO Offline
                                  OriginalGriffO Offline
                                  OriginalGriff
                                  wrote on last edited by
                                  #19

                                  Never mind a calculator - implement a coin toss simulator for who goes first in a football match!

                                  All those who believe in psycho kinesis, raise my hand.

                                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                                  B 1 Reply Last reply
                                  0
                                  • C Chris Losinger

                                    soon, the only people who knows how computers actually work will be the people who write compilers.

                                    image processing toolkits | batch image processing

                                    C Offline
                                    C Offline
                                    CPallini
                                    wrote on last edited by
                                    #20

                                    Come in here, dear boy, have a cigar: you don't need to know how the machine actually works to write a compiler for our managed language. :-D

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                    [My articles]

                                    1 Reply Last reply
                                    0
                                    • E Ennis Ray Lynch Jr

                                      Most developers have no understanding of Object Oriented programming beyond the text book definition. There are some great things you can do with correctly designed OO. One really neat pattern is the Null object pattern so instead of checking for null when you call a method you have a predefined action already established on null. But then I am a dreamer.

                                      Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                                      C Offline
                                      C Offline
                                      CPallini
                                      wrote on last edited by
                                      #21

                                      Ennis Ray Lynch, Jr. wrote:

                                      One really neat pattern is the Null object pattern so instead of checking for null when you call a method you have a predefined action already established on null.

                                      Arguing the usefulness of such an object in OOP looks like arguing about the empty-set in set theory. However it really depends on the (project) context if you really need an Object Oriented approach or not. :)

                                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                      [My articles]

                                      1 Reply Last reply
                                      0
                                      • N Nemanja Trifunovic

                                        Just in case you haven't noticed, there is an "anti-if campaign[^] out there. Now, I am thinking of starting an "anti-for" one; and "anti-switch" one; and - well you get the picture. Too bad anti-goto is an old news.

                                        utf8-cpp

                                        T Offline
                                        T Offline
                                        thrakazog
                                        wrote on last edited by
                                        #22

                                        Yeah, and I'm sick of seeing those variables all over the code like they run the place. Let's get rid of those also. :~

                                        P 1 Reply Last reply
                                        0
                                        • T thrakazog

                                          Yeah, and I'm sick of seeing those variables all over the code like they run the place. Let's get rid of those also. :~

                                          P Offline
                                          P Offline
                                          Pete OHanlon
                                          wrote on last edited by
                                          #23

                                          While you're at it, will you get rid of those stinking operators and loops? They're just noise.

                                          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

                                          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

                                          My blog | My articles | MoXAML PowerToys | Onyx

                                          C 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups