4 ms·
"Dynamic typing – But how do you know if you’re working with an int or a string? By using your brain. HTTP does not do typing and so PHP does not do (strong)
by 10098 14y ago
"Dynamic typing – But how do you know if you’re working with an int or a string? By using your brain. HTTP does not do typing and so PHP does not do (strong) typing for scalars"
If you are going to defend dynamic typing (which, by the way, I have no problem with), at least try to bring better arguments. First of all, we can do everything just "by using our brains". Why the hell write programs at all then? Let's just use our brains!
Static type checking is a task that can be automated, compilers have been doing that for years, and it saves our asses from a lot of dumb bugs by making bad code fail as early as possible - at compile time. When you throw that away, you better have a good reason for doing so. "HTTP does no typing" is definitely not a good reason.
"Dynamic typing significantly reduces the amount of code you need to write" - only if you want your code to eventually surprise you with a subtle type-related bug.