
Put your bash code in functions - polyrand
https://ricardoanderegg.com/posts/bash_wrap_functions/
======
flatfilefan
“makepdf & makedoc & openapp” Suddenly the choice of & to send a job into
background makes total sense!

~~~
rurban
But formatting.

You need to put the three commands into seperate lines for your sanity. Too
close to &&

------
_bxg1
This is one reason I have reservations about async/await syntax in JavaScript.
Promises are parallel by default; you have to go out of your way to make them
"synchronous". The synchronous way of doing things may be clunky, but I'm not
so sure that isn't a feature. In my experience it's uncommon that
synchronicity is what you want. But with async/await, you're doing things
sequentially _by default_. This means it's really easy to accidentally make
things take longer than they need to.

~~~
furstenheim
Parallelizing is plain simple "await Promise.all([first, second])" Problem is
doing some serious synchronization like n at a time or similar. Those things
are better of with callbacks

~~~
_bxg1
That's still clunkier than

    
    
      await first
      await second
    

So lots of people might not ever think to do it the other way. If you don't
have intimate knowledge of how promises work and what async/await really do,
you might not even realize that this is wrong.

~~~
furstenheim
You can always move it to a variadic function and do

    
    
        await parallel(first, two)
    

If your concern is clunkiness, I'm curious about callbacks, they're definitely
more complex to use.

I understand your point that not knowing how promises work can lead to not
optimizing them, but going from one to the second can easily done on another
iteration. On the other hand, not being capable with callbacks can easily lead
to (callback) hell, then you need to first fix the mess, then optimize.

