Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Perfect relationship

Perfect relationship

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
11 Posts 10 Posters 17 Views
  • 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.
  • lena@gregtech.euL [email protected]

    (Shamelessly stolen from reddit)

    W This user is from outside of this forum
    W This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #2

    I'm not CS smart enough to understand this... 😢

    M E P mobotsar@sh.itjust.worksM 4 Replies Last reply
    17
    • W [email protected]

      I'm not CS smart enough to understand this... 😢

      M This user is from outside of this forum
      M This user is from outside of this forum
      [email protected]
      wrote on last edited by [email protected]
      #3

      A ternary is a short hand to assign a value based on a true/false statement

      let a; if(isTtrue) a=2 else a=9

      Becomes

      let a = (isTrue) ? 2 : 9

      tja@sh.itjust.worksT 1 Reply Last reply
      22
      • lena@gregtech.euL [email protected]

        (Shamelessly stolen from reddit)

        C This user is from outside of this forum
        C This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #4

        Clearly virgins

        F 1 Reply Last reply
        9
        • W [email protected]

          I'm not CS smart enough to understand this... 😢

          E This user is from outside of this forum
          E This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #5

          "Ternary operator" means "operator that takes three things", like unary and binary operators take one and two things.

          In C there is an operator for conditional expressions (an 'if' that you can put inside expressions) and it looks like this condition ? trueBranch : falseBranch. It takes three expressions, so it's a ternary operator.

          Except it's the only ternary operator in C (and most languages, if they have one at all), so instead of calling it something like "conditional operator", they just call it "the ternary operator"

          1 Reply Last reply
          39
          • W [email protected]

            I'm not CS smart enough to understand this... 😢

            P This user is from outside of this forum
            P This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #6

            Honestly, it is not worth it and only mildly funny. You didn’t miss anything.

            lena@gregtech.euL 1 Reply Last reply
            5
            • C [email protected]

              Clearly virgins

              F This user is from outside of this forum
              F This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #7

              To my deranged Friday afternoon brain, this is the funniest bit

              1 Reply Last reply
              2
              • M [email protected]

                A ternary is a short hand to assign a value based on a true/false statement

                let a; if(isTtrue) a=2 else a=9

                Becomes

                let a = (isTrue) ? 2 : 9

                tja@sh.itjust.worksT This user is from outside of this forum
                tja@sh.itjust.worksT This user is from outside of this forum
                [email protected]
                wrote on last edited by [email protected]
                #8

                I really like the way kotlin is doing it. The readability of the first one and still a direct assignment.

                var a = if (isTrue) 2 else 9

                4 1 Reply Last reply
                5
                • tja@sh.itjust.worksT [email protected]

                  I really like the way kotlin is doing it. The readability of the first one and still a direct assignment.

                  var a = if (isTrue) 2 else 9

                  4 This user is from outside of this forum
                  4 This user is from outside of this forum
                  [email protected]
                  wrote on last edited by [email protected]
                  #9

                  I like the python way as it reads more naturally

                  a = 2 if isTrue else 9
                  
                  1 Reply Last reply
                  2
                  • W [email protected]

                    I'm not CS smart enough to understand this... 😢

                    mobotsar@sh.itjust.worksM This user is from outside of this forum
                    mobotsar@sh.itjust.worksM This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #10

                    The joke is that the people in the conversation are kinda dumb

                    1 Reply Last reply
                    2
                    • P [email protected]

                      Honestly, it is not worth it and only mildly funny. You didn’t miss anything.

                      lena@gregtech.euL This user is from outside of this forum
                      lena@gregtech.euL This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #11

                      Very useful reply 👍

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


                      • Login

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