The Bard's Lemmy
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year ago

Brace Style

sh.itjust.works

message-square
90
link
fedilink
1.05K

Brace Style

sh.itjust.works

Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 1 year ago
message-square
90
link
fedilink
alert-triangle
You must log in or # to comment.
  • TunaCowboy@lemmy.world
    link
    fedilink
    arrow-up
    159
    ·
    edit-2
    1 year ago

    deleted by creator

    • humbletightband@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      75
      ·
      1 year ago

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

      • milicent_bystandr@lemm.ee
        link
        fedilink
        arrow-up
        25
        ·
        1 year ago

        Asylum? We have the electric chair for this.

        • humbletightband@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          12
          arrow-down
          1
          ·
          1 year ago

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

      • uis@lemm.ee
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

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

    • z500@startrek.website
      link
      fedilink
      arrow-up
      41
      ·
      1 year ago

      You win a free trip to the Hague

      • SkyezOpen@lemmy.world
        link
        fedilink
        arrow-up
        14
        ·
        1 year ago

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

        • uis@lemm.ee
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

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

          • lud@lemm.ee
            link
            fedilink
            arrow-up
            3
            ·
            1 year 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
      arrow-up
      23
      ·
      1 year ago

      Can this be done with emoji?

      • brbposting@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        5
        ·
        1 year ago

        😫

    • xmunk@sh.itjust.works
      link
      fedilink
      arrow-up
      19
      ·
      1 year ago

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

    • MajorHavoc@programming.dev
      link
      fedilink
      arrow-up
      16
      ·
      1 year ago

      Thanks. I hate it.

  • AlexWIWA@lemmy.ml
    link
    fedilink
    English
    arrow-up
    66
    ·
    1 year ago

    Python with extra steps

  • Fillicia@sh.itjust.works
    link
    fedilink
    arrow-up
    64
    arrow-down
    1
    ·
    1 year ago

    • go $fsck yourself@lemmy.world
      link
      fedilink
      English
      arrow-up
      17
      ·
      1 year ago

      It’s just YAML…

      • Fillicia@sh.itjust.works
        link
        fedilink
        arrow-up
        23
        ·
        1 year ago

        YAML makes you appreciate Python’s 4 spaces indentation.

        • Victor@lemmy.world
          link
          fedilink
          arrow-up
          12
          ·
          1 year ago

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

          • Fillicia@sh.itjust.works
            link
            fedilink
            arrow-up
            19
            ·
            1 year 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.

          • zalgotext@sh.itjust.works
            link
            fedilink
            arrow-up
            8
            ·
            1 year ago

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

    • Kojichan@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year 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
        arrow-up
        2
        ·
        1 year 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
        arrow-up
        1
        ·
        1 year ago

        porn.xml

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

  • SolidGrue@lemmy.world
    link
    fedilink
    English
    arrow-up
    60
    ·
    edit-2
    1 year ago

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

    • arudesalad@sh.itjust.works
      link
      fedilink
      arrow-up
      9
      ·
      1 year ago

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

      • _stranger_@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        1 year 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.

        • takeda@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          1 year 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
            arrow-up
            2
            ·
            1 year 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
              arrow-up
              1
              ·
              1 year 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.

        • frezik@midwest.social
          link
          fedilink
          arrow-up
          1
          ·
          1 year 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.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    53
    arrow-down
    4
    ·
    1 year ago

    Python programmer encountering a real programming language for the first time.

    • NutWrench@lemmy.ml
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      Or a former BASIC programmer who really hates braces . . .

    • Reddfugee42@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      2
      ·
      1 year ago

  • MadMadBunny@lemmy.ca
    link
    fedilink
    arrow-up
    50
    arrow-down
    1
    ·
    1 year ago

    WE CAN DO THAT!?!??

    • Skullgrid@lemmy.world
      link
      fedilink
      arrow-up
      42
      ·
      1 year ago

      … whitespace is whitespace.

      • dQw4w9WgXcQ@lemm.ee
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

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

  • SlothMama@lemmy.world
    link
    fedilink
    arrow-up
    47
    arrow-down
    6
    ·
    1 year ago

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

    • repungnant_canary@lemmy.world
      link
      fedilink
      arrow-up
      25
      ·
      edit-2
      1 year ago

      deleted by creator

      • Jyek@sh.itjust.works
        link
        fedilink
        arrow-up
        8
        ·
        1 year 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@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        On braces are not used in if or for statements

  • /home/pineapplelover@lemm.ee
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    1 year ago

    I was like, “where are the braces?”. Then, I turned to the right

    • AlecSadler@sh.itjust.works
      link
      fedilink
      arrow-up
      10
      ·
      1 year ago

      And then I realized it’s python.

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

        Wait what? It’s Python? But there are semicolons

        • petrol_sniff_king@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          6
          ·
          1 year ago

          They mean that the code is being written like it were python. You can’t get rid of the curly braces, but you can shove them all under your bed where mom can’t see.

    • Knock_Knock_Lemmy_In@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      Thank you. I couldn’t see the problem.

      And if this layout is auto generated, maybe I still don’t see the problem.

  • Revan343@lemmy.ca
    link
    fedilink
    arrow-up
    36
    arrow-down
    1
    ·
    1 year ago

    I kinda like it, easy to see unbalanced braces

  • Heavybell@lemmy.world
    link
    fedilink
    English
    arrow-up
    33
    ·
    edit-2
    1 year ago

    This looks like a python programmer that is mad they have to write C# Java…

    • schnurrito@discuss.tchncs.de
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      Pretty sure that is Java, not C#

      • Heavybell@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        No, you`re right.

  • nexussapphire@lemm.ee
    link
    fedilink
    English
    arrow-up
    32
    ·
    1 year 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
      arrow-up
      9
      ·
      1 year ago

      This would never pass PR review.

      • el_abuelo@programming.dev
        link
        fedilink
        arrow-up
        11
        ·
        1 year ago

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

        • KairuByte@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          Dear god

          • el_abuelo@programming.dev
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

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

        • dejected_warp_core@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          This is fine.

        • nexussapphire@lemm.ee
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

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

  • Binette@lemmy.ml
    link
    fedilink
    arrow-up
    29
    ·
    1 year ago

    Pseudo-python

  • Sanctus@lemmy.world
    link
    fedilink
    English
    arrow-up
    29
    ·
    1 year ago

    • the_tab_key@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      I forgot Moses was in Tron

  • MTK@lemmy.world
    link
    fedilink
    arrow-up
    19
    arrow-down
    1
    ·
    1 year ago

    Honestly, looks neat, might adopt this

  • OhStopYellingAtMe@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    1 year ago

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

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.

  • 50 users / day
  • 1.1K users / week
  • 3.97K users / month
  • 10.1K users / 6 months
  • 1 local subscriber
  • 28K subscribers
  • 1.45K Posts
  • 26K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.14
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org