Campfyre
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 2 年前

Brace Style

sh.itjust.works

message-square
155
fedilink
1.31K

Brace Style

sh.itjust.works

Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 2 年前
message-square
155
fedilink
  • go $fsck yourself@lemmy.world
    link
    fedilink
    English
    arrow-up
    21
    ·
    2 年前

    It’s just YAML…

    • Fillicia@sh.itjust.works
      link
      fedilink
      arrow-up
      25
      ·
      2 年前

      YAML makes you appreciate Python’s 4 spaces indentation.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        13
        ·
        2 年前

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

        • Fillicia@sh.itjust.works
          link
          fedilink
          arrow-up
          20
          ·
          2 年前

          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
          10
          ·
          2 年前

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

          • ℍ𝕂-𝟞𝟝@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            11
            ·
            2 年前

            Python is one of the few languages with an official style guide, I think that guide says 4 spaces.

            • northendtrooper@lemmy.ca
              link
              fedilink
              arrow-up
              6
              arrow-down
              1
              ·
              2 年前

              Tabs!

              • nexussapphire@lemm.ee
                link
                fedilink
                English
                arrow-up
                11
                ·
                2 年前

                I’ve set tabs to four spaces in vim because who the fuck defaults tab to eight spaces. That shit looks alien and pushes text off the screen fast.

                • oscar@programming.dev
                  link
                  fedilink
                  English
                  arrow-up
                  8
                  ·
                  edit-2
                  2 年前

                  deleted by creator

                  • nexussapphire@lemm.ee
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    2 年前

                    I don’t develop kernel modules, I use python. That’s pretty interesting though.

                • ulterno@lemmy.kde.social
                  link
                  fedilink
                  English
                  arrow-up
                  4
                  ·
                  2 年前

                  I set my clang-format to tabs only (actual tabs ASCII 0x9, no alignment and there is a continuation tab instead), then anyone can set their editor to whatever tab length they feel like and look at their code however they want.

                  But no spaces on the left of my code. This is for C, C++ and JSON.

              • lad@programming.dev
                link
                fedilink
                English
                arrow-up
                5
                ·
                2 年前

                4 tabs is a bit overboard, don’t you think?

              • baltakatei@sopuli.xyz
                link
                fedilink
                arrow-up
                1
                ·
                2 年前

                deleted by creator

      • Simulation6@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        2 年前

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

        • BeardedGingerWonder@feddit.uk
          link
          fedilink
          English
          arrow-up
          6
          ·
          2 年前

          Just assign tab to 4 spaces.

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.

  • 314 users / day
  • 2.73K users / week
  • 7.06K users / month
  • 18.5K users / 6 months
  • 1 local subscriber
  • 31.7K subscribers
  • 2.31K Posts
  • 85.9K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org