Mindoki
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago

What's stopping you from writing your Rust like this?

lemmy.ml

message-square
58
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
1

What's stopping you from writing your Rust like this?

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago
message-square
58
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • notabot@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    This makes my deeply uncomfortable, like an itch I can’t quite scratch.

    • bitcrafter@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      More like a scratch you just can’t itch.

  • mostlikelyaperson@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    My medication mostly.

  • Dave.@aussie.zone
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    rustfmt

    is stopping me from writing code like this, and I have never been more happier using it after viewing this.

    • killeronthecorner@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      I’m going to write a tool that automatically adds the braces and semicolons to the column as you edit the code.

      I will call it rustfml

      • irelephant [he/him]🍭@lemm.ee
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        Crap, thats what I was thinking.

        • verstra@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          It could be run after git checkout and then rustfmt before commit.

          • killeronthecorner@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            3 months ago

            Slow down satan

  • poireCartable@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    My eyes! My eyes!!!

  • GourmetLizard@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago
  • mariusafa@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    This is why python has to be putdown

  • /home/pineapplelover@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    No

  • PhobosAnomaly@feddit.uk
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I hate it with every fibre of my being but also secretly calmed by that column of statement terminators and brackets.

    It’s like the code representation of the Vancouver riots kiss photo.

    • Lena@gregtech.eu
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      Why would that cause the same feeling?

      • PhobosAnomaly@feddit.uk
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago

        I’m not sure if you’re taking the piss or not but I’m going to choose to believe you’re asking in good faith!

        The code just feels… messy, unfamiliar, almost chaotic - but the semicolons and curly brackets in a neat little row, formatted in a satisfying way, is like an island of calm and order in the middle of a formatting clusterfuck.

        A moment of serenity in the middle of a riot, one may think.

        • Lena@gregtech.eu
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          Ohhhh thanks for the explanation, I’m a bit stupid :3

          Also, I didn’t mean it in a bad way, a genuine question. Thanks for assuming it’s in good faith ^^

  • duckythescientist@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I’m good at Python, and I don’t know Rust. This looks fine to me. I’ve fully missed the joke.

    • Logi@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      3 months ago

      Same. Until you notice the column of curly braces and semi colons in the right margin.

      • duckythescientist@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        Oh… Oh god

      • Arcka@midwest.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        Oh, so Rust is like JavaScript!

        • F04118F@feddit.nl
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          Undervalued comment right there. This is better than the OP

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          No, Rust lacks the semicolon elision rules of Javascript which make everyone always use semicolons in javascript because they’re so horribly broken.

          Rust is like ML, quite literally, not just by ancestry: The syntax is palpably ugly, but at least it’s sane, regular, and concise where it matters.

      • ryannathans@aussie.zone
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        Lgtm ship it to prod

        • Viking_Hippie@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          Lgtm? Let’s go to Madrid?

          • zlatko@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            You never review code when you have no time to do an actual review? Looks good to me :)

            • Viking_Hippie@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              0
              ·
              3 months ago

              You never review code when you have no time to do an actual review?

              Nope. Then again, I never review code at all 🤷😁

              • Mose13@lemmy.world
                link
                fedilink
                arrow-up
                0
                ·
                3 months ago

                Don’t review, don’t write tests, and don’t even do QA. All of those tasks are overhead. It’s time you could be spending completing more story points. All that matters is story points, not the customer, not your coworkers, not your happiness, not your sanity. Just story points.

            • merc@sh.itjust.works
              link
              fedilink
              arrow-up
              0
              ·
              3 months ago

              LGTM: Large Glitches, Test More!

        • AtariDump@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

  • bitcrafter@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    My humanity.

  • Tony Bark@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Oh… Oh! Well, that is creative.

  • TheAgeOfSuperboredom@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Then some jerk runs rustfmt and ruins all your hard work!

    • wise_pancake@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Can’t you fix the default format to this?

  • Stefen Auris@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Sanity

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    3 months ago

    I don’t know Rust. 🤷🏻‍♂️

    (I mean, I don’t know a lot of Python either so I can’t even get the joke. 😞)

    • MP3Martin@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Look at the right side of the code editor

      • asudox@lemmy.asudox.dev
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        lmao I didn’t even notice

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        These scrollbars with issue indicators are becoming more and more fancy

    • Limitless_screaming@kbin.earth
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      In Rust and lots of other languages you have to end each statement with a semicolon. The semi colon is usually placed right after the statement, but in this example there’s indentation after each statement before the semicolon so they’re all aligned.

      There’s also the curly brackets, they’re padded in the same way, but those usually define where a scope (block) starts and ends making it even worse.

  • 🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕕𝕚𝕝𝕖@lemm.ee
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    I like python like really really like it. But this should be a warcrime

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: !programmer_humor@programming.dev

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.

  • 20 users / day
  • 403 users / week
  • 1.15K users / month
  • 3.75K users / 6 months
  • 0 local subscribers
  • 23.4K subscribers
  • 1.06K Posts
  • 22.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.10
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org