Hacker News new | past | comments | ask | show | jobs | submit login

I've spent a lot of time in the PHP internals, and this seems like an excellent and comprehensive guide.

However, I think that the title and the concept behind the post demonstrates how PHP got the way it is. Note how it's focussed on the syntax - this isn't a guide to ensuring that your feature has good semantics, or that it works well with existing features, or how to avoid creating new syntax by extending existing hook points in the language.

Nearly every PHP internals discussion about creating a new language feature has started and ended with "what will the syntax be" (sometimes even with a _vote_ about it!). Some more emphasis on the other aspects of language design would be welcome.




I think that it's actually one of the benefits of the PHP development process, and one of the reasons for PHPs popularity.

The focus on syntax is actually a focus on it's users, the programmers (or at least the subset of programmers that PHP is aimed at). The syntax in PHP is what lets us simply Get Stuff Done, and so the top-down approach to development is suited to the language.

Sure, it has some trade-offs in terms of things like performance and future (internal) maintenance, but for most developers using PHP on a day-to-day basis those trade-offs are completely worth it.


I'm not saying it's a focus on the syntax. I'm saying it's a lack of attention to anything else.

Language is much more than syntax, and that main reason people leave PHP is because the various parts of the language do not work well together.

If this were truly a focus on the syntax, than PHP would have good syntax. But it's not, its a shallow "lets hack whatever works, damn the consequences" attitude. Those work in early stages of a project, when you're prototyping, to move it forward. I don't think PHP is in that stage.


I actually think that PHPs syntax is good (in the main), it seems to fit with the way my thought process works and I'm incredibly efficient with it. It's different from many other languages syntax, it's verbose in places and not as "intellectually pleasing" as some, but for getting work done (at least for developers like me) its hard to beat. It's not that I haven't been exposed to other languages, I did a degree in computer science and have worked for 12 years in the industry (formally commercial, latterly academic) using assorted different languages. But since I discovered it, to this day I still prefer PHP, in large part due to the syntax.

And I think it is largely untrue to say that there is a lack of attention to other aspects of the language, particularly recently. The focus on performance increases, changes to the internals to implement new features (albeit often via a syntax-first approach!) and the current discussions around the future of PHP (PHP6 and Zend Engine 3) which aren't by any measure solely about syntax show that there is a wider appreciation of different aspects of the language.

PHP has a different focus from many languages, and that is why some people leave (or don't start in the first place) and find a language that is better suited for them. But for a large number of us it is a useful hammer that hits our particular nails right on the head, and that's not a bad thing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: