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. Other Discussions
  3. The Weird and The Wonderful
  4. Check for True to return True...

Check for True to return True...

Scheduled Pinned Locked Moved The Weird and The Wonderful
13 Posts 7 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.
  • Sander RosselS Offline
    Sander RosselS Offline
    Sander Rossel
    wrote on last edited by
    #1

    Found myself coding something like the following just last week... :doh:

    Dim bool as Boolean = False

    If someExpression Then
    bool = True
    Else
    bool = False
    End If

    If bool Then
    Return True
    Else
    Return False
    End If

    Luckily I noticed just in time and simply Returned someExpression X| Some days its better to just stay in bed...

    It's an OO world.

    S M L 3 Replies Last reply
    0
    • Sander RosselS Sander Rossel

      Found myself coding something like the following just last week... :doh:

      Dim bool as Boolean = False

      If someExpression Then
      bool = True
      Else
      bool = False
      End If

      If bool Then
      Return True
      Else
      Return False
      End If

      Luckily I noticed just in time and simply Returned someExpression X| Some days its better to just stay in bed...

      It's an OO world.

      S Offline
      S Offline
      StM0n
      wrote on last edited by
      #2

      Hey... it's ok to learn :)

      (yes|no|maybe)*

      Sander RosselS 1 Reply Last reply
      0
      • S StM0n

        Hey... it's ok to learn :)

        (yes|no|maybe)*

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

        Not at this level ;)

        It's an OO world.

        S 1 Reply Last reply
        0
        • Sander RosselS Sander Rossel

          Not at this level ;)

          It's an OO world.

          S Offline
          S Offline
          StM0n
          wrote on last edited by
          #4

          At every level :laugh:

          (yes|no|maybe)*

          Sander RosselS 1 Reply Last reply
          0
          • S StM0n

            At every level :laugh:

            (yes|no|maybe)*

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

            I meant I shouldn't be learning how to return true or false depending on a variable's true or falseness which depends on an expressions true or falseness on which it should not depend at all, which would be false if you just started out, but true after almost a year of programming :sigh: Just true with me ;)

            It's an OO world.

            S B P 3 Replies Last reply
            0
            • Sander RosselS Sander Rossel

              I meant I shouldn't be learning how to return true or false depending on a variable's true or falseness which depends on an expressions true or falseness on which it should not depend at all, which would be false if you just started out, but true after almost a year of programming :sigh: Just true with me ;)

              It's an OO world.

              S Offline
              S Offline
              StM0n
              wrote on last edited by
              #6

              Naerling wrote:

              I meant I shouldn't be learning how to return true or false depending on a variable's true or falseness which depends on an expressions true or falseness on which it should not depend at all, which would be false if you just started out, but true after almost a year of programming

              Ok... I definitely like that :laugh:

              (yes|no|maybe)*

              modified on Friday, July 1, 2011 5:13 AM

              1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                I meant I shouldn't be learning how to return true or false depending on a variable's true or falseness which depends on an expressions true or falseness on which it should not depend at all, which would be false if you just started out, but true after almost a year of programming :sigh: Just true with me ;)

                It's an OO world.

                B Offline
                B Offline
                BillW33
                wrote on last edited by
                #7

                Good one. At least you caught yourself. :)

                Just because the code works, it doesn't mean that it is good code.

                1 Reply Last reply
                0
                • Sander RosselS Sander Rossel

                  I meant I shouldn't be learning how to return true or false depending on a variable's true or falseness which depends on an expressions true or falseness on which it should not depend at all, which would be false if you just started out, but true after almost a year of programming :sigh: Just true with me ;)

                  It's an OO world.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  Naerling wrote:

                  falseness

                  Falacy? Falaciousness? Falacio? :confused:

                  Sander RosselS 1 Reply Last reply
                  0
                  • P PIEBALDconsult

                    Naerling wrote:

                    falseness

                    Falacy? Falaciousness? Falacio? :confused:

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

                    false    [fawls] Show IPA adjective, fals·er, fals·est, adverb –adjective 1. not true or correct; erroneous: a false statement. 2. uttering or declaring what is untrue: a false witness. 3. not faithful or loyal; treacherous: a false friend. 4. tending to deceive or mislead; deceptive: a false impression. 5. not genuine; counterfeit. 6. based on mistaken, erroneous, or inconsistent impressions, ideas, or facts: false pride. 7. used as a substitute or supplement, especially temporarily: false supports for a bridge. 8. Biology . having a superficial resemblance to something that properly bears the name: the false acacia. 9. not properly, accurately, or honestly made, done, or adjusted: a false balance. 10. inaccurate in pitch, as a musical note. –adverb 11. dishonestly; faithlessly; treacherously: Did he speak false against me? —Idiom 12. play someone false, to betray someone; be treacherous or faithless. Origin: before 1000; Middle English, Old English fals < Latin falsus feigned, false, orig. past participle of fallere to deceive; reinforced by or reborrowed from Anglo-French, Old French fals, feminine false < Latin —Related forms false·ly, adverb false·ness, noun half-false, adjective qua·si-false, adjective qua·si-false·ly, adverb —Synonyms 1. mistaken, incorrect, wrong, untrue. 2. untruthful, lying, mendacious. 3. insincere, hypocritical, disingenuous, disloyal, unfaithful, inconstant, perfidious, traitorous. 4. misleading, fallacious. 5. artificial, spurious, bogus, forged. False, sham, counterfeit agree in referring to something that is not genuine. False is used mainly of imitations of concrete objects; it sometimes implies an intent to deceive: false teeth; false hair. Sham is rarely used of concrete objects and usually has the suggestion of intent to deceive: sham title; sham tears. Counterfeit always has the implication of cheating; it is used particularly of spurious imitation of coins, paper money, etc. Falseness! :D

                    It's an OO world.

                    P 1 Reply Last reply
                    0
                    • Sander RosselS Sander Rossel

                      false    [fawls] Show IPA adjective, fals·er, fals·est, adverb –adjective 1. not true or correct; erroneous: a false statement. 2. uttering or declaring what is untrue: a false witness. 3. not faithful or loyal; treacherous: a false friend. 4. tending to deceive or mislead; deceptive: a false impression. 5. not genuine; counterfeit. 6. based on mistaken, erroneous, or inconsistent impressions, ideas, or facts: false pride. 7. used as a substitute or supplement, especially temporarily: false supports for a bridge. 8. Biology . having a superficial resemblance to something that properly bears the name: the false acacia. 9. not properly, accurately, or honestly made, done, or adjusted: a false balance. 10. inaccurate in pitch, as a musical note. –adverb 11. dishonestly; faithlessly; treacherously: Did he speak false against me? —Idiom 12. play someone false, to betray someone; be treacherous or faithless. Origin: before 1000; Middle English, Old English fals < Latin falsus feigned, false, orig. past participle of fallere to deceive; reinforced by or reborrowed from Anglo-French, Old French fals, feminine false < Latin —Related forms false·ly, adverb false·ness, noun half-false, adjective qua·si-false, adjective qua·si-false·ly, adverb —Synonyms 1. mistaken, incorrect, wrong, untrue. 2. untruthful, lying, mendacious. 3. insincere, hypocritical, disingenuous, disloyal, unfaithful, inconstant, perfidious, traitorous. 4. misleading, fallacious. 5. artificial, spurious, bogus, forged. False, sham, counterfeit agree in referring to something that is not genuine. False is used mainly of imitations of concrete objects; it sometimes implies an intent to deceive: false teeth; false hair. Sham is rarely used of concrete objects and usually has the suggestion of intent to deceive: sham title; sham tears. Counterfeit always has the implication of cheating; it is used particularly of spurious imitation of coins, paper money, etc. Falseness! :D

                      It's an OO world.

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      I still prefer falacio.

                      L 1 Reply Last reply
                      0
                      • P PIEBALDconsult

                        I still prefer falacio.

                        L Offline
                        L Offline
                        Lutoslaw
                        wrote on last edited by
                        #11

                        :rolleyes:

                        Greetings - Jacek

                        1 Reply Last reply
                        0
                        • Sander RosselS Sander Rossel

                          Found myself coding something like the following just last week... :doh:

                          Dim bool as Boolean = False

                          If someExpression Then
                          bool = True
                          Else
                          bool = False
                          End If

                          If bool Then
                          Return True
                          Else
                          Return False
                          End If

                          Luckily I noticed just in time and simply Returned someExpression X| Some days its better to just stay in bed...

                          It's an OO world.

                          M Offline
                          M Offline
                          musefan
                          wrote on last edited by
                          #12

                          Looks like a good basis for a recursive function

                          If my jokes make me laugh, then I have already succeeded with 100% of my target audience

                          1 Reply Last reply
                          0
                          • Sander RosselS Sander Rossel

                            Found myself coding something like the following just last week... :doh:

                            Dim bool as Boolean = False

                            If someExpression Then
                            bool = True
                            Else
                            bool = False
                            End If

                            If bool Then
                            Return True
                            Else
                            Return False
                            End If

                            Luckily I noticed just in time and simply Returned someExpression X| Some days its better to just stay in bed...

                            It's an OO world.

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

                            The next time someone tells you that true always returns true I want you to ask that person a question. Ask that person: Have you tested it? Frankly, when I see your code I see an excellent place to put a unit test. ;P

                            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