Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 4 months ago

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

lemmy.ml

message-square
61
fedilink
  • cross-posted to:
  • [email protected]
401

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

lemmy.ml

@[email protected] to Programmer [email protected] • 4 months ago
message-square
61
fedilink
  • cross-posted to:
  • [email protected]
alert-triangle
You must log in or register to comment.
  • @[email protected]
    link
    fedilink
    1•4 months ago
  • /home/pineapplelover
    link
    fedilink
    4•4 months ago

    No

  • Tony Bark
    link
    fedilink
    English
    9•4 months ago

    Oh… Oh! Well, that is creative.

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮
    link
    fedilink
    English
    6•
    edit-2
    4 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
      link
      fedilink
      14•4 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.

    • @[email protected]
      link
      fedilink
      7•4 months ago

      Look at the right side of the code editor

      • @[email protected]
        link
        fedilink
        English
        7•4 months ago

        These scrollbars with issue indicators are becoming more and more fancy

      • asudox
        link
        fedilink
        6•4 months ago

        lmao I didn’t even notice

  • @[email protected]
    link
    fedilink
    English
    51•4 months ago

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

    • Rusty Shackleford
      link
      fedilink
      English
      9•4 months ago

      My eyes!

  • @[email protected]
    link
    fedilink
    59•4 months ago

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

    • @[email protected]
      link
      fedilink
      29•4 months ago

      Can’t you fix the default format to this?

  • Stefen Auris
    link
    fedilink
    English
    8•4 months ago

    Sanity

  • 🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕠𝕕𝕚𝕝𝕖
    link
    fedilink
    English
    5•4 months ago

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

  • @[email protected]
    link
    fedilink
    83•4 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
      link
      fedilink
      162•
      edit-2
      4 months ago

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

      • @[email protected]
        link
        fedilink
        9•4 months ago

        Oh… Oh god

      • @[email protected]
        link
        fedilink
        English
        21•4 months ago

        Oh, so Rust is like JavaScript!

        • @[email protected]
          link
          fedilink
          7•4 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.

        • 🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕠𝕕𝕚𝕝𝕖
          link
          fedilink
          English
          1•4 months ago

          Pretty sure javascript is like c but I I can’t be mad at the js devs for the awful language they write.

        • @[email protected]
          link
          fedilink
          3•4 months ago

          Undervalued comment right there. This is better than the OP

      • @[email protected]
        link
        fedilink
        45•4 months ago

        Lgtm ship it to prod

        • @[email protected]
          link
          fedilink
          5•4 months ago

        • @[email protected]
          link
          fedilink
          21•4 months ago

          Lgtm? Let’s go to Madrid?

          • @[email protected]
            link
            fedilink
            12•4 months ago

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

            • @[email protected]
              link
              fedilink
              6•4 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
                link
                fedilink
                8•4 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.

            • @[email protected]
              link
              fedilink
              2•4 months ago

              LGTM: Large Glitches, Test More!

  • PhobosAnomaly
    link
    fedilink
    28•4 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
      link
      fedilink
      English
      1•4 months ago

      Why would that cause the same feeling?

      • PhobosAnomaly
        link
        fedilink
        3•
        edit-2
        4 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
          link
          fedilink
          English
          3•4 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 ^^

  • @[email protected]
    link
    fedilink
    English
    7•4 months ago

    I’ll allow it!

  • @[email protected]
    link
    fedilink
    12•4 months ago

    DwangoAC and the TASBot crew are maniacs in the best possible way. I would like to continue having a high opinion of him, hence I will pretend that this post does not exist.

  • @[email protected]
    link
    fedilink
    6•4 months ago

    My humanity.

  • Dave.
    link
    fedilink
    71•
    edit-2
    4 months ago

    rustfmt

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

    • @[email protected]
      link
      fedilink
      English
      59•4 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]🍭
        link
        fedilink
        English
        11•4 months ago

        Crap, thats what I was thinking.

        • @[email protected]
          link
          fedilink
          10•4 months ago

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

          • @[email protected]
            link
            fedilink
            English
            5•4 months ago

            Slow down satan

      • @[email protected]
        link
        fedilink
        English
        1•4 months ago

        Please do, I’m waiting for it to get ported to other languages.

  • @[email protected]
    link
    fedilink
    141•4 months ago

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

    • @[email protected]
      link
      fedilink
      143•4 months ago

      You could say they have rewritten the joke in Rust

      • @[email protected]
        link
        fedilink
        English
        18•4 months ago

        But you get the joke faster now.

        • Log in | Sign up
          link
          fedilink
          8•4 months ago

          No, it’s just impossible for it to leak out of a hole in the back of your head that you didn’t realise was growing under your pony tail.

Programmer [email protected]

[email protected]
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
  • 70 users / day
  • 186 users / week
  • 1.5K users / month
  • 4.32K users / 6 months
  • 3 subscribers
  • 1.55K Posts
  • 55.2K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @[email protected]
  • Pierre-Yves Lapersonne
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org