but effectively it’s bash, I think /bin/sh is a symlink to bash on every system I know of…
Edit: I feel corrected, thanks for the information, all the systems I used, had a symlink to bash. Also it was not intended to recommend using bash functionality when having a shebang !#/bin/sh. As someone other pointed out, recommendation would be #!/usr/bin/env bash, or !#/bin/sh if you know that you’re not using bash specific functionality.
Still don’t do this. If you use bash specific syntax with this head, that’s a bashism and causes issues with people using zsh for example. Or with Debian/*buntu, who use dash as init shell.
Just use #!/bin/bash or #!/usr/bin/env bash if you’re funny.
#!/bin/bash doesn’t work on NixOS since bash is in the nix store somewhere, #!/usr/bin/env bash resolves the correct location regardless of where bash is
I do think a simple symlink is superior to a tool parsing stuff. A shame POSIX choose this approach.
Still the issue that a posix shell can be on a non-posix system and vice versa. And certificates versus used practice. Btw, isn’t there only one posix certified Linux distro? Was it Suse?
Binaries are not in /usr/bin or /bin except for /bin/sh and /usr/bin/env. Programs should not assume fixed paths for binaries and instead look for them in $PATH.
It is a symlink, but bash will automatically enable posix compliance mode if you use it. So any bash specific features will bomb out unless you explicitly reset it in the script.
i thought most unix-like systems had it symlinked to a shell like dash. it’s what i have on my system (void linux), of course not as an interactive shell lol
i use #!/bin/sh for posix scripts and #!/usr/bin/env bash for bash scripts. #!/bin/sh works for posix scripts since even if it’s symlinked to bash, bash still supports posix features.
Beginning with DebianSqueeze, Debian uses Dash as the target of the /bin/sh symlink. Dash lacks many of the features one would expect in an interactive shell, making it faster and more memory efficient than Bash.
From DebianSqueeze to DebianBullseye, it was possible to select bash as the target of the /bin/sh symlink (by running dpkg-reconfigure dash). As of DebianBookworm, this is no longer supported.
Before everyone loses their minds, in Extreme Programming there are safeguards other than PR reviews. Before you submit a PR, you are supposed to have written the tests and to have written your code with pair programming, so your code already has some safety measures in place. On top of that, when you merge and deploy, more tests are run, and only if all of them are green do your changes go into production.
You lost me at “pair programming”. Having tests for what you can test is fine. But there’s code that simply can’t be tested, or at least not easily at which point you are just wasting time. Open source mantra is always great in my opinion… release early, release often. In addition to that have a test version of your software before you push it to production if there’s sensitive data. That’s usually good enough to catch issues.
And he’s right, reviewing changes before merge just takes time and resources away from project while the master branch keeps moving. Merge, if there are issues, whoever submitted the change is obliged to fix it. You can always checkout earlier version.
I just made a github action that merges anything updated in master into feature branches automatically. you get pinged if there’s a conflict but the automerge keeps drift to a minimum so it’s less common and fixed sooner.
better than merging poorly tested/reviewed code.
and yeah, a small team of superstars doesn’t need reviews so much, but most teams have a range of devs with different levels of experience and time working with particular parts of a large codebase. Someone more senior or more expert derisks people picking up tickets and improves code quality.
it also leads to plenty of good conversations about the best way to implement, so overall it’s a win.
Well, Git was designed to branch out, not be a single repo with bunch of users. So one team can have a local repo, that in turn gets merged into big one, etc. Structure matters as you say. Small experienced teams move fast. Big teams require a lot of management and supervision. I still think it’s better to split people up into small teams and give individual tasks, or let them pick tasks that need to be done.
I’ve once had a course involving programming and the lecturer rewrote the code, which we were usually using at our institute, making ALL variables global. - Yes, also each and every loop counter and iterator. 🤪
There’s no way you teach a uni course and do this kind of thing unless to demonstrate poor practice/run time difference. Are you sure you were paying attention?
Yes. He really thought it was efficient and would avoid errors if literally all variables were defined in a single Matlab function he called at the beginning of the script. We students all thought: “Man, are you serious?” As we didn’t want to debug such a mess, in our code, we ignored what he was doing and kept using local variables.
Yes, it was a course on finite deformation material models. And no, you do really, really not want to declare each and every variable in your material subroutine globally for the whole finite element program.
That’s why when your job hires new people right out of college they have no idea what they’re doing and now must be trained how to actually do the job. “What, you mean we aren’t writing this enterprise application in python!?”
And this mentality is exactly why they keep shoving it down our throats.
People should stop equating Edge to Internet Explorer. It isn’t the same browser, it has a lot less problems, it is quite a lot faster, it it compatible with anything.
Edge shouldn’t have the stigma of Internet Explorer. It is a very decent modern browser.
Ah, the good ol’ “I’m not, but actually am, but not enough that I should get a raise, but I really would like one and less work hours, but I really need to stay longer because I’m so slow at everything I do and am terrible at focusing so I should really be working harder to give you your money’s worth, but you’re probably not paying me as much as you should be for that work in hindsight” theoretical with yourself and your imagined boss.
Not sure if this is obscure or not: I have F12 bound to cycle through the low- to high-contrast versions of my color scheme so I can keep working when the sun hits my shitty laptop screen.
I’ve used it to help me understand some code concepts and debugging, but over the last two weeks, it went from competent to completely stupid half of the time. It also fails to connect so often, it’s unreal.
For me it starts bullshitting about Microsoft being a large company so mistakes can happen, but ofc M$ is dedicated to being good and reliable blablabla. Definitely not my experience with M$ Teams. I should reach out to support. Well those idiots first “advice” would be using Edge on Windows ofc. 1000010592
programmer_humor
Top
This magazine is from a federated server and may be incomplete. Browse more on the original instance.