4 ms·
> 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 lin
by bluGill 2y ago
> 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.
- Joker_vD 2y ago> 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.
- romwell 2y agoTypes 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.
- nobodyandproud 2y agoA 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.
- Spivak 2y agoIsn'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.
- bluGill 2y agoi don't do javascript, but I know from experience adding const to c++ is impossible I expect the similar for types
- nobodyandproud 2y agoI was envisioning a system or some other compiled language, but you’re right. I overlooked Typescript and it indeed comes close.
- pjmlp 2y agoCommon Lisp comes to mind, but I guess it is debatable to consider it mainstream.