Lemmy.org
  • 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

external-link
message-square
19
fedilink
  • cross-posted to:
  • [email protected]
6
external-link

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
19
fedilink
  • cross-posted to:
  • [email protected]
alert-triangle
You must log in or register to comment.
  • duckythescientist@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    ·
    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
      3
      ·
      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
        3
        ·
        3 months ago

        Lgtm ship it to prod

  • Laser@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

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

      A funny, but incredibly subtle joke to do would be to do a post like this, but get the indentation subtly wrong somewhere, so something that’s supposed to be inside a loop is outside according to indentation, but is inside according to braces.

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

      To me it just looks like you do not need the braces at all

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

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

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

      Can’t you fix the default format to this?

  • 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?

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

        Crap, thats what I was thinking.

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

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

  • parlaptie@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    3 months ago

    Hang on, this is just a C++ joke slapped onto Rust.

    • puchaczyk@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      You could say they have rewritten the joke in Rust

      • dave@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        But you get the joke faster now.

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

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

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

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

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

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.44K users / day
  • 4.44K users / week
  • 8.2K users / month
  • 14.1K users / 6 months
  • 10 local subscribers
  • 23.4K subscribers
  • 580 Posts
  • 9.11K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org