My Lemmy Oracle
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
ZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 25 天前

Accidental shitpost

lemmy.world

message-square
18
fedilink
149

Accidental shitpost

lemmy.world

ZILtoid1991@lemmy.world to Programmer Humor@programming.dev · 25 天前
message-square
18
fedilink
alert-triangle
You must log in or register to comment.
  • ImgurRefugee114@reddthat.com
    link
    fedilink
    arrow-up
    85
    ·
    25 天前

    The joke is even funnier on my client

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      15
      ·
      24 天前

      Yes, it blends in with Voyager’s UI because it’s a screenshot of Voyager’s UI.

  • flamingo_pinyata@sopuli.xyz
    link
    fedilink
    arrow-up
    22
    ·
    25 天前

    You’re using Java, there’s your problem

    • Kairos@lemmy.today
      link
      fedilink
      arrow-up
      8
      arrow-down
      2
      ·
      25 天前

      This syntax isn’t actually a problem by itself. Go does this too (no operator overloading)

      • Gremour@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        edit-2
        24 天前

        In Go you can compare structure instances with == (by value). You can also compare pointers (in which case they can be different even if values are equal). You get what you ask for.

        Also, I’ve never needed “Equals” method in Go.

        • Kairos@lemmy.today
          link
          fedilink
          arrow-up
          5
          ·
          24 天前

          I think you can also == two structs in Java, but not classes.

  • bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    10
    ·
    24 天前

    Is there ever an instance when you do want to compare object identity instead of “equal”-ness? I find this behaviour just confusing for beginners and not useful for experts.

    • calcopiritus@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      24 天前

      There are use cases. Like containers where the pointer to the object itself is the key (for example a set). But they are niche and should be implemented by the standard library anyway. One of the things I hate most about Java is .equals() on strings. 99.999% of times you compare strings, you want to compare the contents, yet there is a reserved operator to do the wrong comparison.

      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        24 天前

        Java has the hash interface for using in containers. You don’t need to override equality for it.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      24 天前

      99.99% of the time you want to compare by value, which is why languages defaulting to comparing by reference is a stupid default.

    • Redkey@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      23 天前

      Not to take away from your very good point, but I think the word you might be looking for is “eqivalence”.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      1
      ·
      23 天前

      Is there ever an instance when you do want to compare object identity instead of “equal”-ness?

      Maybe if you have to check if the object is one you already hold a lock for or account for some similar consequence of questionable architecture.

  • NeatNit@discuss.tchncs.de
    link
    fedilink
    arrow-up
    4
    ·
    25 天前

    Where’s the original post?

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      15
      ·
      24 天前

      https://vger.to/lemmy.world/post/9716240

    • ZILtoid1991@lemmy.worldOP
      link
      fedilink
      arrow-up
      8
      ·
      24 天前

      No longer on the internet, due to the OP’s instance is now defunct.

      • yaroto98@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        24 天前

        It was probably on AWS

        • ChaoticNeutralCzech@feddit.org
          link
          fedilink
          English
          arrow-up
          6
          ·
          24 天前

          OP’s website makmarian.com still works despite all the == usage

      • ChaoticNeutralCzech@feddit.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        24 天前

        Not really true, instances that were around to federate with kbin.social have a copy, even a preview image (see my other comment).

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.38K users / day
  • 4.76K users / week
  • 9.12K users / month
  • 19.4K users / 6 months
  • 1 local subscriber
  • 27.3K subscribers
  • 1.94K Posts
  • 69.9K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org