A common opinion about the appearance of punk, is that punk was a reaction to the extremes of modern rock, in particular the progressive rock of that time.
The reality is certainly much more complicated, but I suspect that there is some truth in this. Rock 'n' roll in the late 60s and 70s, it seems, was an area of ​​“Golden Gods”, inaccessible to mere mortals. The contrast between bands like Rush and Black Flag was huge.
Just for fun, let's take a look at drummer Rush
Neil Peart . Here is his drum set:

But Black Flag, in a speech in Los Angeles in 1979:
')

The entire Black Flag band can fit in the square occupied by the Nile Peart drum set. And they will still continue to perform cool things and light to the fullest.
Over the past few years, the spirit of PHP has apparently followed the path of Neil Peart. A huge amount of work done by a huge number of smart people turned into complex and wordy decisions. A bunch of files, a bunch of nested directories and a bunch of rules. I often see PHP libraries / components that look like this:
<?php chdir(dirname(__DIR__)); require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array())); $appConfig = include 'config/application.config.php'; $listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']); $defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions); $defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php'); $moduleManager = new Zend\Module\Manager($appConfig['modules']); $moduleManager->events()->attachAggregate($defaultListeners); $moduleManager->loadModules();
And all this, just to start your application.
This does not mean that this approach is bad, as such. But when I see it, I get an instinctive negative reaction. My brain screams:
Fuck.
That.
SHIT.(
could not find the best words - a comment of the translator )
I can't do this. I do not want it. And I do not think that we should do it in such a way as to create all sorts of cool things.
The approach that I have been practicing lately is to start with the most lightweight basis possible, with a microfragm.
In the PHP world, they are represented by
Slim ,
Epiphany ,
Breeze ,
Limonade , and others. For additional functionality, I take lightweight libraries that help me to solve the tasks. Clarity and brevity - this is what I pay attention in the first place.
Another important detail that I look at when I use someone else's code is obligations. Usually, I don’t have time for a full audit of the library code, so here I need to trust to some degree the one who wrote this code. And with each new dependency, the amount of code you need to trust grows. You need to know about the presence of errors and vulnerabilities and how they will be handled. Will there be announcements on the mailing list? How long will it take to fix it and will it break backward compatibility? Should I update all my dependencies if I upgrade to the next version of PHP. All this is based on the assumption that the author will have the time and desire to correct these errors. If not, you just added a bunch of technical debt to your code.
Finding lightweight libraries that don't pull a bunch of dependencies behind them is much more complicated than it should be. Basically, I think this is due to the fact that developers are now more interested in developing for a specific framework. Some work has been done to make mature frameworks less monolithic, and many Twitter developers have advised you to try symfony components as an option. Unfortunately, it turned out that we have too different ideas about lightness.
Here is the
cloc output for the
symfony2 HTTP Kernel component clone repository:
Mon Dec 26 19:42:23 EST 2011 coj@PsychoMantis ~/Sites > cloc HttpKernel 94 text files. 93 unique files. 12 files ignored. http://cloc.sourceforge.net v 1.53 T=0.5 s (164.0 files/s, 18736.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- PHP 72 1175 3440 4290 Bourne Shell 10 56 155 252 ------------------------------------------------------------------------------- SUM: 82 1231 3595 4542 -------------------------------------------------------------------------------
Here is the same for the Slim framework:
Mon Dec 26 19:42:27 EST 2011 coj@PsychoMantis ~/Sites > cloc Slim 54 text files. 51 unique files. 13 files ignored. http://cloc.sourceforge.net v 1.53 T=0.5 s (82.0 files/s, 17752.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- PHP 31 660 4473 3280 Bourne Shell 10 56 155 252 ------------------------------------------------------------------------------- SUM: 41 716 4628 3532 -------------------------------------------------------------------------------
and for the Epiphany framework:
Mon Dec 26 19:42:30 EST 2011 coj@PsychoMantis ~/Sites > cloc Epiphany 83 text files. 70 unique files. 31 files ignored. http://cloc.sourceforge.net v 1.53 T=0.5 s (102.0 files/s, 5246.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- PHP 40 218 309 1632 Bourne Shell 10 56 155 252 HTML 1 0 0 1 ------------------------------------------------------------------------------- SUM: 51 274 464 1885 -------------------------------------------------------------------------------
When there are more files and lines of code in a component than in my entire base framework, I cannot call it lightweight.
This does not mean that it is bad. This does not mean that this is the wrong approach. But, for me, of course, this approach is wrong. And I think I'm not alone.
I don't want to be a prog-rock star and write pretentious rock operas. I want to play awesomely powerful chords in a punk rock band that makes a show in a house without a stage and shakes you up so that you go and create your own band. I want to be such a coder.
I don't want to be
Neal Peart . I want to be
Greg Jinn .
Therefore, I wrote it. Such a “micro PHP manifesto”, if you want. I plan to use this as a guide in my PHP development. You may also find something useful for yourself in this.
I am a PHP developer- I am not a developer of Zend Framework or Symfony or CakePHP
- I think PHP is quite complicated
I like to do little things.- I like to do little things that have simple goals.
- I like to do things that solve problems.
- I like to do small things that work together to solve big problems.
I want to write less code, not more- I want to write less code, not more
- I want to manage less code, not more
- I want to support less code, not more
- I have to justify every piece of code that I include in the project
I like simple, readable code.- I want to write clear code
- I want to have easy verifiable code.
Manifest site:
microphp.orgAbout Manifest Author:
funkatron.com/about.htmlComments and corrections to the translation are welcome.