4 ms·
> 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 ev
by mirashii 12y 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.
- echaozh 12y agoBecause 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.
- stephenr 12y agoJust 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.
- slapresta 12y agoIndeed, no one with half a clue what they're doing uses PHP.
- giaour 12y agoWe program so hard we don't have time to think. Or type. At least not with as many characters as a sane person would.
- TazeTSchnitzel 12y agoIn 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.