• xmunk@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        Hey now, you know that according to the Bible the biggest number is a million. Anything larger than that including infinity is some of that “woke shit”.

        Your array will be 999,999, 999,998, 999,997 …

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    Arrays not starting at 1 bother me. I think the entrenched 0-based index is more important than any major push to use 1 instead, but if I could go back in time and change it I would.

    • Overshoot2648@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      It really doesn’t make sense to start at 1 as the value is really the distance from the start and would screw up other parts of indexing and counters.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        13 days ago

        Yeah, but if we went back and time and changed it then there wouldn’t be other stuff relying on it being 0-based.

        • Username@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          It was not randomly decided. Even before arrays as a language concept existed, you would just store objects in continuous memory.

          To access you would do $addr+0, $addr+1 etc. The index had to be zero-based or you would simply waste the first address.

          Then in languages like C that just got a little bit of syntactic sugar where the ‘[]’ operator is a shorthand for that offset. An array is still just a memory address (i.e. a pointer).

      • Klear@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        13 days ago

        It doesn’t make sense that the fourth element is element number 3 either.

        Ultimately it’s just about you being used to it.

  • MTK@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    13 days ago

    Error handling should only be with “if”

    Variable names must be generic and similar to each-other

    Debugging is only done with prints

    Version numbers must be incoherent, hard to order correctly, contain letters and jump in ways that don’t align with the updates done.

  • kamen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    12 days ago

    Implying the orange fella has any say in programming language design and general tech conventions

  • tgm@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 days ago

    Haven’t heard of the stack address thing, anyone got a TLDR on the topic?

  • ramjambamalam@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    13 days ago
    • Push directly to master, not main
    • No command line args, just change the global const and recompile
    • No env vars either
    • Port numbers only go up to 5280, the number of feet in a mile
    • All auth is just a password; tokens are minority developers, not auth, and usernames are identity politics
    • No hashes – it’s the gateway drug to fentanyl
    • No imports. INTERNAL DEVELOPERS FIRST
    • Exceptions are now illegal and therefore won’t occur, so no need to check for them
    • SOAP/XML APIs only
    • No support for external machines. If it’s good enough for my machine, it’s good enough for yours.
    • SamboT@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      Im unfamiliar with this as well. If you are allocating memory for a stack, why does it matter which direction it populates data? Is this just a convention?

      • Gigamegs@lemmy.zip
        link
        fedilink
        Deutsch
        arrow-up
        0
        ·
        edit-2
        12 days ago

        I asked deepseek: Downward-growing stacks** are more common in many architectures (e.g., x86, ARM). This convention originated from early computer architectures and has been carried forward for consistency.

        Funny, I can’t remember, because I did a lot of assembler.

        • chonglibloodsport@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          Yes exactly. It’s a reference to the recording industry’s practice of calling the final version of an album the “master” which gets sent for duplication.

          • Zink@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            13 days ago

            In alignment with this, we should not replace the master branch with the main branch, we should replace it with the gold branch.

            Every time a PR gets approval and it’s time to merge, I could declare that the code has “gone gold” and I am not doing that right now!

            • ramjambamalam@lemmy.ca
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              Merged -> gone gold

              Deployed -> gone platinum

              Gone a week without crashing production -> triple platinum

        • Maggoty@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          But why even? There’s no risk to changing it and some risk to keeping it. That’s the reason for the push to change it. Keeping something just because it’s tradition isn’t a good idea outside ceremonies.

          • weker01@sh.itjust.works
            link
            fedilink
            arrow-up
            0
            ·
            edit-2
            12 days ago

            There is definitely a risk in changing it. Many automation systems that assume there is a master branch needed to be changed. Something that’s trivial yes but changing a perfectly running system is always a potential risk.

            Also stuff like tutorials and documentation become outdated.

            • Maggoty@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              12 days ago

              If they can’t change what’s essentially a variable name without issues then should they be doing the job?

        • qaz@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          13 days ago

          It was kind of pointless, but at least it made software work with custom default branches.