4 ms·
First, I really don't want to start a flame war. That being said, my opinion is that PHP as a language is not well structured or well written. You might want to
by jmtulloss 18y ago
First, I really don't want to start a flame war. That being said, my opinion is that PHP as a language is not well structured or well written. You might want to check out Python or Ruby, both of which have great web frameworks that encourage structure.
- stcredzero 18y agoIt's the same problem in any language. Most of the code out there is mediocre or bad. The code you want to learn from is a few standard deviations to the right. When you are learning something always Remember Sturgeon's Law! I would rather work with someone who produced excellent PHP than someone who wrote lots of weird hybrid procedural/functional Python full of esoteric array slicing hacks. Being able to apply your intellect to revealing intention in code is a valuable skill in any language, and I suspect that it transcends any particular programming language.
- neovive 18y agoAgreed. Just because a language has a low barrier to entry, doesn't mean it should be blamed for bad code. I linked to the KohanaPHP framework source as an example of very well written PHP code.
- jmtulloss 18y agoI certainly agree that anybody can write bad code in any language, but my argument is that PHP itself is bad code. The libraries are inconsistently named, there's no coding standard in standard libraries, and the language changes behavior according to configuration. PHP as a project is poorly structured, and all other things being equal, it should not define your programming worldview.
- gnaritas 18y agoIt's not just bad code, it's a bad language full of silly inconsistencies that don't make sense and trip up even the most experienced programmers. That's what happens when you build a language by piling hack upon hack instead of actually designing it. Languages like Ruby and Python actually have a philosophy and style that keep the languages self consistent. Consistency is a critical core feature of any good language, PHP doesn't have it.