Discover
  • Communities
  • Create Post
  • Create Community
  • 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
35
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
148

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
35
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • duckythescientist@sh.itjust.works
    link
    fedilink
    arrow-up
    38
    ·
    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
      69
      ·
      edit-2
      3 months ago

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

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

        Lgtm ship it to prod

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

          Lgtm? Let’s go to Madrid?

          • zlatko@programming.dev
            link
            fedilink
            arrow-up
            4
            ·
            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
              3
              ·
              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 🤷😁

              • moseschrute@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                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
              1
              ·
              3 months ago

              LGTM: Large Glitches, Test More!

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

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

        Oh, so Rust is like JavaScript!

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          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.

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

          Undervalued comment right there. This is better than the OP

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

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

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

      Can’t you fix the default format to this?

  • Dave.@aussie.zone
    link
    fedilink
    arrow-up
    19
    ·
    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
      4
      ·
      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
        2
        ·
        3 months ago

        Crap, thats what I was thinking.

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

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

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

            Slow down satan

  • PhobosAnomaly@feddit.uk
    link
    fedilink
    arrow-up
    19
    ·
    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.

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

    Oh… Oh! Well, that is creative.

  • BigMikeInAustin@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    3 months ago

    I’ll allow it!

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

    Sanity

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    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. 😞)

    • Limitless_screaming@kbin.earth
      link
      fedilink
      arrow-up
      5
      ·
      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.

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

      Look at the right side of the code editor

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

        lmao I didn’t even notice

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

    It took me way too long to notice the horror on the right

    • Rusty Shackleford@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      My eyes!

  • CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    Wow, so this is possible.

    Formatting is so damn arbitrary. Somebody has to have tried storing just the parse tree on disk, right?

  • notabot@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

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

  • GourmetLizard@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago
  • mostlikelyaperson@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    My medication mostly.

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

    No

  • mariusafa@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    This is why python has to be putdown

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.

  • 1.85K users / day
  • 4.17K users / week
  • 7.8K users / month
  • 16.9K users / 6 months
  • 1 local subscriber
  • 23.3K subscribers
  • 1.36K Posts
  • 40.6K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org