4 ms·
As a Python programmer at day job, that is Clojure-curious and sadly only gets to use it for personal projects, and is currently threatened by an obnoxious Type
by sunrunner 11mo ago
As a Python programmer at day job, that is Clojure-curious and sadly only gets to use it for personal projects, and is currently threatened by an obnoxious TypeScript take over, I feel this.
- dude250711 11mo agoRemoving barriers to sloppy code is a language feature. That is why vibe coding, JavaScript and Python are so attractive.
- Xelbair 11mo agoRemoving barriers to civil engineering building design is a feature. Who needs to calculate load bearing supports, walls, and floors when you can just vibe oversize it by 50%.
- huflungdung 11mo agoWell if it does the job. So what?
- hn_throw2025 11mo agoIn the context of the original discussion, TypeScript (and ES6) has const and let.
- dragonwriter 11mo agoNeither let nor even const are immutable (const prevents reassignment but not mutation if the value is of a mutable type like object or array).
- deleted 11mo ago[deleted]
- Kailhus 11mo agoYep, I believe you'd need to call Object.seal(foo) to prevent mutability. Haven't really had the chance to use it
- mwcz 11mo agoObject.freeze is the one you're looking for. const + Object.freeze is a lot to remember and cumbersome to use throughout a codebase, very relevant to Carmack's wish for immutability by default. I'm grateful Rust opted for that default.
- sunrunner 11mo agoFair enough about const and let, the obnoxiousness for me is a combination of the language ergonomics, language ecosystem, but mostly the techno-political decision making behind it.
- AstroBen 11mo agowell yeah except const doesn't make objects or arrays immutable
- catlifeonmars 11mo agoI feel that Java’s “final” would have been a better choice than “const”. It doesn’t have the same confusing connotation.
- MetaWhirledPeas 11mo agoYeah it makes their structure immutable? Something like that. Not useless but not what you would expect. But for non-objects and non-arrays it's fine.
- Garlef 11mo agoIf you avoid metaprogramming and stick to the simple stuff, python and typescript are almost the same language. To be fair, comprehensions (list/object expresions) are a nice feature that I miss a lot in JS/TS. But that's about it.