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. Is it 'true'?

Is it 'true'?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpcomtoolsquestion
6 Posts 5 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    // Why would we be sane and use real booleans??
    // if ( node.hasThumbnail === 'true' ) {

    From code that is licensed under the MIT license, so feel free to use it :laugh:

    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

    Z K P M 4 Replies Last reply
    0
    • L Lost User

      // Why would we be sane and use real booleans??
      // if ( node.hasThumbnail === 'true' ) {

      From code that is licensed under the MIT license, so feel free to use it :laugh:

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      You have to be at least a little bit insane to be a developer. It's OK.

      There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

      1 Reply Last reply
      0
      • L Lost User

        // Why would we be sane and use real booleans??
        // if ( node.hasThumbnail === 'true' ) {

        From code that is licensed under the MIT license, so feel free to use it :laugh:

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        that code means that it must really be 'true' not 'TRUE' or 1, or even non-zero. There are a lot of cases where it makes sense. So such code might get enforced by some source code scanner policies. :cool: You learn to honor such tools, when co-working with some code-jockeys :~

        Press F1 for help or google it. Greetings from Germany

        L 1 Reply Last reply
        0
        • K KarstenK

          that code means that it must really be 'true' not 'TRUE' or 1, or even non-zero. There are a lot of cases where it makes sense. So such code might get enforced by some source code scanner policies. :cool: You learn to honor such tools, when co-working with some code-jockeys :~

          Press F1 for help or google it. Greetings from Germany

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

          KarstenK wrote:

          There are a lot of cases where it makes sense

          In some alternate universe perhaps.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

          1 Reply Last reply
          0
          • L Lost User

            // Why would we be sane and use real booleans??
            // if ( node.hasThumbnail === 'true' ) {

            From code that is licensed under the MIT license, so feel free to use it :laugh:

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

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

            KarstenK's post reminds me of DCL and the many things that test as True -- including (but not limited to) 'Y', '1'...

            1 Reply Last reply
            0
            • L Lost User

              // Why would we be sane and use real booleans??
              // if ( node.hasThumbnail === 'true' ) {

              From code that is licensed under the MIT license, so feel free to use it :laugh:

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              M Offline
              M Offline
              Marc Clifton
              wrote on last edited by
              #6

              Because Javascript equality is so f*cked that you have to know when to use == vs. ===, and even then there's some weird BS with the null, empty, void, dunno, you're guess is as good as mine states that a Javascript variable can be in that it only makes sense to equate to a literal string? Marc

              Latest Article - Merkle Trees Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802

              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