←back to thread

160 points todsacerdoti | 7 comments | | HN request time: 0.001s | source | bottom
Show context
steve_adams_86 ◴[] No.41901887[source]
I’ve written quite a bit of tooling in JS, and I genuinely enjoy the language, but I feel like Rust and Go are a godsend for these types of tools. I will sometimes prototype with TypeScript, but if something requires massive concurrency and parallelism, it’s unlikely I’ll stick with it.

I wonder if the author would feel differently if they spent more time writing in more languages on tooling like this. My life got a lot easier when I stopped trying to write TypeScript everywhere and leveraged other languages for their strengths where it made sense. I really wanted to stick to one language I felt most capable with, but seeing how much easier it could be made me change my mind in an instant.

The desire for stronger duck typing is confusing to me, but to each their own. I find Rust allows me to feel far, far more confident in tooling specifically because of its type system. I love that about it. I wish Go’s was a bit more sane, but there are tons of people who disagree with me.

replies(5): >>41902484 #>>41904308 #>>41904349 #>>41904569 #>>41905026 #
1. bluGill ◴[] No.41904308[source]
> The desire for stronger duck typing is confusing to me, but to each their own

I really like duck typing when I'm working on small programs - under 10,000 lines of code. Don't make me worry about stupid details like that, you know what I mean so just do the $%^#@ thing I want and get out of my way.

When I work with large programs (more than 50k lines of code - I work with some programs with more than 10 million lines and I know of several other projects that are much larger - and there is reason to believe many other large programs exist where those who work on them are not allowed to talk about them) I'm glad for the discipline that strong typing forces on me. You quickly reach a point in code where types save you from far more problems than their annoyance costs.

replies(2): >>41904433 #>>41906308 #
2. Joker_vD ◴[] No.41904433[source]
> you know what I mean just do the $%^#@ thing I want

Yeah, it's just that about 10k LoC, as I've also noticed, you don't actually know what you yourself mean! It's probably because such amount of code is almost never written in one sitting, so you end up forgetting that e.g. you've switched, for this particular fields, from a stack of strings to just a single string (you manage the stacking elsewhere) and now your foo[-1] gives you hilarious results.

replies(1): >>41905055 #
3. romwell ◴[] No.41905055[source]
Types in the end are contacts you make with yourself, enforced by the compiler.

A weak type system gives you the freedom to trick yourself.

I don't feel it's a feature.

4. nobodyandproud ◴[] No.41906308[source]
A language that goes from prototype-quality (duck typing, dynamic, and interpreted) to strict static compile checks would be nice.

I can’t think of any in the mainstream, however.

replies(1): >>41907006 #
5. Spivak ◴[] No.41907006[source]
Isn't that TypeScript or more generically "type hints" in other languages? If all you care about is that your program is valid for some gradually increasing subset of your code at compile time then these work great.
replies(2): >>41907445 #>>41913477 #
6. bluGill ◴[] No.41907445{3}[source]
i don't do javascript, but I know from experience adding const to c++ is impossible I expect the similar for types
7. nobodyandproud ◴[] No.41913477{3}[source]
I was envisioning a system or some other compiled language, but you’re right. I overlooked Typescript and it indeed comes close.