A
A
Anastasia Soboleva2016-08-08 17:01:40
PHP
Anastasia Soboleva, 2016-08-08 17:01:40

Which PHP projects are the best sources to study for an example of great PHP code?

There is a lot of theoretical information from the authors of various legendary programming books on writing great code (decoration, self-documentation, simplification, practices, approaches, etc.). For example, in a book such as Perfect Code (S. McConnell) there are many such topics, from the principles of naming variables and methods to modularity and information hiding.
As you might expect - often the recipe depends on the situation and on the language possibilities (different approaches in different situations). I would like to see examples of great code in the work of real projects. Studying the sources of Yii2 and Laravel gave a lot, but not all.
What open source PHP projects can be considered as examples of great code? Preferably on some framework, but not required.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Mr Hobot, 2016-08-08
@vashaaa

Symphony dig, you have enough for a year.
UPD: the answer probably annoyed you, but I will explain. Yii is good, but symphony is better. Dig it, upload a clone from the official git for yourself and figure out what works and how. Do not learn how to work with it, namely, cut it with a nano scalpel to variables, and see how it works. On the same gith, look for projects on it and figure out how and why. If you are confident in your abilities, commit something, a small feature. Why symphony and not something else? Deal with it - there will be no problems with the rest. Of course, you can take a fool and watch Zend, but take pity on your brains and time, it will take 3-4 years to understand. Why a framework and not books or something else? Well, how can I tell you, books are good and you need to read them, but frameworks and examples of work are here and now, this is what is in demand, what will feed you, and books can be read for general development, maybe it will come in handy somewhere. But I'm talking about php and code structuring. Algorithms, database architectures, etc. throw not lying, read it.

B
Boris Yakushev, 2016-08-08
@za4me

yii 2

V
Vyacheslav Plisko, 2016-08-08
@AmdY

PSR, Symfony, Zend Framework 2
By no means laravel and yii
If you plan to write something on laravel, then look at the organization of modules in asgardcms (there is a lot of garbage from old versions, but the modules are the best I have seen in the world of laravel)

P
Pavel Volintsev, 2016-08-18
@copist

I will vote for Yii (first or second) and Zend Framework 2. Alexander Makarov just don't talk about cutting corners :) Laravel didn't cut corners anywhere, implemented all the patterns, very flexible. For this I bypass him, gardens. For starters, you need something simpler.
In Yii / Zend, everything can be unearthed (on the toaster , an example about components , and routing ). Not a lot of code, in most cases not complex implementations of classic design patterns, rather simple class navigation and error stack analysis.
Addendum to the answer:
Didn't notice right away.
And what did these frameworks not give ?
I'm not too shocked if I say that in real projects the code is not very great? High-performance, high-load web projects try to bypass complex design patterns, because all sorts of late bindings, decorators, reflections and other nonsense eat up resources that are constantly in short supply. Instead of a beautiful decorator class, they simply call the class method, instead of DI, classes are called directly. Cool projects are cool for the user, they do useful things, all of them are web-two-zero, material-design, user-friendly. And inside there ......... aaaaa! Every time when they decide to add another cool thing to a cool project, then one or another programmer says: "it needs to be rewritten, it's better to rewrite it." The older the project, the more often the words "shit code", "crutches" and "refactoring" sound.
In general, if Yii and Symphony and design patterns have already passed the stage, then other books are needed :)

N
Nikita, 2016-08-08
@bitver

PSR
Nothing else is needed, the rest is just experience.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question