shellcheck: https://www.shellcheck.net/
ZX – A tool for writing better scripts
111–120 of 143 posts
Re: ZX – A tool for writing better scripts
#112Earlier quoted context omitted.
It's asynchronous, which is pretty neat
A script, by its very nature, is synchronous. You run, you get a result. If you want a service, don't use a script.
Re: ZX – A tool for writing better scripts
#113This looks really cool, actually, and I'm surprised I haven't heard of this before. My incorrect gut intuition is that JavaScript devs usually don't do very much in depth terminal level command work, but that's of course false on a Bayesian level. There are far more JavaScript developers in the world than there are even Python developers, to say nothing of the long tail of even less popular languages. If 30% of JS de…
> There are far more JavaScript developers in the world than there are even Python developers I don’t think that’s true. Anecdotally when I was interviewing at a recruiting company (and we let candidates pick any language to be assessed in), Python was by far the most popular choice, chosen by about 60% of candidates or something like that. Java and JavaScript came after, followed by a long tail of languages like C#…
https://survey.stackoverflow.co/2023#section-most-popular-te...
Re: ZX – A tool for writing better scripts
#114Shell scripting has a long and glorious history, filled with incremental improvement in the tooling that have proven themselves over decades. The shell scripting languages themselves and all the awesome tools that come along with them on UNIX.
You are 100% guaranteed to be reinventing the wheel over and over (and poorly) if you write shell scripts without a good understanding of what is available "Off the shelf"
There are great benefits to had by using am appropriate language for the task at hand.
Re: ZX – A tool for writing better scripts
#115Re: ZX – A tool for writing better scripts
#116It looks like people don’t get it. This isn’t “better” than your tool of choice. This is a tool for JavaScript developers to write non-trivial scripts in a portable way without getting lost in POSIX hell. Who came up with this stuff? https://stackoverflow.com/a/13373256 If you can write shell code, Perl, Python, COBOL, suit yourself. This is for JavaScript developers in JavaScript projects.
They're probably on the spectrum.
(I'll get my coat...)
Re: ZX – A tool for writing better scripts
#117This looks really cool, actually, and I'm surprised I haven't heard of this before. My incorrect gut intuition is that JavaScript devs usually don't do very much in depth terminal level command work, but that's of course false on a Bayesian level. There are far more JavaScript developers in the world than there are even Python developers, to say nothing of the long tail of even less popular languages. If 30% of JS de…
> There are far more JavaScript developers in the world than there are even Python developers I don’t think that’s true. Anecdotally when I was interviewing at a recruiting company (and we let candidates pick any language to be assessed in), Python was by far the most popular choice, chosen by about 60% of candidates or something like that. Java and JavaScript came after, followed by a long tail of languages like C#…
Re: ZX – A tool for writing better scripts
#118It looks like people don’t get it. This isn’t “better” than your tool of choice. This is a tool for JavaScript developers to write non-trivial scripts in a portable way without getting lost in POSIX hell. Who came up with this stuff? https://stackoverflow.com/a/13373256 If you can write shell code, Perl, Python, COBOL, suit yourself. This is for JavaScript developers in JavaScript projects.
Here's an example: https://gitlab.com/vincenttunru/penny/-/blob/main/scripts/bu... That used to be a shell script. But this I can way more easily read (even after not touching it for a long time), I get autocompletion, and I can use the APIs I'm already familiar with. It's a pretty neat QoL improvement for me specifically.
await Promise.all(
unneededPages.map(async (page) => {
await fs.move(page, `scripts/.cache/${page}`, { overwrite: true });
})
);
Similar to what you do on line 26.Re: ZX – A tool for writing better scripts
#119Earlier quoted context omitted.
> There are far more JavaScript developers in the world than there are even Python developers I don’t think that’s true. Anecdotally when I was interviewing at a recruiting company (and we let candidates pick any language to be assessed in), Python was by far the most popular choice, chosen by about 60% of candidates or something like that. Java and JavaScript came after, followed by a long tail of languages like C#…
If you need a programming language for you job, but you're not primarily a developer, and two languages would probably be overkill, then your one language is probably python. That's a lot of people.
Re: ZX – A tool for writing better scripts
#120Earlier quoted context omitted.
Here's an anecdote to help your gut. I'm a platform engineer who's favorite language is Typescript. I LIVE in the terminal. The only reason I use vscode is cause it's easier to put him into vscode than it is to put vscode into vim. Otherwise I'd be in the terminal for everything but browsing.
Likewise! I use TypeScript everywhere possible, and zx is a godsend. Unfortunately, I've recently dealt with gobs of Python for ML software. After years of writing TypeScript, it's been a...sobering reminder of many painful coding issues that I'd forgotten even existed. Made me deeply appreciate what TS gives us haha.