News for hackers. Stuff that matters.
Re:ZX – A tool for writing better scripts by hiAndrewQuinn on Saturday February 10, 2024 @01:50AM (#39324167)
This 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 devs are heavy terminal users, and 80% of (say) Perl devs, that 30% will still swamp the 80% in terms of absolute numbers.

Hell, that's half the point of Node. Can't believe my gut isn't keeping up with my head here!

Re:ZX – A tool for writing better scripts by TJSomething on Saturday February 10, 2024 @02:53AM (#39324422)
My big use case for this is that it's quite good for glue scripting when you're already in the context of a JS shop. My common use cases are tooling setup, CI scripts, and API response sanity checking.
Re:ZX – A tool for writing better scripts by from-nibly on Saturday February 10, 2024 @02:07AM (#39324226)
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.
Re:ZX – A tool for writing better scripts by a_wild_dandan on Saturday February 10, 2024 @02:24AM (#39324303)
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.
Re:ZX – A tool for writing better scripts by klabetron on Saturday February 10, 2024 @04:08AM (#39324727)
I worked at a Python shop for a bit. I spent more time than I wish to admit trying to make all of my Python behave like TypeScript (adding typings, etc.).
Re:ZX – A tool for writing better scripts by a_wild_dandan on Saturday February 10, 2024 @05:08PM (#39330683)
Ditto. Python(3.13) types are so crudimentary that it becomes a Sisyphian struggle. Library type support is patchy at best. **kwargs is an abomination. Python is incredibly slow. Async code and anonymous functions are awkward and verbose. Hell, Python is verbose.[1] I could complain endlessly, but I'm mainly just disappointed in how little has changed since I last professionally wrote Python. The biggest benefits were basically a) familiarity, and b) powerful stats/ML libs.

I hadn't seen analogs of `AttributeError`s and `TypeError`s for years, until revisiting Python and remembering that those are still unsolved issues outside of TypeScript. Ugh.

[1] https://news.ycombinator.com/item?id=36407112

Re:ZX – A tool for writing better scripts by dash2 on Saturday February 10, 2024 @03:47AM (#39324646)
Would a python developer feel the same in reverse?
Re:ZX – A tool for writing better scripts by Vinnl on Saturday February 10, 2024 @07:21AM (#39325638)
If they'd go to JavaScript, they'd feel a sense of unfamiliarity similar to what JS developers going to Python would feel.

But the Python equivalent of TypeScript is mypy, and I don't think it's controversial to say (even among Python developers) that it's way behind TypeScript, generally.

Re:ZX – A tool for writing better scripts by monbis on Saturday February 10, 2024 @01:13PM (#39328678)
Python now has type hints which makes it closer to typescript, and easier to code in.
Re:ZX – A tool for writing better scripts by josephg on Saturday February 10, 2024 @02:13AM (#39324256)
> 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# and go.

I assumed JavaScript would be the most popular too - but that didn't seem to be the case. I have no idea where the demand for all this Python programming is coming from, but it seems Python programmers are everywhere. Maybe it’s just popular in schools.

Re:ZX – A tool for writing better scripts by __MatrixMan__ on Saturday February 10, 2024 @02:32AM (#39324335)
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 by 35mm on Saturday February 10, 2024 @01:01PM (#39328534)
That’s exactly how I chose Python.
Re:ZX – A tool for writing better scripts by __MatrixMan__ on Saturday February 10, 2024 @02:06PM (#39329211)
I'm curious, what was the job that needed some code but not a dedicated developer?

I'm taking computational biology courses on the side, so that's the application that comes to mind for me.

Re:ZX – A tool for writing better scripts by 35mm on Tuesday February 13, 2024 @03:04AM (#39355585)
I do digital marketing for clients. There’s a large number of activities that can be made more efficient, quicker, cheaper, or better using code.

For example taking a large number of text documents and turning them into video outlines with illustrations using OpenAI APIs and a quick and dirty Django app to organise everything.

Or connecting up various marketing APIs using Python instead of Zapier - a lot of companies spend thousands of dollars on Zapier each month when a script would literally cost a dollar to run.

Re:ZX – A tool for writing better scripts by nine_k on Saturday February 10, 2024 @02:52AM (#39324417)
Python is just fastest to write. No semicolons, fewer parens, no braces, no const / var / let. List / dict / set comprehensions. Lambdas are clunkier, but `def` is shorter than `function`. Etc.

Perl and Ruby are comparably compact and expressive, but relatively few people know Ruby, end even fewer people know Perl, especially among those younger than 50.

BTW Haskell is also syntactically compact and expressive; I once solved a toy interview problem using it. But even fewer people know it at a practical level, among interviewees and interviewers alike.

Re:ZX – A tool for writing better scripts by callalex on Saturday February 10, 2024 @03:26AM (#39324549)
I’m proficient and confident in many languages because I like solving problems with computers. However in a high-stakes and low-tooling situation like a job interview I wouldn’t choose JavaScript any day of the week because of the uncertainty, inconsistency, and footguns it likes to sprinkle everywhere.

There is absolutely a role for JavaScript, it truly does run everywhere which is no small feat. But that’s about all it’s good at.

What I’m getting at is that when you give people a choice they are going to optimize for the scenario, so you have a heavy selection bias in your anecdote.

Re:ZX – A tool for writing better scripts by makeitdouble on Saturday February 10, 2024 @04:52AM (#39324941)
Is it a recruiting company, as it's main business is to recruit candidates ? Or was the core business something else and you were recruiting devs for it ?

I think it's always difficult to get the bigger picture of the dev market through candidates. Many (rightfully) handle their career moves by themselves and will directly apply to companies that fit them, heavily biasing the movement observed from the company or third party recruiters.

Re:ZX – A tool for writing better scripts by josephg on Saturday February 10, 2024 @09:23AM (#39326324)
Main business is (was) recruiting people for roles all over the place.
Re:ZX – A tool for writing better scripts by graemep on Saturday February 10, 2024 @06:35AM (#39325407)
Maybe a lot of things start in Python, because so many people know it, and no one wants to change languages after a project starts?

Python also has a very wide range of applications so while there are many languages more popular in a particular area, Python is extremely widely used in aggregate. By contrast it is unusual to write numerical code in PHP or web apps in C.

Re:ZX – A tool for writing better scripts by abraham on Saturday February 10, 2024 @11:35AM (#39327525)
According to Stack Overflow JavaScript is more popular.

https://survey.stackoverflow.co/2023#section-most-popular-te...

Re:ZX – A tool for writing better scripts by nightlyherb on Saturday February 10, 2024 @12:21PM (#39328105)
Python seems to be popular for solving leetcode style interview questions, which might be something worth of note.
Re:ZX – A tool for writing better scripts by hiAndrewQuinn on Sunday February 11, 2024 @04:31AM (#39333759)
I could probably say "you're moving the goalposts here, I'm taking all developers not all working developers" or something, but I think these days you're basically correct. Python was relatively more niche when I picked it up in 2009 or so, but it's really become the lingua franca of our industry.