set -e
Which forces the script to exit on first error.
This line be in the bible as Genesis 1:1
function main {
if ! failing_cmd; then
log "this fails!"
return 1
fi
log "this won't log"
}main
I only mention this because there are folks who don't like set -e.
I did some Rust training with Ferrous but by far the most useful way to learn was just picking up a project and building it.
I've tried several times Vim and I just don't get it how you can live without certain functionalities, I'm sure that with enough tinkering you can get pretty close but, for example, search seems to always be kind of a pain in the ass for the complex queries with regex through many files and stuff like that, specially the presenting of results has never been close in my opinion as to something like IntelliJ does it.
Things like "god damn, I've done goofed or I don't quite remember something" and having the internal file history with a diff readily available.
Some of the click and find implementation/usages never seems to quite there to me.
I could go on, if you're truly being productive and not missing out on feature, more power to you, but I honestly wonder if there's no element of fun/pride in using something like vim now-a-days, which of course is totally fine and way more important in my book (to an extent) to pure productivity.
There is also the point of being able to use vim bindings inside of the IDE.
Maybe I'm just an idiot that can't Vim, totally open to that idea, but I'm truly wondering how productive it actually is.
Bash is just too damn fast to whip things up in (even at the risk of endless footguns). Build up a pipeline of commands, translate into script, done. It's powerful and can scale if common conventions and good practices are used.
For easier debugging I always add a simple flag along the lines of: if $1 = -v then set -x; shift
Obviously shellscripts are a terrible or highly suspect idea when production-grade transactional integrity is critical, but in many cases the swiftness of shell development outweighs the cons when the goal is to Get Things Done.
The shell is a pretty sweet interface.