Hacker News new | ask | show | jobs
by mirashii 4067 days ago
> saving 5 chars from something that'll be typed very frequently is probably worth it.

This mindset is something that I've personally seen uniquely permeate every layer of the PHP community, more than anywhere else. I'm honestly curious, what makes communities seem to value things like typing less characters over clarity and correctness? The most important thing to me is reducing the amount of mental state needed for a human to read any line of code.

2 comments

Because PHP is for really fast development, and not for slow movers who actually think a lot. That's what I sense after joining a company using PHP.

The language itself feels like a bag of features copied over from top contenders from the TIOBE index. You can see the fastness in the core of the language design.

After all, you use PHP to perform MySQL queries in the middle of HTML tags. If you want to do this, you know some principles are merely burden for your smooth execution of the web site development, and should be throw out the window at first thought.

Just because you can do something doesn't mean you should

The sort of approach you're describing is not suggested or used by anyone with half a clue what they're doing.

Indeed, no one with half a clue what they're doing uses PHP.
We program so hard we don't have time to think. Or type. At least not with as many characters as a sane person would.
In this case I don't think it sacrifices much clarity, and it avoids the word "typehint" which is controversial (correctness is disputed). Using TRUE wouldn't necessarily be more correct, it's fairly arbitrary.