Remix.run Logo
kijin 8 days ago

Other languages have all sorts of oversized arrows, like ==> and >>>.

-> in PHP and C++ looks clean by comparison.

I'll never forgive them for the brain fart they made of the namespace separator, though.

esskay 8 days ago | parent | next [-]

What would the alternative for a namespace separator be? The backslashes work well with PSR-4 to give a logical visual of the expected directory structure.

account42 7 days ago | parent [-]

Since PHP takes a lot of syntax from C-like languages, the C++ namespace separator :: would be the obvious choice. Not sure if this conflicted with something in PHP though.

jimktrains2 7 days ago | parent [-]

https://www.php.net/manual/en/language.oop5.paamayim-nekudot... scope resolution operator

LeonM 8 days ago | parent | prev [-]

> I'll never forgive them for the brain fart they made of the namespace separator, though.

You mean the backslash? What's wrong with that?

kijin 7 days ago | parent | next [-]

The backslash is universally reserved as an escape character.

It was decided almost 20 years ago so I'm totally used to it and there's no point arguing about it anymore. But the decision to reuse the backslash as a namespace separator still causes inconvenience from time to time. For example, when you write PSR-4 configuration in composer.json, all the backslashes need to be doubled, including (and especially!) the trailing backslash.

account42 7 days ago | parent | prev [-]

To someone not already familiar with PHP it looks like you are trying to escape something.