Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Alejandro Celaya:
The PhpStorm plugins of my choice
Sep 18, 2017 @ 09:17:33

In a new post to his site Alejandro Celaya has shared some of the PhpStorm plugins he makes use of in his day-to-day development on PHP applications. Some of them have to do with PHP itself but several help with more generic development needs.

Earlier last week I found a github repository which collects different resources related with the full post for more information.

tagged: phpstorm plugin development tool favorite opinion

Link: https://blog.alejandrocelaya.com/2017/09/16/the-phpstorm-plugins-of-my-choice/

Laravel NewS:
Clean Code Concepts Adapted for PHP
Sep 07, 2017 @ 09:58:29

The Laravel News site has a new post sharing the application of "clean code" concepts to PHP with a few handy examples. These suggestions are pulled from this set of guidelines.

Clean Code PHP (jupeter/clean-code-php), is a guide based on the book Clean Code: A Handbook of Agile Software Craftmanship, a classic programming book about writing maintainable code by Uncle Bob Martin.

The clean-code-php guide is inspired by a JavaScript adaptation, clean-code-javascript with PHP-specific features.

Examples they show in the post are around unneeded context, the number of function arguments and functions doing more than one thing. They also include a word of warning about these and other "clean code" suggestions, pointing out that they're mostly matters of opinion and not hard and fast rules to enforce every time. The post ends with links to two "clean code" resources for more reading: "[Clean Code]"(https://amzn.to/2wFCjo4) and "The Clean Coder: A Code of Conduct for Professional Programmers".

tagged: clean code concept language opinion software development practices

Link: https://laravel-news.com/clean-code-php-guide

SitePoint PHP Blog:
PHPBot – Can a PHP Bot Help You Look up Documentation Faster?
Aug 16, 2017 @ 10:31:39

On the SitePoint PHP blog there's a new tutorial posted from editor Bruno Skvorc looking at PHPBot, a chatbot tool that might help you look up PHP documentation questions a bit more easily (and quickly).

I came across PHPBot the other day (not to be confused with Botman or Fondbot) – a “chatbot” which helps you look up PHP manual entries and generates example code for them.

If you follow me on Twitter, you know I don’t believe in chatbots being chatbots – as someone who’s built some for both commercial purposes and personal ones, and as someone who was around in the age of IRC auto-responding scripts, I see chatbots as a little more than a marketing fad designed to impress today’s Snapchat generation. However, every now and then one will appear that’s actually useful. Could this be the one? Let’s take a look.

He starts off with some of the basic concepts behind the bot and examples of some of the output from documentation requests. He goes on to talk about the actual usefulness of the bot and provides some instances where it is still lacking in functionality. He also looks at several other subjects including Knowledgebase and Bugs, Autocompletion / Suggestion and Copy / Paste Friendliness.

tagged: phpbot documentation chatbot review feature opinion useful

Link: https://www.sitepoint.com/phpbot-can-php-bot-help-look-documentation-faster/

Paul Jones:
The “Micro” Framework As “User Interface” Framework
Aug 16, 2017 @ 09:40:53

In a new post to his site Paul Jones shares some of his thoughts about microframeworks, suggesting they're more "user interface" frameworks. Basically he suggests that microframeworks work best for the UI level handling and that possibly a second, more robust framework should be used for the application backend.

When we talk about “full stack” frameworks, we mean something that incorporates tools for every part of a server-side application. [...] Examples in PHP include Cake, CodeIgniter, Fuel, Kohana, Laravel, Opulence, Symfony, Yii, Zend Framework, and too many others to count.

When we talk about “micro” frameworks, we mean something that concentrates primarily on the request-handling and response-building parts of a server-side application, and leaves everything else out. [...] If the user interface is the request (as input), and the response (as output), that means micro-frameworks are not so much “micro” frameworks, as they are “user interface” frameworks.

He suggests that, if these statements are true, then microframeworks should be considered "user interface" frameworks. He makes suggestions of splitting things out into "containers" of functionality with the microframework taking care of user interactions while a second handles domain and infrastructure concerns.

tagged: microframework user interface opinion micro infrastructure domin logic

Link: http://paul-m-jones.com/archives/6627

Marco Bunge:
Application logic done right
Aug 14, 2017 @ 12:13:13

In a recent post to his site Marco Bunge offers some suggestions on how to write good application logic in a "clean, testable and reusable" way.

Web based enterprise applications are often accessible via different user interfaces through protocols like HTTP, Sockets, RPC, CLI. The Model-View-Controller is still present as a user-interface pattern. But requests and responses needs to be handled in the way of their interface requirements.

We don’t want to write the same logic for each required interfaces. Furthermore we don’t want to test and maintain code for each required interfaces. We want to write, test and maintain reusable source code at a central point of the application eco-system.

He then talks about the ideas behind the "three-teir architecture" and how this structure can be used to split logic into layers: presentation, logic and data. He mentions domain driven design as a development method to help achieve this structure and his meaning of the word "clean". He then gets into the implementation of this structure, defining the major pieces of functionality for each tier (with code for each included). He ends the post with some suggestions of points for additional reading about things like presenters, the ADR pattern and the "Inversion of Control" principle.

tagged: application logic opinion threetier clean tutorial example code

Link: http://www.marco-bunge.com/2017/08/05/application-logic-done-right/

thePHP.cc:
Conferences: for Fun or Profit?
Aug 04, 2017 @ 12:56:44

On thePHP.cc blog they share some thoughts about conferences and, more specifically, the way that PHP conferences are handled with respect to speaker compensation.

Attending an IT conference is fun. You get to meet people, listen to interesting presentations, maybe even participate in a workshop where you can expand your skills. Furthermore, there is free food, evening activities including parties, and networking. At the very least, it is a break from doing time in the office.

Each tech community, including PHP, has some well-known speakers that frequently present at conferences around the world. Admittedly, we are among them. How cool must it be to get all this excitement of a conference, and even get paid to do it?

Wait a moment. Nobody said that conference speakers get paid to do their job. And in fact, they are not.

They talk briefly about the history of conferences in the PHP community and how, despite the industry standard being to the contrary, they'll often pay for speaker travel/accommodations. Despite the time taken to prepare a presentation at a PHP conference, (most) speakers do not anticipate being paid for the speaking time itself. The post ends with a discussion about the amount of time they (thePHP.cc) spend around conferences and when they expect that an event would help out speakers with costs involved with the event.

tagged: conference fun profit opinion compensation speaker

Link: https://thephp.cc/news/2017/08/conferences-fun-or-profit

Matthias Noback:
Layers, ports & adapters
Aug 04, 2017 @ 11:43:11

Matthias Noback has a series of posts on his site sharing some of his thoughts around layers, ports and adapters in application architecture:

Looking back at my old blog posts, I think it's good to write down a more balanced view on application architecture than the one that speaks from some of the older posts from 2013 and 2014. Before I do, I allow myself a quick self-centered trip down memory lane.

He's posted all three parts of the series, each providing either some background on him and his previous work or principles and architecture suggestions:

Each part includes code and/or structure suggestions to help clarify points made along the way.

tagged: layer port adapter symfony architecture opinion

Link: https://php-and-symfony.matthiasnoback.nl/tags/architecture/

BitExpert Blog:
Why using code as DI config is a win!
Jul 26, 2017 @ 10:58:21

In a post to the bitExpert.de site Stephan Hochdörfer explains why he thinks that using code over configuration in a DI container is a better approach than static configuration definitions.

In my recent talk on introducing Disco - the DI container with the damn coolest name(tm) - I talk about why I believe that using XML or any other non-code configuration (YAML, JSON, ...) is not a good idea. This stirred some twitter discussion recently which led to this blog post.

Just for the record, for a very long time I was part of the XML camp - just browse my collection of old talks to see for yourself. I praised XML a lot as being the only true DI configuration format.

He then goes through some of the main issues he sees with using something like XML for the dependency container's configuration:

  • An XML editor won't give you code-completion for PHP classes or methods.
  • Refactoring won't work properly in an XML configuration file.
  • An XML editor is not capable of doing proper type checks.
  • XML is just too verbose.

For each item he provides a brief explanation and an example of XML where it helps to illustrate the point.

tagged: xml configuration code disco dependency injection container opinion

Link: https://blog.bitexpert.de/blog/why-using-code-as-di-config-is-a-win/

ThePHP.cc:
Why Developers Should Not Code
Jul 19, 2017 @ 11:16:01

On thePHP.cc blog Stefan Priebsch offers up an interesting opinion about code, developers and understanding - developers shouldn't code.

The ultimate problem with program code seems to be that no human really understands it. Sure, we can look at a short piece of code and be relatively clear on what it does, but can we still do the same thing with programs that span tens or even hundreds of thousands of lines?

[...] Well, sometimes I get a strong feeling that there is a shortage of good programmers, because I often find myself looking at legacy code, being unable to tell what it does, at least with reasonable certainty. [...] Personally, I already consider code to be problematic when there is a reasonable amount of doubt as to what it does (and why it exists). To me, uncertainty and discussions are a sure sign of bad code. Call me picky, but years of experience have taught me that this level of strictness makes sense.

He suggests that the fact a developer cannot recognize what current code is doing doesn't make you a poor developer, but the opposite. He talks some about the meaning of the word "code" and how it is written for a machine to understand, not a human. He ends the post talking about testing your code to provide an "executable specification" and, despite having this, a human-readable spec is still a requirement (like it or not).

tagged: developer code opinion specification testing

Link: https://thephp.cc/news/2017/07/why-developers-should-not-code

Hackermoon.com:
Why you should learn Symfony in 2017
Jul 18, 2017 @ 12:39:09

On the Hackermoon site there's a new post from developer advocate Mickaël Andrieu sharing a few reasons why he thinks you should learn Symfony in 2017 if you haven't already.

In 2011, when I started my studies in computer sciences I learned the PHP using symfony 1.3, and I realized my very first student project on the beta of Symfony 2. At the time, we were moving from a fully integrated full stack framework with a back office provided to a framework that followed what was found in the Java community: besides, many components of Symfony2 were strongly inspired by JEE.

PHP 5.3 had just come out and with it the ability to start designing object-oriented correctly. [...] Large Open Source projects have started to migrate on Symfony components: if it was not first, SensioLabs has talked a lot about Drupal8 because it is one of the biggest CMS on the market. EzPublish, PHPBB, PrestaShop and many others followed, some with a full stack framework approach and others by incorporating only a few software bricks.

He then talks about the "vibrant and mature ecosystem", listing some of the packages that use Symfony components. He also looks forward to the next major iteration of the framework: Symfony Flex. He ends with his reasoning why you should learn Symfony if you haven't worked with it (or at least how it handles common things like requests and services).

tagged: learn symfony framework ecosystem future symfonyflex opinion

Link: https://hackernoon.com/why-you-should-learn-symfony-in-2017-e0cf564f0b21