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

I honestly don't see how anyone who has used a language with both unions and interfaces could come up with anything else that makes dynamic types better.

Either way you need to fulfill the contract, but I'd much prefer to find out I failed to do that at compile time.




Don't confuse "presence of dynamic types" with "absence of static types."

Think about the web, which is full of dynamicism: install this polyfill if needed, call this function if it exists, all sorts of progressive enhancement. Dynamic types are what make those possible.


Sure, I'm primarily a C# programmer which does have a dynamic type object, and occasionally use VB which uses late binding and can use dynamic typing as well.

You want to know how often I find dynamic typing the correct tool for the job? It's literally never.

Dynamic typing does allow you to do things faster as long as you can keep the whole type system in your head, which is why JavaScript was designed the way it was. That doesn't mean it is necessary to do any of those things, or is even the best way to do it.


the place where imo static languages come up short is first class functions.


I think C# has first class functions. Any pure function you can pass around. And you can create lambdas.

gcc has nested functions that can act like a closure.

And Clang has blocks.


What are you talking about, the majority of functional languages have static types.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: