Comment by horsawlarway

1 day ago

Look at some of the typing present in MS COM back in the IE5/6 days and we can discuss more. I can honestly tell you - I'll take untyped languages any day of the week over that clusterfuck.

Personally - I also think people really underestimate just how much the tooling around types has improved over the last 20 years.

If I'm having to try to look up the difference between iBrowserInterface6 and iBrowserInterface5 and iBrowserInterface4... (and yes - shit like this really did exist: https://learn.microsoft.com/en-us/windows/win32/api/shdeprec...)

And I have no tooling for autocomplete, and the docs are shoddy, and google is just coming on the scene...

People understandable want to throw their computer out the window.

Types are great. Some forms of them were not.

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.

  • "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.

  • > 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.

    • JS was popular despite its lack of types, not because of them. If a typed language had been bundled into browsers from the beginning then we would not be shimming types into it with TS today (although I'm sure there would be other difficulties).

      When companies started making enterprise-scale JS applications they had to solve for the type story because it is unmaintainable otherwise. TS is the winner in a long line of iterating on that problem.

    • When I start a hobby project without types, and then get mental fatigue when returning to a shelved codebase and add ts, I find lots of bugs just by adding types.

    • It's still useful for things like onboarding the fourth person to your start-up. Good types get you half the way to good documentation.

    • > as does python, which had a reputation for decades as THE language to use to teach new folks to code

      I am very perplexed by this. I am going through Neetcode's DSA course where he explains what RAM and arrays are, but then he goes on to say something like "but since we are going to use Python, none of this applies." Personally, I learned the most about how software really works from reading The Rust Programming Language. It not only teaches you how to program in Rust, but also how memory works, what a string really is, etc.

      1 reply →

    • Those languages dominated because they were simple. Then they grew, and their users grew up, and realized that worse is better.

      At a startup you can choose even fancier languages, since nobody is stopping you!

  • 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.

    • How would dynamic typing have helped with this? Presumably all those different classes would still exist and create fragmentation and compatibility problems; they'd just surface at runtime instead of compile time.

Why the past tense? COM is the main Windows API surface since Windows Vista, most Win32 C stuff is frozen in Window XP API surface, with minor improvements.

WinRT for all its pain points, is still COM, only with a different set of base interfaces, and using .NET metadata instead of classical COM type libraries.