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. The meaning of this

The meaning of this

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
14 Posts 13 Posters 0 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.
  • cm0002@lemmy.worldC This user is from outside of this forum
    cm0002@lemmy.worldC This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #1
    This post did not contain any content.
    N M T S S 9 Replies Last reply
    288
    • cm0002@lemmy.worldC [email protected]
      This post did not contain any content.
      N This user is from outside of this forum
      N This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #2

      Yeah, this is that.

      1 Reply Last reply
      10
      • cm0002@lemmy.worldC [email protected]
        This post did not contain any content.
        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
        #3

        "We wanted it to work like Perl," said someone who should have been killed on the spot.

        P 1 Reply Last reply
        15
        • M [email protected]

          "We wanted it to work like Perl," said someone who should have been killed on the spot.

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

          At the time JS was created, Perl didn't have a this. A lot of the docs and books suggested using $self but a reference to the object would be passed as the first parameter to all class methods and you assign that to any name you wanted.

          It's only very recently (as in the last year or so) with a new class system that Perl has hard-coded $self for that purpose.

          M 1 Reply Last reply
          6
          • P [email protected]

            At the time JS was created, Perl didn't have a this. A lot of the docs and books suggested using $self but a reference to the object would be passed as the first parameter to all class methods and you assign that to any name you wanted.

            It's only very recently (as in the last year or so) with a new class system that Perl has hard-coded $self for that purpose.

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

            I mean $_.

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

              Go:

              MCU universe Loki saying "I've never met this man in my life."

              1 Reply Last reply
              21
              • cm0002@lemmy.worldC [email protected]
                This post did not contain any content.
                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
                #7
                const that = this;
                
                1 Reply Last reply
                12
                • cm0002@lemmy.worldC [email protected]
                  This post did not contain any content.
                  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
                  #8

                  I did not know that about event handlers, that is actually super convenient

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

                    Rust: do you mean Self or self?

                    D 1 Reply Last reply
                    6
                    • cm0002@lemmy.worldC [email protected]
                      This post did not contain any content.
                      justas@sh.itjust.worksJ This user is from outside of this forum
                      justas@sh.itjust.worksJ This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #10

                      let self = this;

                      1 Reply Last reply
                      3
                      • fnrir@lemmy.blahaj.zoneF [email protected]

                        Rust: do you mean Self or self?

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

                        this is commonly used with a similar meaning to self in cases where self can't be used because it is a reserved keyword.

                        Example:

                            fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<St1::Item>> {
                                let this = self.project();
                                this.inner.poll_next(cx)
                            }
                        

                        https://github.com/rust-lang/futures-rs/blob/master/futures-util/src/stream/select.rs#L113-L116

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

                          Any language feature with such a long definition is a bad language feature.

                          The less such features, the better the language.

                          Thus, javascript is not a "good" language for expressing your programs.

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

                            In python self is just a convention, you can call it whatever you want 🙂

                            A 1 Reply Last reply
                            0
                            • A [email protected]

                              In python self is just a convention, you can call it whatever you want 🙂

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

                              and don’t ever pull the mask off by reading the descriptor and meta object protocol.

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