5 ms·
To this day, the table on that page remains one of my favourite examples of PHP's badly thought out design.
by hahainternet 11y ago
To this day, the table on that page remains one of my favourite examples of PHP's badly thought out design.
- wvenable 11y agoPHPs design and grammar precluded using any of the other existing operators. The backslash is really the best choice and in practice it works pretty well. The actual debate on the separator choice was very very very long.
- ufo 11y agoI still don't get what stopped them from using any of the existing operators.
- teh_klev 11y agoRationale was discussed on IRC, see: https://wiki.php.net/_media/rfc/php.ns.txt https://wiki.php.net/_media/rfc/php.ns.txt Linked to at the bottom of: https://wiki.php.net/rfc/namespaceseparator https://wiki.php.net/rfc/namespaceseparator
- ufo 11y agoI skimmed through it but couldn't really understand why they couldn't coopt one of the existing operators (for example, by making classes have a namespace for their methods) Couldn't they provide a clearer explanation than simply dumping a huge IRC log like that??
- wvenable 11y agoBasically namespaces operate at a different level. You can almost imagine it like Macro expansion -- the namespaces are fully resolved for all the symbols in the file and then the compilation happens. This is necessary for a host of reasons. They can't co-opt an existing operator because all the existing operators work at an entirely different level.
- sarciszewski 11y agoYeah, and also: Who gives a shit? It's the convention they chose, just adapt to it and get over it, or program in a different language. People who like to complain about PHP are rarely the same people who use it every day.
- deckar01 11y agoI have to use PHP every day and I rarely go a day without complaining about it.
- sarciszewski 11y agoYou're the exception, not the rule. I mostly hear C/C++, Ruby, Python, etc. devs complain about PHP. Very rarely actual PHP developers. And typically, their complaints are less of the moan-ass "waaah, they use a \ for namespace separation" and more "ugh, why don't they disabled emulated prepared statements by default"? Only one side is constructive.
- craigmcnamara 11y agoYou hear real engineers with actual experience in other languages complain about the two clawed hammer of languages. It's because there isn't a stockholm syndrome when you know something other than PHP. PHP is a mess, it's a hugely popular mess in the same way that a McDonald's hamburger is a hugely popular mess. If you ask someone about their favorite burger or language, you'll rarely hear that McDonald's or PHP is on the tip of someone's tongue. If you ask someone why they ate at McDonald's or why they used PHP, you'll likely hear some bullshit justification that amounts to "it was there when I needed it." Fuck PHP.
- kazinator 11y agoNone of those who are complaining about the monument of shit being erected outside of town is actually an erector of monuments made of shit. Typically, their complaints are about the ugly appearance and smell. Only one side is constructive.
- 11y ago
- debacle 11y agoThe reality is that the parser is absolute shit and that sort of necessitated the character not being '.' But you get used to that kind of stuff writing PHP. At least Facebook is making things better.