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. Missed Opportunity for Easter Egg

Missed Opportunity for Easter Egg

Scheduled Pinned Locked Moved The Lounge
com
32 Posts 20 Posters 0 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.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    I just came across this code written by a coworker:

    If 1 = 2 Then

    Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

    Thou mewling ill-breeding pignut!

    L T W L S 6 Replies Last reply
    0
    • A AspDotNetDev

      I just came across this code written by a coworker:

      If 1 = 2 Then

      Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

      Thou mewling ill-breeding pignut!

      L Offline
      L Offline
      lewax00
      wrote on last edited by
      #2

      if (1 == 2)
      {
      throw new UniverseBorkedException("you're pretty much f***ed elephanted.");
      }

      N T M 3 Replies Last reply
      0
      • L lewax00

        if (1 == 2)
        {
        throw new UniverseBorkedException("you're pretty much f***ed elephanted.");
        }

        N Offline
        N Offline
        Nueman
        wrote on last edited by
        #3

        True. But he is coding in vb. In that world anything can happen. ;P

        What me worry?

        A G K 3 Replies Last reply
        0
        • N Nueman

          True. But he is coding in vb. In that world anything can happen. ;P

          What me worry?

          A Offline
          A Offline
          AspDotNetDev
          wrote on last edited by
          #4

          VB is the programming language evidence of Murphy's law.

          Thou mewling ill-breeding pignut!

          1 Reply Last reply
          0
          • A AspDotNetDev

            I just came across this code written by a coworker:

            If 1 = 2 Then

            Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

            Thou mewling ill-breeding pignut!

            T Offline
            T Offline
            TheGreatAndPowerfulOz
            wrote on last edited by
            #5

            AspDotNetDev wrote:

            If 1 = 2 Then

            In old-school Fortran this was a real potential. Certain integers were stored at memory locations, then you could say 1 = 2 (assign the value 2 to where the value 1 is stored). Then statements like

            if 1 = 2 then ...

            would be 'valid'.

            If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
            You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun

            L OriginalGriffO E 3 Replies Last reply
            0
            • A AspDotNetDev

              I just came across this code written by a coworker:

              If 1 = 2 Then

              Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

              Thou mewling ill-breeding pignut!

              W Offline
              W Offline
              wizardzz
              wrote on last edited by
              #6

              Pfft, what an idiot. We all know msdn recommends using 23 = 33, or even 23 = 12. http://msdn.microsoft.com/en-us/library/215yacb6(v=vs.71).aspx[^]

              L OriginalGriffO M 3 Replies Last reply
              0
              • T TheGreatAndPowerfulOz

                AspDotNetDev wrote:

                If 1 = 2 Then

                In old-school Fortran this was a real potential. Certain integers were stored at memory locations, then you could say 1 = 2 (assign the value 2 to where the value 1 is stored). Then statements like

                if 1 = 2 then ...

                would be 'valid'.

                If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
                You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun

                L Offline
                L Offline
                lewax00
                wrote on last edited by
                #7

                That must have been a real pain to debug X|

                1 Reply Last reply
                0
                • T TheGreatAndPowerfulOz

                  AspDotNetDev wrote:

                  If 1 = 2 Then

                  In old-school Fortran this was a real potential. Certain integers were stored at memory locations, then you could say 1 = 2 (assign the value 2 to where the value 1 is stored). Then statements like

                  if 1 = 2 then ...

                  would be 'valid'.

                  If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
                  You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun

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

                  Oh yes! I remember making that mistake - it took ages to find before I realized that my constant values had changed... Trouble was,

                  1=2

                  looked a lot like

                  I=2

                  :doh:

                  Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                  "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

                  Sander RosselS O 2 Replies Last reply
                  0
                  • W wizardzz

                    Pfft, what an idiot. We all know msdn recommends using 23 = 33, or even 23 = 12. http://msdn.microsoft.com/en-us/library/215yacb6(v=vs.71).aspx[^]

                    L Offline
                    L Offline
                    lewax00
                    wrote on last edited by
                    #9

                    What I don't understand is why they went with 12 and not 13. I feel like that would have fit better.

                    1 Reply Last reply
                    0
                    • W wizardzz

                      Pfft, what an idiot. We all know msdn recommends using 23 = 33, or even 23 = 12. http://msdn.microsoft.com/en-us/library/215yacb6(v=vs.71).aspx[^]

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

                      I thought MSDN recommended:

                      if (23 == 023)
                      {
                      ...
                      }

                      Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                      "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

                      1 Reply Last reply
                      0
                      • A AspDotNetDev

                        I just came across this code written by a coworker:

                        If 1 = 2 Then

                        Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

                        Thou mewling ill-breeding pignut!

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

                        2 + 2 = 5 if Big Bro says so.

                        Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

                        1 Reply Last reply
                        0
                        • L lewax00

                          if (1 == 2)
                          {
                          throw new UniverseBorkedException("you're pretty much f***ed elephanted.");
                          }

                          T Offline
                          T Offline
                          Tadas Budvytis
                          wrote on last edited by
                          #12

                          ha ha. Make it on production and guaranteed next day customers will call u ... ;)

                          1 Reply Last reply
                          0
                          • A AspDotNetDev

                            I just came across this code written by a coworker:

                            If 1 = 2 Then

                            Seems silly; probably a way to temporarily block out some code or something of that sort. However, it made me wonder why there aren't more people taking advantage of a potential easter egg. When I typed in "2+2" into Google and WolframAlpha, they both replied with "4". :((

                            Thou mewling ill-breeding pignut!

                            S Offline
                            S Offline
                            Steve Mayfield
                            wrote on last edited by
                            #13

                            When I first read this, I assumed it was "ell" = 2 :doh:

                            Steve _________________ I C(++) therefore I am

                            1 Reply Last reply
                            0
                            • OriginalGriffO OriginalGriff

                              Oh yes! I remember making that mistake - it took ages to find before I realized that my constant values had changed... Trouble was,

                              1=2

                              looked a lot like

                              I=2

                              :doh:

                              Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

                              Sander RosselS Offline
                              Sander RosselS Offline
                              Sander Rossel
                              wrote on last edited by
                              #14

                              I've unwillingly sent millions of $ to my private bank account because O looked a lot like 0! Well, that's what I'll tell the judge when they find out ;p

                              It's an OO world.

                              public class Naerling : Lazy<Person>{
                              public void DoWork(){ throw new NotImplementedException(); }
                              }

                              1 Reply Last reply
                              0
                              • L lewax00

                                if (1 == 2)
                                {
                                throw new UniverseBorkedException("you're pretty much f***ed elephanted.");
                                }

                                M Offline
                                M Offline
                                Manfred Rudolf Bihy
                                wrote on last edited by
                                #15

                                Not f***ed, but rather elephanted or maybe pachydermed. Cheers!

                                "With sufficient thrust, pigs fly just fine."

                                Ross Callon, The Twelve Networking Truths, RFC1925

                                "Der Berg ruft!"

                                Me, 2012-05-24

                                L 1 Reply Last reply
                                0
                                • M Manfred Rudolf Bihy

                                  Not f***ed, but rather elephanted or maybe pachydermed. Cheers!

                                  "With sufficient thrust, pigs fly just fine."

                                  Ross Callon, The Twelve Networking Truths, RFC1925

                                  "Der Berg ruft!"

                                  Me, 2012-05-24

                                  L Offline
                                  L Offline
                                  lewax00
                                  wrote on last edited by
                                  #16

                                  Of course, how could I be so foolish?

                                  1 Reply Last reply
                                  0
                                  • W wizardzz

                                    Pfft, what an idiot. We all know msdn recommends using 23 = 33, or even 23 = 12. http://msdn.microsoft.com/en-us/library/215yacb6(v=vs.71).aspx[^]

                                    M Offline
                                    M Offline
                                    Matthew Dennis
                                    wrote on last edited by
                                    #17

                                    or 9 x 6 = 42

                                    S 1 Reply Last reply
                                    0
                                    • N Nueman

                                      True. But he is coding in vb. In that world anything can happen. ;P

                                      What me worry?

                                      G Offline
                                      G Offline
                                      greldak
                                      wrote on last edited by
                                      #18

                                      In VB that expression will always resolve to False In other languages (C included) you could overload the values for 1 and 2 and/or the operator = or command If Good luck figuring out whats going on with that level of obfuscation. Its not something I would expect to see as a simple expression but it can be useful as a clause especially if you need to build up a complex expression at run time. In practice its more likely that some piece of funcionality is wanted to remain in the codebase but not required to run under normal circumstances - probably debug code although there are better ways of doing it.

                                      S 1 Reply Last reply
                                      0
                                      • G greldak

                                        In VB that expression will always resolve to False In other languages (C included) you could overload the values for 1 and 2 and/or the operator = or command If Good luck figuring out whats going on with that level of obfuscation. Its not something I would expect to see as a simple expression but it can be useful as a clause especially if you need to build up a complex expression at run time. In practice its more likely that some piece of funcionality is wanted to remain in the codebase but not required to run under normal circumstances - probably debug code although there are better ways of doing it.

                                        S Offline
                                        S Offline
                                        svella
                                        wrote on last edited by
                                        #19

                                        greldak wrote:

                                        In other languages (C included) you could overload the values for 1 and 2 and/or the operator = or command If
                                        Good luck figuring out whats going on with that level of obfuscation.

                                        I'm pretty sure you're wrong about being able to override either the values or the operator in C (or even C++ for that matter), but I'd welcome a working example.

                                        K K 2 Replies Last reply
                                        0
                                        • M Matthew Dennis

                                          or 9 x 6 = 42

                                          S Offline
                                          S Offline
                                          Sucramsy
                                          wrote on last edited by
                                          #20

                                          If 42 is the answer to life the universe and everything then this statement would be true.

                                          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