5 ms·
With the recent discussion on the origins of PHP function names, and about what, if anything, can be done to fix PHP without ruining it...I'm curious about what
by danso 13y ago
With the recent discussion on the origins of PHP function names, and about what, if anything, can be done to fix PHP without ruining it...I'm curious about what happens at Facebook. Besides HipHop, do they maintain a strict PHP style among their developers? Even if HipHop can handle all of PHPs variations, I imagine there's time saved by writing optimally-designed (for the human) code, too?
- pjmlp 13y agoYes, they have a static analyser for PHP, Hack, written in OCaml http://www.youtube.com/watch?v=gKWNjFagR9k http://www.youtube.com/watch?v=gKWNjFagR9k
- kodablah 13y agoInternally at my company, we've found https://github.com/scrutinizer-ci/php-analyzer https://github.com/scrutinizer-ci/php-analyzer to be very effective (after we made some hacks to support 5.5) and we can put it in our sniff pipeline in CI (a tad too slow for a pre-commit hook).
- meowface 13y agoFor core language features like that, there really is no way to "fix" it. Just pick a better language.
- stusmall 13y agoPoor choice of function names are the easiest of problems to fix. Write an internal base framework that you use and strongly discourage the use of functions outside of it. Even if the new set of APIs are as simple as just forwarding the call to the standard PHP one with reversed arguments, using one example people complain about all the time. This isn't hard to do, doesn't require a lot of upfront work (add APIs as you go) on a new project, and won't give you too much (if any) of a performance hit. You don't need to burn the house down because you don't like how the furniture is arranged.
- meowface 13y agoPHP has so many more problems than that, though. I don't think it's worth the effort. It'd be like replacing the rotting floorboards of a house that has mold spores in every corner and a caved-in roof.
- dubcanada 13y agowow, you really hate PHP. That that mold infested roof caved in house runs a great deal of the web.
- smrtinsert 13y agoIn what universe? Maybe to maintain wordpress applications, but thats just one product. I don't know that codes in php anymore.
- stusmall 13y agoWe are literally in a thread about one of the biggest names in tech and something they invent to help with their massive PHP codebase.
- kibibu 13y agoYeah, but Facebook is just a collection of Wordpress plugins. See: http://wordpress.org/plugins/facebook/ http://wordpress.org/plugins/facebook/ ;)
- jmccree 13y agoThe universe outside your echo chamber.
- jtreminio 13y agoHaha wow the blindfolds are strong with this one.
- dscrd 13y ago
- mikegioia 13y agoDo you have any PHP code you've written that you can link to? I'm curious as to how versed in PHP you actually are.
- skinnycow 13y agoImplying that it takes an amount of time to "get good at writing PHP". Hahaha. I love PHP devs in these threads just absolutely asserting themselves as equal and competent.
- nbm 13y agoCode style is enforced (but overridable) by the code review system - both automated tools that provide feedback ("lint") on the code (things like "Don't use funcx() - it sucks <link here> - rather use funcy()"), and human code review.