top | item 37765785

(no title)

handsaway | 2 years ago

> Before we can select a function to convert a string into a number we must first pick a numerical type

Except this has literally nothing to do with static typing and everything to do with whether or not the language you're using cares about numeric types.

For instance in typescript you'd just have `number` as the type. You could conceive of a dynamically typed language like python where adding a u8 to a u32 would cause a runtime error. In which case it sure would be nice to have the compiler tell you to convert before you called a function.

>The other problem is that when you write such trivial programs

If only I had a career writing trivial programs that would make a lot of things easier.

discuss

order

No comments yet.