D•Scribe
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 2 years ago

Brace Style

sh.itjust.works

message-square
153
link
fedilink
1.32K

Brace Style

sh.itjust.works

Sjmarf@sh.itjust.works to Programmer Humor@programming.dev · 2 years ago
message-square
153
link
fedilink
  • zalgotext@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    2 years ago

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

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

      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 years ago

        Tabs!

        • nexussapphire@lemm.ee
          link
          fedilink
          English
          arrow-up
          11
          ·
          2 years ago

          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
            ·
            2 years ago

            deleted by creator

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

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

          • ulterno@lemmy.kde.socialBanned
            link
            fedilink
            English
            arrow-up
            4
            ·
            2 years ago

            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 years ago

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

        • baltakatei@sopuli.xyz
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          deleted by creator

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.

  • 298 users / day
  • 4.53K users / week
  • 8.39K users / month
  • 17.8K users / 6 months
  • 23 local subscribers
  • 31.6K subscribers
  • 2.22K Posts
  • 81.4K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • UI: unknown version
  • BE: 0.19.17
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org