News for hackers. Stuff that matters.
Re:Do Not Follow JavaScript Trends by throwaway894345 on Tuesday June 16, 2020 @02:09PM (#23542187)
I'm not well-versed in TypeScript, and I have plenty of frustrations in Python so it's not that I don't believe you, but I do have a few questions:

* Python has async/await. It's not as pleasant as goroutines, but it exists and is presumably about as pleasant as async/await in TS, at least assuming you're using or not using the type system in both cases.

* Python has tuple/list/iterable destructuring. What is the specific limitation here? Maybe key/value destructuring?

* What's python's lambda weirdness? The single expression limitation? I agree that's tedious, albeit you can do a lot with a single expression (but not handling exceptions).

* JSON support. What's wrong with Python's JSON support? I mean, the type system can't model recursive types yet and that's super annoying, but the JSON stdlib seems fine. JSON maps pretty neatly onto Python dict/list/str/int/float/None/etc types.

* What are proxies and why are they desirable? Genuinely curious.

Re:Do Not Follow JavaScript Trends by nwienert on Tuesday June 16, 2020 @02:14PM (#23542263)
Python has some async, but it never felt as core and easy.

Tbh, it’s been years since I’ve done much Python. But the last time I did it was just really clear that TS had leapt ahead. Ecosystem may be part of it.

Proxies are essentially meta programming tools, tbh not fully sure Python doesn’t have similar but on looking they don’t seem as intuitive.

Re:Do Not Follow JavaScript Trends by throwaway894345 on Tuesday June 16, 2020 @04:49PM (#23543909)
As previously mentioned, I'm a Python critic, but it has changed a lot since you last used it. Async (for better or worse) has gained a lot of traction as have type annotations (although the type checker is a huge pain--can't model JSON or any other recursive type, can't express a callback that takes kwargs, getting it to acknowledge type stubs on upstream libraries is a forbidden art, it's pretty slow, etc).

No doubt that TS is better, however. It has amazing engines, an MS-backed developer experience, coherent type system, not the worst package management ecosystem, etc. If I could switch us off of Python to any language, I would choose Go but I wouldn't be angry if we landed on TS.

Re:Do Not Follow JavaScript Trends by DaiPlusPlus on Tuesday June 16, 2020 @07:31PM (#23545640)
Proxies are a feature in ECMAscript that TypeScript inherits - it lets you substitute one object for another so you can intercept and override object properties.