• Alien Nathan Edward@lemm.ee
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 months ago

    rules aren’t there to be enforced, they’re there so that when you break them you take a second to think about why.

  • algernon@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    Sadly, that’s not code Linus wrote. Nor one he merged. (It’s from git, copied from rsync, committed by Junio)

    • laughterlaughter@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      Plus it shows three levels of indentation. Well… there is the extra one created by the compiler directives, but do they really count?

        • rwhitisissle@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          7 months ago

          I’ve heard similar from the worst first year CS students you could ever meet. People talk out their ass without the experience to back up their observations constantly. The indentation thing is a reasonable heuristic that states you are adding too much complexity at specific points in your code that suggests you should isolate core pieces of logic into discrete functions. And while that’s broadly reasonable, this often has the downside of you producing code that has a lot of very small, very specific functions that are only ever invoked by other very small, very specific functions. It doesn’t make your code easier to read or understand and it arguably leads to scenarios in which your code becomes very disorganized and needlessly opaque purely because you didn’t want additional indentation in order to meet some kind of arbitrary formatting guideline you set for yourself. This is something that happens in any language but some languages are more susceptible to it than others. PEP8’s line length limit is treated like biblical edict by your more insufferable python developers.

      • Epzillon@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        7 months ago

        Isn’t that from 1991 while the quote is from 1995? If we’re nitpicking maybe we shouldn’t time travel 🤓

  • dejected_warp_core@lemmy.world
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    7 months ago

    One nit: whatever IDE is displaying single-character surrogates for == and != needs to stop. In a world where one could literally type those Unicode symbols in, and break a build, I think everyone is better off seeing the actual syntax.

    • PlexSheep@infosec.pub
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      I think it’s a lineature. FiraCide does that for example, and I like it very much. My compiler and lsp will tell me if there is a bad char there. Besides, the linea tires take the same space as two regular characters, so you can tell the difference.

      It’s not the 90s anymore. My editor can look nice.