• Hotzilla@sopuli.xyz
    link
    fedilink
    arrow-up
    274
    ·
    edit-2
    3 months ago

    They did it once by mixing meters and feets, and crashed the Mars lander.

    Edit: looked it up, wasn’t actually meters vs feet, but newton-seconds vs some American eagles per gun unit for force

  • sbv@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    78
    ·
    3 months ago

    I feel like modern compilers would turn their nose up at that shit. “Dead code? Ewww! No way I’m letting that into my syntax tree!”

      • bus_factor@lemmy.world
        link
        fedilink
        arrow-up
        25
        ·
        3 months ago

        Golang won’t even compile with dead code. Unfortunately that’s too strict, you just end up commenting out the whole block instead. At least the commented out code is obvious in review, and some automated checks catch it if you have them.

        • ramjambamalam@lemmy.ca
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          commenting out the whole block

          var foo is declared but not used is such a pain in my asshole when doing this.

        • voxel@sopuli.xyz
          link
          fedilink
          arrow-up
          14
          ·
          edit-2
          3 months ago

          most of my (rust) projects have zero (or maybe 1-2) warnings, unless I’m in the middle of working on a feature

          • micka190@lemmy.world
            link
            fedilink
            arrow-up
            24
            ·
            3 months ago

            First thing I do on my projects is enable warnings as errors and increase my warning levels when reasonable.

            Unfortunately, the same can’t be said on the projects I work on at work. Drives me crazy that we get likes 300+ warnings whenever we run the app and that we can’t change it because "they’re just warnings*.

            • Alexstarfire@lemmy.world
              link
              fedilink
              arrow-up
              8
              ·
              3 months ago

              🤢 Good lord.

              Though, I say that as I was basically forced to accept code that was using something marked deprecated because it was unreasonable to refactoring the code in that project. And I know we’re never going to change it unless it stops working. 😭 At least I marked it as an issue on the review.

              • micka190@lemmy.world
                link
                fedilink
                arrow-up
                9
                ·
                3 months ago

                Oh yeah, I’m genuinely about to hand-in my resignation as soon as I find another job over this kind of shit. I keep being told that the business is really trying to clean-up its act when it comes to coding practices, but they keep putting some of the most incompetent people I’ve ever worked with in charge of shit (because they do promotions based on years of experience instead of actual actionable experience). It’s awful.

            • Potatos_are_not_friends@lemmy.world
              link
              fedilink
              arrow-up
              5
              ·
              3 months ago

              It’s not that we want to ignore warnings. It’s just that most warnings take time to fix.

              There’s only so many hours in a day. And we have to accept technical debt in order to deliver, and then pay it off later.

              My job does it well by doing a “spring” and “summer” cleaning where we can turn out 100+ warnings into the single digits. Then busy season happens again and we’re back to 200+.

              • micka190@lemmy.world
                link
                fedilink
                arrow-up
                3
                ·
                3 months ago

                It’s not that we want to ignore warnings.

                Speak for yourself, I promise you the team I work on actively ignores warnings and doesn’t even want to solve them as they pop-up. Being told you can’t compare doubles (because of precision loss) and ignoring it is on the developer and isn’t even that hard to fix. Most of our warnings come from shit like that.

                Like, I get it. It’s probably not worth it to hunt down every “unused variable” warning (especially in an API where we used to have a variable for it and we don’t use it anymore and we don’t want to break the existing API so we just leave it there), but there’s things that are just trivial to fix when you’re working on code that’s right next to it.

            • MonkderZweite@feddit.ch
              link
              fedilink
              arrow-up
              3
              ·
              3 months ago

              Drives me crazy that we get likes 300+ warnings whenever we run the app and that we can’t change it because "they’re just warnings*.

              Laughs in Xamarin. Only 300?

              Well, it was a year ago, is Xamarin now finally changed to the new thing (what was it’s name)?

    • 1stTime4MeInMCU@mander.xyz
      link
      fedilink
      English
      arrow-up
      12
      ·
      3 months ago

      Guess what? Flight Software usually uses ancient proprietary compilers for specialized hardware running an RTOS, rip 😢

      • sbv@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        6
        ·
        3 months ago

        Woah woah WOAH WOAH.

        So you’re saying software for the Artemis landers aren’t being built with the latest TypeScript compiler and running on a canary version of v8?!

    • OsrsNeedsF2P@lemmy.ml
      link
      fedilink
      arrow-up
      31
      ·
      3 months ago

      At my first job after university, we did releases every Friday evening. From 3-5pm, all you would see in the Slack channel was a flurry of everyone committing straight to master (with a bunch of merge conflict commits between). Oh and then we’d release. Fun times.

      • ShadowCatEXE@lemmy.world
        link
        fedilink
        arrow-up
        16
        ·
        3 months ago

        A free for all, late Friday deployment is baffling… We’ve got a strict window of Tuesday-Thursday for releases (unless it’s a critical issue), and a 2-3 day merge freeze to help mitigate unexpected changes.

        We’ve got a relatively small team with LOTS of moving parts, so minimizing deployment issues is always top of mind.

      • SchizoDenji@lemm.ee
        link
        fedilink
        arrow-up
        9
        ·
        3 months ago

        I literally know multi billion dollar B2C startups doing the same. It’s got so toxic that the management regularly fires people and to fill their spots, they offer obscene amounts of money just for starter positions.

    • winky9827b@lemmy.world
      link
      fedilink
      arrow-up
      23
      ·
      3 months ago

      Eh, then you just get those idiots who avoid using TODO: because it makes the code review “harder”.

      // This is a broken example.
      // Note: remove X before doing Y
      
      • targetx@programming.dev
        link
        fedilink
        arrow-up
        11
        ·
        3 months ago

        That’s no longer a technical process issue but more of a teamcoach/HR kind of issue then. You should be able to assume good intentions from colleagues, imho.

    • ozymandias117@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 months ago

      I mean, just look at how many patches in Android are marked DO NOT MERGE, DO NOT MERGE ANYWHERE, etc, but are in mainline

      • targetx@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        We use a CI pipeline check which prevents merges to master if the code contains a TODO. A precommit hook only works if the developer has the hooks configured.

  • dan@upvote.au
    link
    fedilink
    arrow-up
    58
    ·
    3 months ago

    At my workplace, we have a lint rule that reports an error if @nocommit is anywhere in the file, plus a commit hook that blocks all commits with @nocommit anywhere in them. It works well and has saved me a few times.

    Works pretty well, except the lint rule and its associated tests have to do something like "@no"+"commit" to avoid triggering it,

    • bus_factor@lemmy.world
      link
      fedilink
      arrow-up
      15
      ·
      3 months ago

      I did the same thing with “DO NOT MERGE” back in the day. Saved some people who didn’t even know about the check.

    • wim@lemmy.sdf.org
      link
      fedilink
      arrow-up
      7
      ·
      3 months ago

      In a lot of modern work flows this is incompatible with the development pattern.

      For example, at my job we have to roll a test release through CI that we then have to deploy to a test kubernetes cluster. You can’t even do that if the build is failing because of linting issues.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        10
        ·
        edit-2
        3 months ago

        The test release shouldn’t have anything marked with @nocommit though… The idea is that you use it to mark code that is only temporary local debugging code that should never be committed.

        • Bene7rddso@feddit.de
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

          Are you committing to master? I don’t see any reason why you shouldn’t commit your debugging code to your own branch. Obviously clean it up before merging

          • dan@upvote.au
            link
            fedilink
            arrow-up
            1
            ·
            3 months ago

            My workplace uses feature flags rather than feature branches, and a continuous deployment cycle, so we only have one branch.

      • bus_factor@lemmy.world
        link
        fedilink
        arrow-up
        9
        ·
        3 months ago

        That requires someone to look at that section in the IDE. If it doesn’t block the merge, it doesn’t do shit.

          • OpenStars@startrek.website
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            Oh I should have added a /s I guess - gVim is really old, and while I literally do use it (DAILY) and also legit DO think that it is great, I am not really advocating for it. I have heard great things about Sublime, but even that is dated and apparently neovim is much more highly regarded. Anyway, thanks for pointing that out!:-)

            • AVincentInSpace@pawb.social
              link
              fedilink
              English
              arrow-up
              5
              ·
              3 months ago

              Oh, no, I totally get it. Vim, and its modernized fork Neovim, are phenomenal editors, and they still hold up today – I was born post-9/11 and I still use Neovim for all of text editing needs, from development work to editing config files. It’s just better. That said, I do still like 21st century features like LSP linting and auto complete, drop shadows for floating windows, emoji/nerdfonts, and font ligature support, which Neovim and its frontend Neovide provide.

              Neovide is a graphical frontend for Neovim just as gVim is a graphical frontend for Vim. I like to think of it as a terminal emulator that can only run Neovim (although you can still :term from within Neovim to get a shell) and communicates with it via RPC, which allows it to have some fun Neovim-specific extensions like allowing sub-character scrolling, animating the cursor as it jumps around the screen, having window opacity, fullscreen etc. configurable via Vim commands and therefore keybinds, and, of course, all the modern terminal emulation amenities like truecolor, full Unicode support, and ligature support (I’m sorry I just really like Fira Code).

              If you haven’t already tried Neovim, and there aren’t any Vim-9.0-specific features you depend on, I highly recommend giving it a shot. It’s 100% backwards compatible with Vim 8 and earlier (after you point it at your existing vim config) and it adds support for Lua scripting, a built-in LSP client that all plugins can access so you don’t have to rely on CoC for everything (although you can continue to use CoC if you so desire), and community support in the form of Neovim-only plugins such as the fantastic telescope.nvim. It really does feel like Vim turned into a full fledged IDE, without sacrificing anything that makes it Vim – including its performance (external memory-hogging LSP servers notwithstanding).

              • XTL@sopuli.xyz
                link
                fedilink
                arrow-up
                3
                ·
                3 months ago

                I finally moved to neovim some time ago. I usually find frontends and plugins to be more trouble than they’re worth, but I should probably have a look at that. If it ever ends up in Debian, that is.

                • AVincentInSpace@pawb.social
                  link
                  fedilink
                  English
                  arrow-up
                  3
                  ·
                  edit-2
                  3 months ago

                  Why wait? It’s available from the project page as an AppImage, and if you’d rather build from source, it’s a Rust app – just clone the repo and cargo install --path . (or `cargo install --git https://github.com/neovide/neovide if you’d rather skip that step)

                  As for GUI frontends being a hassle, though, I hate to say I kind of agree with you, at least at first – I quite like Neovide now that I’ve gotten used to it (and bothered to configure it to my liking), but Konsole has more sensible defaults for sure. I’m also in the habit of :q any time I need to go back to a terminal to compile something and it is incredibly frustrating having my terminal emulator close and my entire editing session disappear on me whenever muscle memory takes over.