Comment by IshKebab

Comment by IshKebab 12 hours ago

2 replies

Well... Yeah but then you lose all the advantages of static typing that he rightly acknowledges!

TSX in particular is a terrible example to make the point. It's very very similar to HTML so there is barely anything more to learn, and in return you get type checking, auto complete, go-to-definition, etc. Its so good I use it for completely static sites.

The SQL example is more compelling, but again it's really hard to paint "SQL makes static typing a bit awkward" as "dynamic typing is great here!". Like, you shouldn't be super happy about walking across a desert because your car can't drive on sand. "Look how simple legs are, and they work on sand".

That said, the SQL example does suck. I'm surprised nobody has made something like sqlx that generates the Rust types and does all the mapping for you from your schema. That's clearly the way to go IMO.

alexpetros 2 hours ago

> Like, you shouldn't be super happy about walking across a desert because your car can't drive on sand. "Look how simple legs are, and they work on sand".

I didn't say I was happy about it—I just said I needed to get across the desert!

8n4vidtmkvmk 11 hours ago

Kysley and others give you the types in TS. I believe you can write SQL in Linq C# but it's been ages since I've done it. If rust truly doesn't have that yet.. I guess they're missing out.