fed.dyne.org
  • Communities
  • Create Post
  • Create Community
  • 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
40
link
fedilink
27

Brace Style

sh.itjust.works

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

    What if I prefer this?

    #define CURLYOPENRIGHTCLOSEDLEFTBRACKET {
    #define CURLYOPENLEFTCLOSEDRIGHTBRACKET }
    #define CURVYOPENRIGHTCLOSEDLEFTBRACKET (
    #define CURVYOPENLEFTCLOSEDRIGHTBRACKET )
    #define PERIODWITHPERIODONTOP :
    #define COMMAWITHPERIODONTOP ;
    
    int main CURVYOPENRIGHTCLOSEDLEFTBRACKET CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
      if CURVYOPENRIGHTCLOSEDLEFTBRACKET 1 CURVYOPENLEFTCLOSEDRIGHTBRACKET CURLYOPENRIGHTCLOSEDLEFTBRACKET
        asm volatile CURVYOPENRIGHTCLOSEDLEFTBRACKET
          "mov $1, %%rax\n"
          "mov $1, %%rdi\n"
          "lea message(%%rip), %%rsi\n"
          "mov $4, %%edx\n"
          "syscall\n"
          PERIODWITHPERIODONTOP
          PERIODWITHPERIODONTOP
          PERIODWITHPERIODONTOP "%rax", "%rdi", "%rsi", "%rdx"
        CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
      CURLYOPENLEFTCLOSEDRIGHTBRACKET
      return 0 COMMAWITHPERIODONTOP
    CURLYOPENLEFTCLOSEDRIGHTBRACKET
    
    asm CURVYOPENRIGHTCLOSEDLEFTBRACKET ".section .data\n"
      "message: .ascii \"wut\\n\"\n"
      ".section .text\n" CURVYOPENLEFTCLOSEDRIGHTBRACKET COMMAWITHPERIODONTOP
    
    • humbletightband@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      6
      ·
      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
        1
        ·
        1 year ago

        Asylum? We have the electric chair for this.

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

      You win a free trip to the Hague

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

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

  • Admiral Patrick@dubvee.org
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    Mom, can we stop and get some Python?

    No, we have Python at home.

    Python at home…

  • sunglocto@lemmy.zip
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 year ago

    Idk why but i fell in love with this and might just use it now

    • NigelFrobisher@aussie.zone
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I just realised why we do live coding interviews.

  • alcasa@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    That would be very cool to have in a code autoformatter

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

    Python with extra steps

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

    Honestly, looks neat, might adopt this

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

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

    • subignition@fedia.io
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      High chance that it’s a Python programmer who is really unhappy about having to work in Java, lol

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

        Agreed. I saw this and thought it looked beautifully passive aggressive

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

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

  • MystikIncarnate@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year 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.

    • velvetThunder@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Well the code indentation explains that, like python. The issue is not reading it. You would rather quit your job than edit this.

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

        tooling would have to do it all after the fact or something

  • NigelFrobisher@aussie.zone
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    My credo on this kind of thing is never do something that will make your successor so mad that they find out where you live and post parts of your body to Interpol.

  • Hack3900@lemy.lol
    cake
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I kinda like it…

    • VonReposti@feddit.dk
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      1 year ago

      I think you’ll like Ruby. It has mostly done away with braces and code blocks end with end, e.g.

      def create
        unless admin redirect_to new_session_path and return
        
        @product = Product.new product_params
      
        if @product.save
          flash[:success] = "New product has been created!"
          redirect_to edit_product_path(@product) and return
        else
          flash[:error] = "Something went wrong!
          render :new
        end
      end
      

      This is working code that I simplified a bit from an old project of mine.

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

        Ruby syntax is nice although I prefer python way of enforcing indentation instead of adding "end"s. Personally I just want a statically typed language with enforced indent as syntax.

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

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

      It’s just YAML…

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

        YAML makes you appreciate Python’s 4 spaces indentation.

        • Victor@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          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
            1
            ·
            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.

        • Simulation6@sopuli.xyz
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          4 spaces? Hard core Python programmers must have a callus on their thumbs.

          • BeardedGingerWonder@feddit.uk
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            Just assign tab to 4 spaces.

  • Match!!@pawb.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    This should be its own language. Pyava.

    • jwt@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Or Jathon (pronounced like Mike Tyson would pronounce JSON)

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

        Or we can round out the confusion and call it PythonScript

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

      This would never pass PR review.

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

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

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

          This is fine.

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

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

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

      And then I realized it’s python.

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

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

        • petrol_sniff_king@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          1
          ·
          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.

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.02K users / day
  • 4.88K users / week
  • 9.18K users / month
  • 18.9K users / 6 months
  • 1 local subscriber
  • 27.7K subscribers
  • 1.6K Posts
  • 43.3K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org