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

> The last part is why this is a problem.

$_POST isn't the problem. The scope of the variable isn't the problem. You've realized this, too, and that's why you're shifting the argument to one about typing instead of superglobals-are-bad (typing and scope are obviously independent features).

> You want to reduce the number of things you have to think about to the absolute minimum

The net effect of type systems seems to actually be to force you to think about a larger number of things very very carefully. The only thing that ends up being reduced is having to think about having to think about them.




Parent did not 'shift the argument to one about typing instead of superglobals-are-bad' as I read it.

They said superglobals are bad because they make it too easy to do the wrong thing.

And the followup was about how often people do the wrong thing.

If you interpreted that any other way you misread (afaict).


>> The last part is why this is a problem.

> $_POST isn't the problem

No, it isn't. That's why I specifically said "The last part is the problem", referring to "as long as you're doing proper checks."

Specifically, my point is that you should not rely on people 'doing the proper checks' because people make mistakes, thus you want to reduce the amount of situations where people are given the opportunity to make those mistakes.

There are a lot of situations in PHP where you need to 'do the proper checks' for no reason other than bad language design, and that is what makes PHP a bad language.


> typing and scope are obviously independent features

You might want to read about effect systems

http://rtpg.co/2016/07/20/supercharged-types.html

(it might not be the best blog post on the subject theory, but I think it's a nice practical example)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: