The Bard's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf to Programmer Humor@programming.dev • 10 months ago

Brace Style

sh.itjust.works

message-square
90
fedilink
1.05K

Brace Style

sh.itjust.works

Sjmarf to Programmer Humor@programming.dev • 10 months ago
message-square
90
fedilink
alert-triangle
You must log in or register to comment.
  • @TunaCowboy@lemmy.world
    link
    fedilink
    158•
    edit-2
    6 months ago

    deleted by creator

    • z500
      link
      fedilink
      41•
      edit-2
      10 months ago

      You win a free trip to the Hague

      • @SkyezOpen@lemmy.world
        link
        fedilink
        14•10 months ago

        They don’t even deserve the trial. Straight to gulag.

        • @uis@lemm.ee
          link
          fedilink
          3•10 months ago

          Still need at least troyka to send to gulag. Or regular court outside of stalinism.

          • @lud@lemm.ee
            link
            fedilink
            3•10 months ago

            The taxi chauffeur can be judge and do it on the way to the gulag.

            Obviously the sentence is predetermined.

    • @dariusj18@lemmy.world
      link
      fedilink
      23•10 months ago

      Can this be done with emoji?

      • @brbposting@sh.itjust.works
        link
        fedilink
        English
        5•10 months ago

        😫

    • @humbletightband@lemmy.dbzer0.com
      link
      fedilink
      75•10 months ago

      You can’t be helped, sorry. We will put you to an asylum for people like you

      • @milicent_bystandr@lemm.ee
        link
        fedilink
        25•10 months ago

        Asylum? We have the electric chair for this.

        • @humbletightband@lemmy.dbzer0.com
          link
          fedilink
          11•10 months ago

          Yeah, now I see why you want him dead. He used mov after lea

      • @uis@lemm.ee
        link
        fedilink
        2•10 months ago

        Pack him, boys: https://youtu.be/hHuLZFuugTQ

    • @MajorHavoc@programming.dev
      link
      fedilink
      16•10 months ago

      Thanks. I hate it.

    • @xmunk@sh.itjust.works
      link
      fedilink
      19•10 months ago

      Acceptable, just FYI I added a pre-commit git hook, please rebase your changes.

  • SolidGrue
    link
    fedilink
    English
    60•
    edit-2
    10 months ago

    Looks like Python, but in an editor with a weird TUI scrollbar

    • @arudesalad@sh.itjust.works
      link
      fedilink
      9•
      edit-2
      10 months ago

      Doesn’t python need colons after if/else/for/etc. statements?

      • @_stranger_@lemmy.world
        link
        fedilink
        3•10 months ago

        Heh, so in Python it’s possible to overload operators in the context of objects. I bet it would be possible to overload tabs to do the same thing as colons inside a context manager, but that’s pure speculation.

        • @frezik@midwest.social
          link
          fedilink
          1•10 months ago

          IIRC, Python handles whitespace indentation by having the tokenizer convert them to INDENT/DEDENT tokens. The grammar can then handle them equivalently to a curly brace language.

        • @takeda@lemmy.world
          link
          fedilink
          3•10 months ago

          Perhaps I don’t understand you, but I don’t think there’s a way to override spaces in python in any way. The spaces are handled by the parser.

          • @_stranger_@lemmy.world
            link
            fedilink
            2•
            edit-2
            10 months ago

            You can define what happens for an object when an operator is applied (like +, /, or -) so that you can obj+obj. I wonder if there’s a way to override “tab” such that it acts like a “:”, but from inside the language (this is trivial if you edit the language itself like you suggest). Thinking about it more, I’m guessing not since “:” isn’t an operator and this doesn’t have a corresponding __operator__ function.

            • @takeda@lemmy.world
              link
              fedilink
              1•10 months ago

              I see. I would love to be proven wrong, but I don’t see a way this would work with tabs/spaces in python.

  • @SlothMama@lemmy.world
    link
    fedilink
    41•10 months ago

    I low key love it. It’s unconventional, but it’s not hard to read

    • @repungnant_canary@lemmy.world
      link
      fedilink
      25•
      edit-2
      5 months ago

      deleted by creator

      • Jyek
        link
        fedilink
        8•10 months ago

        I think this could be better for reading but harder for writing. Like you could write a script that converts between this and the easier to write way if you are working on a project with others.

      • Caveman
        link
        fedilink
        2•10 months ago

        On braces are not used in if or for statements

  • kamen
    link
    fedilink
    8•10 months ago

    What amazes me is that someone either did that manually or wrote a formatter to do that - I doubt that any standard style config would do this.

  • @GissaMittJobb@lemmy.ml
    link
    fedilink
    10•10 months ago

    Automatically enforced deterministic formatting is the best, there’s nothing that beats it. The productivity in just being able to format on save knowing that the code will be in the ideally formatted state, along with the anti-bikeshedding properties of this strategy, makes it unbeatable.

    • @h0bbl3s@lemmy.world
      link
      fedilink
      5•10 months ago

      gofumpt and gofmt are the best. One of the reasons if I have a choice I’ll code in go. I heard rumblings that rust was working towards having rustfmt be a standard crate.

      • @GissaMittJobb@lemmy.ml
        link
        fedilink
        6•10 months ago

        Go is in a good position, yeah. JavaScript has prettier, which is nice. Java has google-java-format. Python has ruff, which is quite good. Kotlin has ktfmt, which I believe made a mistake with their standards by not following the standard formatting guidelines for the language, but whatever. Uniform and deterministic for the win.

  • @Sanctus@lemmy.world
    link
    fedilink
    English
    29•10 months ago

    • @the_tab_key@lemmy.world
      link
      fedilink
      7•10 months ago

      I forgot Moses was in Tron

  • OhStopYellingAtMe
    link
    fedilink
    16•10 months ago

    Damn. That’s tidy to the point of inconvenience.

  • @Fillicia@sh.itjust.works
    link
    fedilink
    63•10 months ago

    • go $fsck yourself
      link
      fedilink
      English
      17•10 months ago

      It’s just YAML…

      • @Fillicia@sh.itjust.works
        link
        fedilink
        23•10 months ago

        YAML makes you appreciate Python’s 4 spaces indentation.

        • Victor
          link
          fedilink
          12•10 months ago

          I thought python allowed whatever indentation you wanted as long as it’s consistent?

          • @zalgotext@sh.itjust.works
            link
            fedilink
            8•10 months ago

            It does, but most style guides and autoformatters will use 4

          • @Fillicia@sh.itjust.works
            link
            fedilink
            19•10 months ago

            pep8 calls for 4 space but it is a guidance not a rule.

            Google internal style guide recommend(ed?) 2 spaces to accomodate the line length limit.

    • @Kojichan@lemmy.world
      link
      fedilink
      2•10 months ago

      I’d love to see your .editorconfig.

      …

      …

      What’s that in your project root? …pom.xml? Misread that at first as porn.xml.

      • @Fillicia@sh.itjust.works
        link
        fedilink
        2•10 months ago

        I’m not the OG on this, just an old reddit post I remembered

        https://old.reddit.com/r/ProgrammerHumor/comments/9fhvyl/writing_yaml/

      • @0ops@lemm.ee
        link
        fedilink
        1•10 months ago

        porn.xml

        If I had a nickel every time I read it like that

  • @Revan343@lemmy.ca
    cake
    link
    fedilink
    35•10 months ago

    I kinda like it, easy to see unbalanced braces

  • @MadMadBunny@lemmy.ca
    link
    fedilink
    49•10 months ago

    WE CAN DO THAT!?!??

    • @Skullgrid@lemmy.world
      link
      fedilink
      42•10 months ago

      … whitespace is whitespace.

      • @dQw4w9WgXcQ@lemm.ee
        link
        fedilink
        3•10 months ago

        Or you could replace most of the whitespace with repeating semicolons. Makes the code much clearer!

  • @nexussapphire@lemm.ee
    link
    fedilink
    English
    32•10 months ago

    Last day at the company, pushed over 5,000 commits. Just style changes, still passes all the checks.

    • @KairuByte@lemmy.dbzer0.com
      link
      fedilink
      9•10 months ago

      This would never pass PR review.

      • @el_abuelo@programming.dev
        link
        fedilink
        11•10 months ago

        Jokes on you, we don’t have PR review.

        • @KairuByte@lemmy.dbzer0.com
          link
          fedilink
          3•10 months ago

          Dear god

          • @el_abuelo@programming.dev
            link
            fedilink
            3•10 months ago

            He can’t hear you all the way down here.

        • @dejected_warp_core@lemmy.world
          link
          fedilink
          3•10 months ago

          This is fine.

        • @nexussapphire@lemm.ee
          link
          fedilink
          English
          1•10 months ago

          Do your code reviewers subscribe to the didn’t check looks good model? Joking btw.

  • @MystikIncarnate@lemmy.ca
    link
    fedilink
    English
    13•10 months ago

    I’m not a coder, and… Well… Thanks, I hate it.

    Even I know this is horrific. Where the fuck does this statement end? Which of these brackets refer to this section of other brackets. Idfk.

    I could give a shit less if it was just for a single block per or something but “;}}}” hurts me.

  • @MTK@lemmy.world
    link
    fedilink
    18•10 months ago

    Honestly, looks neat, might adopt this

  • @demizerone@lemmy.world
    link
    fedilink
    13•10 months ago

    Auto formatter as part of the expected language tooling is Go’s greatest move, even if their formatter doesn’t go far enough.

    • @PlexSheep@infosec.pub
      link
      fedilink
      3•10 months ago

      Rust does this too I think (or just everyone uses rustfmt).

    • JackbyDev
      link
      fedilink
      English
      2•10 months ago

      But I want my bike shed blue…

  • Binette
    link
    fedilink
    29•10 months ago

    Pseudo-python

Programmer Humor@programming.dev

!programmer_humor@programming.dev
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
  • 4 users / day
  • 221 users / week
  • 763 users / month
  • 2.39K users / 6 months
  • 1 subscriber
  • 1.13K Posts
  • 20.2K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org