I love makefiles as well and do something similar to OP: for every repo I contribute to, especially if it's not one of mine, I'll create an uncommitted makefile to track all the shell commands that add up to my workflow within that codebase.
The ability to create dependencies between targets is the cherry on top, but the main value is just the ability to create a cheat sheet of shell snippets accessible via `make <target>` from the root of the repo.
Such a makefile is always (1) version controlled as a secret github gist (though, as personal rule, i never hardcode secrets into it), (2) committed & pushed on `make` (3) git ignored via `.git/info/exclude`. This has worked quite well for me.
One downside with this approach is that the best syntax for passing parameters down to the target from the shell is to use environment variables, which is a little awkward. `NAME=value make target` is less pleasant than `make target --name=value` would have been.
In defense of linkedin: there are different strains of toxicity and malevolence running rampant on every other major social media platform (body shaming, bullying, harassment, predation, scams, various kinds of radicalization, etc.), and many of those strains are rather subdued on linkedin.
Linkedin, of course, has some strains of its own (e.g. workism), but, surprisingly, I find it to be by far the healthiest social network out there.
That's probably owing more to self censorship than to moderation or algorithmic curation: your "professional" persona is more on display here than anywhere else.
So, yeah, sure, seems reasonable to suggest that linkedin has an anti-link bias, and the incentives for that bias are fairly intuitive. That being said, is it actually a bad thing, or does it also function as another tenet of their quiet but, in my mind, reasonably effective moderation approach?
> The point of rigour is not to destroy all intuition; instead, it should be used to destroy bad intuition while clarifying and elevating good intuition.
This is a key insight; it's something I've struggled to communicate in a software engineering setting, or in entrepreneurial settings.
It's easy to get stuck in the "data driven" mindset, as if data was the be-all and end-all, and not just a stepping stone towards an ever more refined mental model. I think of "data" akin to the second phase in TFA (the "rigor" phase). It is necessary to think in a grounded, empirical way, but it is also a shame to be straight-jacketed by unsafe extrapolations from the data.
> It's easy to get stuck in the "data driven" mindset, as if data was the be-all and end-all, and not just a stepping stone towards an ever more refined mental model.
Yes. "Data driven" either includes sound statistical modelling and inference, or is just a thiny veiled information bias.
rigour is is not about destroying bad intuition, but rather formalizing good intuition, imho. The ability to know good from bad is somewhere in-between total newb and expert.
tldp is notoriously full of bad advice, especially when it comes to shell scripting. From my time on #bash back when freenode was a thing, this was the superior resource: https://mywiki.wooledge.org/BashGuide
"Built-in commands" showcases [ ] vs [[ ]]. This is not an efficiency win, but a matter of using older POSIX syntax vs more modern and richer bash syntax. The utility of the bash syntax is that it supports nicer operators, such as < > in addition to stuff like -gt / -lt.
"Efficient File Operations" showcases IFS=, which is not used for the sake of efficiency, but to change how the line is tokenized. (And what good is an efficiency claim that's not backed up by any data?)
I did not look too closely, but I suspect the rest of this list is equally eyebrow-raising.
You probably have the `printf` in your PATH. However, if you type `printf` on a bash script, a builtin will be used instead.
Try a small benchmark to see the results of /usr/bin/printf vs printf. It really makes a difference (not invoking an external program is a huge performance win).
The author is indeed confused though. `test` for example, is also a builtin. You can have an empty PATH= and still invoke printf, test, echo and some few others.
In _some_ shells! (most user shells anyway). `dash` for example does not have help.
Some form of builtin list is always on the man pages though.
There's no good way of telling if a builtin exists programatically (for, let's say, feature detection).
There's an almost good way with `{ PATH=; command -v isthisreallife; }` and some shells will provide a `builtin isthisreallife` that you can use without having to nuke the PATH variable.
I appreciate pedantry as much as the next person, but I think it's safe to say that if you're using a shell without support for `help` you can make your way without it.
As a more practical suggestion, I find functionality detection is much less important since I learned to disavow all knowledge of a script when sharing it
It kinda does, and it is portable enough (modern bash zsh ksh dash busybox), thanks!
Of the mainstream packaged shells, it fails only on `posh`, but that's fine, posh is super austere, it also lacks `command`.
However, I will probably still use `command -v` for sporadic uses. That's because I don't need a subshell to capture the output:
OLDPATH=$PATH;PATH=
if command -v echo
then echo is builtin
fi
PATH=$OLDPATH
if test "$(type echo)" = "echo is a shell builtin"
then echo is a builtin
fi
`type` however seems to be able to pick up more stuff, so I might use it some cases like this:
case $(type echo) in
'echo is a shell builtin') do_something;;
'echo is aliased'*) do_something_else;;
'echo is /'*) do_something_else_entirely;;
esac
It kinda fits an early feature detection that I could put in a more sensible place (my lib init) and pay the subshell cost only once.
I see quite a bit more false outrage in your statements than in the ones you're replying to. Also, on what grounds do you consider your position to be apolitical? Self-evidence?
To each their own. I am far from outraged but I guess it depends what biased lens you look at it through.
Why does a position need to be political? Of course in modern US politics, party lines are stronger than ever and by identifying strongly with a party you generally identify with certain positions. But I don't believe its true that to have a position or view of the world means you have a political position. Being political, and outraged for that matter, happens when you tell someone to go somewhere else to live or explicitly bring (by naming) politics into a discussion.
I like the idea of having cameras everywhere, along with the idea that I like all police to wear cameras to hold everyone in the interaction accountable.
Mass surveillance involves giving the government, an inherently political entity, and its partners in the private sector increased power over public life. It's hard to get a more political issue than that.
I will give up here, its political in that it involves a political entity. Its depressing that the original comment jumped to "republicans are bad" logic so quickly. I understand your bias, its immediately noticeable in all of those republican subreddits as well.
It's the topic of the discussion that makes something political, not the position or the attitude. If you are talking about the affairs of the society, if you are assuming the role of a citizen (rather than a private individual), you being political.
Oh stop it. You know what I meant, don’t be coy. The person I replied to is a clown for just saying “republicans are bad mmmkay”. I am not a republican but it’s a silly response and quite tiresome.
Leopards Eating Peoples Faces Party is a reference to the commonality of people to vote for some group to have power over others, in this case to take away their privacy via technological means, and then be surprised when that power is inevitably used against them.
Has nothing to do with Republicans. I have a problem with most power at a fundamental level. I largely side with the animals who I think should be armed to bring balance back to the world.
Might want to slow your dismissal of who exactly disagrees with you.
If I am wrong I am wrong but your language was low brow enough for me that it’s easy to misinterpret. Apologies. I am glad I get to live in America and you get to live where you do!
I completely agree. My willingness to pay is directly proportional to my conviction in the effectiveness of the proposed solution.
The internet has revealed us to be very picky shoppers. We do a lot of comparison shopping, looking for the "best" deal on the silliest item. That same skepticism applies to policies, even effective ones. I want to fund the best ideas, and the best ideas should be backed by compelling models and, ideally, empirical evidence.
There's something to be said for the VC mindset here: funding many things, each of which has a low probability of succeeding, and using unicorns to subsidize numerous losses. Tax payers don't like losses, but an example of something kind of similar that the government already does today is science funding.