logoalt Hacker News

ajkjkyesterday at 6:18 PM3 repliesview on HN

completely agree. but I felt like even then it was clear that types were a good idea and the implementations were not. For instance I started programming on Java 4 or 5 and the types were pretty bad---but still it was obviously the right way to go compared to JS or, god forbid, shell.


Replies

hungryhobbityesterday at 10:16 PM

"even then it was clear that types were a good idea and the implementations were not"

I still feel this way about the state of the art. I want solid type support in my language ... but I do not feel TypeScript is the best possible implementation at all, and for many situations I feel implicitly typed (but still using all of VS Code's type features) Javascript is actually better than using TypeScript.

I eagerly await the day when someone actually gets a JS typing tool right and I prefer using it over raw Javascript.

horsawlarwayyesterday at 6:33 PM

> but still it was obviously the right way to go compared to JS or, god forbid, shell.

I just don't think this is true.

Frankly - it's hard to argue this at all (even today) given that JS is the dominate language on the planet, and it lacks types... as does python, which had a reputation for decades as THE language to use to teach new folks to code. Or take PHP which dominated server development for a LOOONG time: also lacks types. Ruby on Rails has a wonderful reputation as the "get shit done" framework: no types.

Types are good for modern software companies, where code size has ballooned up very high (common to work on a codebase with hundreds of thousands of lines) or teams are large (50+ developers) and terrible if you just want to hammer out something that works as a solo dev.

Do I like types today? Sure - the tooling is solid, and I work on large codebases with large teams.

Did I like types as a solo dev at 3 person startup? no.

show 4 replies
TedDoesntTalkyesterday at 6:37 PM

Java has a lesson of what can go wrong with types, just as parent says. That example is dates and times. So many types…

And before Java finally settled on what we have today, we had 3rd-party libraries like jodatime that tried to fix it.

I guess it’s in a good state today, but it took a LocalDateTime.MAX to get there. I mean an Instant.MAX. No, I mean an OffsetDateTime.MAX. No, I mean new Date(Long.MAX_VALUE). Oh wait I meant new Timestamp(Long.MAX_VALUE). No, I mean LocalTime.MAX.

I’ll stop now, but i could go on.