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. JavaScript

JavaScript

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
152 Posts 83 Posters 2 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.
  • S [email protected]

    So, all you've mustered is some lame-ass whataboutism?
    Have a good day

    supervisor194@lemmy.worldS This user is from outside of this forum
    supervisor194@lemmy.worldS This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #121

    So you don't have a suggestion. Got it.

    S 1 Reply Last reply
    0
    • supervisor194@lemmy.worldS [email protected]

      So you don't have a suggestion. Got it.

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

      Of course. Nothing beats JS, oh guru mighty guru

      supervisor194@lemmy.worldS 1 Reply Last reply
      0
      • B [email protected]
        • In https://lemm.ee/comment/20947041 they claimed "implicit type coercion" and showed many examples; they did NOT claim "string concatenation".
        • However, that was in reply to https://lemmy.world/comment/17473361 which was talking about "implicit conversion to string" which is a specific type of "implicit type coercion"; NONE of the examples given involved a conversion to string.
        • But also, that was in reply to https://lemm.ee/comment/20939144 which only mentions "implicit type coercion" in general.

        So, I think probably everyone in the thread is "correct", but you are actually talking past one another.

        I think the JS behavior is a bad design choice, but it is well documented and consistent across implementations.

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

        Read the thread again, it seems you slipped somewhere. This was all about the claim that implicit conversion to string somehow could make sense.

        1 Reply Last reply
        0
        • B [email protected]

          (.) is a valid expression in Haskell. Normally it is the prefix form of the infix operator . that does function
          composition. (.) (2*) (1+) 3 = ((2*) . (1+)) 3 = 2 * (1 + 3) = 8.

          But, the most common use of the word "boob" in my experience in Haskell is the "boobs operator": (.)(.). It's usage in Haskell is limited (tho valid), but it's appearance in racy ASCII art predates even the first versions on Haskell.

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

          The pioneers of ASCII art in the 70s and 80s are the unsung heroes of porn.

          1 Reply Last reply
          1
          • S [email protected]

            Of course. Nothing beats JS, oh guru mighty guru

            supervisor194@lemmy.worldS This user is from outside of this forum
            supervisor194@lemmy.worldS This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #125

            So all you've mustered is some lame-ass ad-hominem? Have a good day

            S 1 Reply Last reply
            0
            • cm0002@lemmy.worldC [email protected]
              This post did not contain any content.
              L This user is from outside of this forum
              L This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #126

              It's my favorite language too, but I also find this hilarious.

              1 Reply Last reply
              1
              • S [email protected]

                So, just don’t use JavaScript?

                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
                #127

                That's also my understanding: "Javascript is great because you can use other languages and then transpile them to JS."

                K F 2 Replies Last reply
                6
                • cm0002@lemmy.worldC [email protected]
                  This post did not contain any content.
                  B This user is from outside of this forum
                  B This user is from outside of this forum
                  [email protected]
                  wrote on last edited by [email protected]
                  #128

                  It's because + is two different operators and overloads based on the type to the left, while - is only a numeric operator and coerces left and right operands to numeric. But frankly if you're still using + for math or string concatenation in 2025, you're doing it wrong.

                  H 1 Reply Last reply
                  5
                  • B [email protected]

                    It's because + is two different operators and overloads based on the type to the left, while - is only a numeric operator and coerces left and right operands to numeric. But frankly if you're still using + for math or string concatenation in 2025, you're doing it wrong.

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

                    I know nothing about javascript, what is wrong with using + for math? perhaps naively, I'd say it looks suited for the job

                    Q _ B 3 Replies Last reply
                    6
                    • cm0002@lemmy.worldC [email protected]
                      This post did not contain any content.
                      calavera@lemmy.zipC This user is from outside of this forum
                      calavera@lemmy.zipC This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #130

                      It makes sense though

                      Q Z P 3 Replies Last reply
                      8
                      • H [email protected]

                        I know nothing about javascript, what is wrong with using + for math? perhaps naively, I'd say it looks suited for the job

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

                        It's much better to make your own function that uses bitwise operations to do addition.

                        function add(a, b) {
                            while (b !== 0) {
                                // Calculate carry
                                let carry = a & b;
                        
                                // Sum without carry
                                a = a ^ b;
                        
                                // Shift carry to the left
                                b = carry << 1;
                            }
                            return a;
                        }
                        

                        (For certain definitions of better.)

                        1 Reply Last reply
                        5
                        • F [email protected]

                          Not really, considering Typescript only adds static types to JS. It's not a different language, it's an extension.

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

                          Since it needs to be compiled to JavaScript in order to be used, I kind of consider it a different language. Yes, it's a strict superset of JavaScript, but that makes it different.

                          F 1 Reply Last reply
                          5
                          • D [email protected]

                            Yeah, this looks dumb on the surface, but you've got bigger problems if you're trying to do math with strings

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

                            Better than doing physics with strings

                            1 Reply Last reply
                            1
                            • M [email protected]

                              That's also my understanding: "Javascript is great because you can use other languages and then transpile them to JS."

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

                              Oh man machine language is so good, literally the best actually

                              1 Reply Last reply
                              2
                              • H [email protected]

                                I know nothing about javascript, what is wrong with using + for math? perhaps naively, I'd say it looks suited for the job

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

                                The correct way to do it is to load a 500mb library that has an add function in it.

                                B 1 Reply Last reply
                                14
                                • calavera@lemmy.zipC [email protected]

                                  It makes sense though

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

                                  https://en.wikipedia.org/wiki/Stockholm_syndrome

                                  M 1 Reply Last reply
                                  26
                                  • S [email protected]

                                    So, just don’t use JavaScript?

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

                                    Yeah! Wasm is a thing. At least rust and go are pretty neat in the browser lately.

                                    We should leave that pile of semantics and just go further with web development

                                    1 Reply Last reply
                                    0
                                    • Q [email protected]

                                      Since it needs to be compiled to JavaScript in order to be used, I kind of consider it a different language. Yes, it's a strict superset of JavaScript, but that makes it different.

                                      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 [email protected]
                                      #138

                                      That's your prerogative, but it honestly doesn't make sense. Typescript adds almost no functionality to JS (and the few pieces it adds are now considered mistakes that shouldn't be used anymore). It only focuses on adding typing information, and in the future you'll be able to run TS that doesn't use those few added features as JS (see the proposal).

                                      You can also add the TS types as comments in your JS code, which IMO shows that it's not a different language.

                                      1 Reply Last reply
                                      1
                                      • M [email protected]

                                        That's also my understanding: "Javascript is great because you can use other languages and then transpile them to JS."

                                        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 [email protected]
                                        #139

                                        JS itself is great, I prefer it to most other languages due to the flexibility that it allows. Adding types through TS to safeguard against footguns doesn't mean you're not still using JS. You can also add the types using comments instead if you prefer it, which means you're actually writing raw JS.

                                        1 Reply Last reply
                                        0
                                        • calavera@lemmy.zipC [email protected]

                                          It makes sense though

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

                                          .... It does?

                                          1 Reply Last reply
                                          6
                                          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