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

I'm happy to see more languages with optional typing.

Prototyping stuff without bothering with types and adding them when your code matures to root out some bugs and make it more futureproof seems to me like the best of both worlds.




I will never undestand this argument. Bothering with types? How? In most cases you will need int, double or string - how this is difficult? It is more difficult to figure out types you heve to deal with if language doesn't provide such information. If by prototyping you mean Hello World like apps then ok, but anything more complex without types becomes mess very quickly and prototyping speed have to decrease.


Reading a CSV without knowing the types of the contents inside is kinda painful without optional typing (or no typing). It's a fair representation of the operations you'll perform while prototyping a thing.


Being a data analyst using Python, I would say that for an one of exploratory analysis in jupyter I can do without type hints. As soon as I switch to an IDE or even go over some complexity threshold, I am all in for type hints. Or if I need to reuse the notebook. Then type hints are a blessing.


Being able to be fuzzy at the boundaries of your program (e.g., consuming APIs or files) is a lot faster than rigorously defining your types for data un/marshalling.

Your chickens will eventually come home to roost, but the short-term productivity gains are quite pleasant.


If you really want to understand please find out why so many people prefer dynamically typed languages. Maybe start using one yourself...


And what if you are used dynamically typed language for years and still cannot understand why anyone would choose on if can chose freely?

Seriously I have noticed that static vs dynammic preference is quite sustainable thing for people. Even if you are have used lot of both most people prefer the one they are used when they 'got it' during their programming learning path.

I don't really understand that CSV example what's the problem but one concrete challenge I have noticed with static types is when you want do mutation which effectively change the type. Instead of setting just new property you have to potentially do dummy copy (including type) or some additional hashmap by id for this additional data.

(btw I am not your down voter)


I went back and forth between typed and untyped languages. The sheer drudgery of typing out and visually filtering out while you read the obvious type information is what makes typed language feel way less fun for me. When you cut things out move them around, delete them, retype them, throw everything away again and start over... I'd never choose Java for initial implementation of anything.

I'm not sure why other people like dynamic languages but there must be some advantages.




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

Search: