Hacker News new | past | comments | ask | show | jobs | submit login

Ah, my metaphor wasn't clear.

I wasn't arguing for unit types (user-defined literals didn't appear in C++ until C++11...)

I was pointing out that reconciling units in physics is common sense. People don't debate whether writing down "meters" or "seconds" next to a quantity is useful or not. You just do it, then cancel the units as a basic sanity check.

Yet so much of the "strong typing is for people with weak memories" debate incorrectly centers around the equivalent of "len = 3.1" vs "Kilometers len = 3.1" (or, heck, "auto Distance = 3.1_km").

I'm not sure why people think this is some sort of ordeal but my hunch is they'll learn. Timezones, Unicode, Database Schema, Float vs Decimal: you can deal with it now or you can deal with it later. If there were a lightweight language that actually solved this we'd all be using it, not arguing about it.




If type systems weren't so darn annoying, I'm sure everyone would be using them. As it is now, it's a trade off and not always a clear win. Give game developers easy access to unit types, for example, and they would probably use and benefit from them. But if they are a PITA to use, then of course, they would just say no way!

For type systems, we really need much better type inference than we have now...something that works with the subtyping that many of us prefer to work with.


Agreed. Nerds in generally tend to make a lot of ... odd ... short term decisions. Perhaps time to admit that a lot of what we do all day is "annoying" while balancing that with the fact that we're some of the best-paid people on the planet.

Enjoying that economic windfall while doing what's all but scientifically provable as a half-assed job raises issues around quality and ethics. (Something as a community we're also a bit famous for tiptoeing around...)


The current state of PL is very annoying, less so than a decade ago, but still annoying. Most programmers don't really care, there are plenty of other annoying ways to spend life for less money. But improvement is so possible, not everything significant in PL was invented 20-30 years ago, yet that is what we are stuck on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: