3 ms·
If only we had some sort of way of explicitly telling our computers that we wanted to to convert a sequence of characters into a number.
by kingkilr 15y ago
If only we had some sort of way of explicitly telling our computers that we wanted to to convert a sequence of characters into a number.
- mkup 15y agoThis thing already exists, it is called "strong typing" (in C++, Go, Java etc).
- Ralith 15y agoYes, that was the joke.
- varelse 15y agoWhat I don't understand is why all these weak-typed languages don't optionally allow one to strong type a variable.
- maratd 15y agoThat's like saying why doesn't someone create a combination hammer and screwdriver. A proper tool for every job.
- varelse 15y agoAnd as much as I love python and javascript, I'd really like to use a screwdriver now and then rather than leave hammer marks everywhere, especially if they are being used for something beyond formatting HTML. This hamdriver you speak of: tell me more.
- justincormack 15y agoWeak typing does not require bonkers coercion of types.