Comment

Comment by pdonis

I have always wondered why so many people like dynamically types languages

Because you don't have to write a lot of boilerplate to tell the language things that it should be able to figure out for itself.

I mean, if I have a variable I ALWAYS know what kind of data I expect in it.

But that data might not always be of the same type. For example, in Python, I might want a variable to hold strings but also None, so that I can differentiate between, say, "the user explicitly entered an empty string" and "the user hasn't entered any string at all yet".

Yes, there are ways to do this in statically typed languages (for example, Haskell's Maybe), but it's still extra code that I have to write.

parent pdonis 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton