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

Joe Watkins:
PHP allows for the design of X
May 23, 2018 @ 11:20:33

Joe Watkins has a new post to his site that provides his opinions about answering the people that say "PHP wasn't designed for X".

Starting complicated twitter conversations should be avoided, I know this, and yet blurted this out on twitter recently...

This was met with a flurry of responses and I couldn't reasonably reply in tweet form. I'm going to respond to some of those tweets (indirectly) and further explain my original tweet.

He starts off by talking about how PHP isn't always the right tool for a certain job (some people's misinterpretation of his tweet). He also talks about why PHP isn't a "templating language" and has evolved so much beyond some of its original roots. He ends the post responding to the original comment, that "PHP wasn't designed for X". He talks about the opinions of those not as familiar with the current state of the language and, when they say "just because you can, doesn't mean you should" (meaning that they think you actually shouldn't).

When support emerges for a new problem domain, let's be pragmatic and observe that expanding the horizons of PHP in any direction is good for the community that relies on PHP (and maybe PHP alone) to make a living. Let's not rush to take new solutions to production tomorrow, but let's not dismiss anything out of hand because of some imaginary short coming in PHP.
tagged: opinion language design feature improvement

Link: http://blog.krakjoe.ninja/2018/05/php-allows-for-design-of-x.html

Stitcher.io Blog:
What PHP can be
Apr 18, 2018 @ 10:23:39

The Stitcher.io blog has a new post from author Brentd sharing some thoughts about what PHP could be if "that one feature" were added. For him it would be a true strong typing system that didn't require workarounds to make happen.

Have you ever wondered how your life as a PHP developer would be different if that one feature you want was added? I've made the thought experiment quite a few times already, and came to surprising conclusions.

Let's take, for example, the debate about strong types in PHP. A lot of people, including myself, would like a better type system. Strong types in PHP would definitely have an impact on my daily work. Not just strong types, I also want generics, better variance and variable types. Improvements to PHP's type system in general would have quite the impact on my programming life.

So what's stopping us from reaching a solution?

He covers a few different topics in his discussion of the feature including issues around common vocabulary and the use of the feature (in this case type enforcement). He finishes the post talking about the impact a feature like this could have on PHP and some of the benefits that could come with a strongly typed version of the language.

tagged: opinion language feature type strict

Link: https://www.stitcher.io/blog/what-php-can-be

Benoit Schneider:
The main reasons we use Symfony for web application developments
Apr 16, 2018 @ 11:36:05

On his Medium.com site Benoit Schneider (CTO of Outsourcify) has a post sharing some of the reasons they made the choice to use Symfony for their web development needs.

At Outsourcify we work on projects of varying sizes, from small sites with a few pages to complex business applications. Depending on the case, we recommend different technical solutions (we do a lot of Javascript SPA and Wordpress also), but for the most complex cases, when we have to chose a technology to build large web applications that require several weeks or months of work for several web developers, Symfony is our framework of choice.

He starts with a bit of background on his own experiences with Symfony and why he chose it for his own needs early on. He then shares his thoughts around "why Symfony?" when there are many other major frameworks to choose from. He wraps up the post with a summary of some technical reasons to use the framework including the innovation it brings to the table and the robust ecosystem around it (and related products/tools).

tagged: symfony framework choice development opinion technology

Link: https://medium.com/@outsourcify/the-main-reasons-we-use-symfony-for-web-application-developments-6281d2a56390

Matthias Noback:
Exceptions and talking back to the user
Apr 10, 2018 @ 09:13:25

Matthias Noback has a new post to his site with some suggestions about exception handling and user feedback for both the backend experience and UI side.

Designing domain objects is all about offering meaningful behavior and insights through a carefully designed API. [...] So exceptions in your (object-oriented) domain model are not merely meant to signal an exceptional situation. They can be used to prevent invalid or unsupported usage of an object. By offering well-named methods (with sensible parameters) for changing the object's state, and by being very precise about throwing exceptions when invalid use is imminent, you make your domain objects usable in only one way: the way that makes sense. This is the exact opposite of how your domain objects end up looking if you generate getters and setters for every attribute.

He starts by looking at the use of exceptions to help with validation and a few ways they could be used:

  • Exceptions get thrown ad hoc, whenever something threatens the consistency of the domain object.
  • They often signal that something is about to happen that can't logically happen, like a state change that isn't allowed or conceptually possible.
  • Exception messages may contain more information than you'd like to share with the user.
  • Validation errors often require internationalization (i18n).

He explains each option and, where it helps, provides code examples to illustrate. He then moves on to the frontend, talking about changes to the UI when exceptions are thrown and some things on his "wish list" for frontend exception handling.

tagged: exception user messaging handling opinion tutorial

Link: https://matthiasnoback.nl/2018/04/exceptions-and-talking-back-to-the-user/

Junior Grossi:
Open-source is about sharing and giving back. Think about that.
Mar 26, 2018 @ 09:25:48

In a new post to his site Junior Grossi shares some of his thoughts about Open Source and how it's less about "free software" and more about sharing and giving back.

Maintaining an open source project – even a small one – is not an easy task. The open source ecosystem is about sharing and contributing, about giving and receiving. You scratch my back and I will scratch yours.

He suggests that working in Open Source is less about the actual software that's being written as it is a lifestyle. For him, the goal is to make someone else's life better by working on something you're sharing (instead of working on something commercial). He includes a quote from Fabien Potencier (of Symfony) about Open Source developers being exploited for their free software and how, despite the gift of time and work spent on the code, some people don't appreciate the work and just complain.

Instead of complaining about features or bugfixes, do it yourself, and show your gratitude for people that spent their free time working on something to help your life. They could be with their family but no, they were doing open-source. And you should thank them for that.

He finishes with a few thoughts about giving back to the projects you use and enjoy. It doesn't always have to be about code too - you can submit bugs, contribute to documentation or even just write up a tutorial to share your own knowledge of using the package.

tagged: opensource sharing project free software code opinion

Link: https://blog.jgrossi.com/2018/open-source-is-about-sharing-and-giving-back-think-about-that/

Delicious Brains Blog:
Hey WordPress Plugin Developers, Stop Supporting Legacy PHP Versions In Your
Mar 23, 2018 @ 09:46:06

On the Delicious Brains site they have a new post that makes a suggestion to the WordPress plugin developers out there: stop supporting legacy versions of your plugins and move on.

I recently saw this tweet from Danny van Kooten which reminded me of one of the many major gripes developers have with WordPress – supporting ancient PHP versions:

"STOP SUPPORTING PHP 5.2 IN YOUR NEW PROJECTS. No one using it is actively installing plugins, trust me."

Yes, (unbelievably) WordPress still supports installations of PHP 5.2.4! As plugin developers, we can’t change that over night but we have the power to stop supporting these legacy versions in our plugins where we have control over the codebase.

He talks about how, despite the fact that the WordPress project itself strives for ultimate backwards compatibility, it's just not run on older versions of PHP as much. They share some statistics about the number of WordPress installs on each version of PHP starting with v5.2. The results show that the overwhelming majority are on v5.6 with a split between <=5.3 and >=7.0 for the remainder. They also share some statistics from their own plugins finding that the >=7.0 takes the lead.

The post then shares some of the reasons for making the upgrade to only support newer versions of the language including security updates, speed and developer experience. It finishes up with some of the steps to follow to inform users of the intent to deprecate old support and when to make the move.

tagged: wordpress legacy plugin support opinion version

Link: https://deliciousbrains.com/legacy-php-version-support/

Tomas Votruba:
How to Criticize like a Senior Programmer
Mar 21, 2018 @ 12:45:29

In a new tongue-in-cheek (humor) post to his site, Tomas Votruba shows you how to criticize like a senior programmer when offering feedback on code errors or architecture decisions.

As I spend most of my socials online time on Github and PHP-related discussion, I've noticed many people do so many wrong things while giving critics. I want to correct this once and for all, so I've prepared a guide for you.

His recommendations (again, the opposite of what is actually useful) include and eight step process to find a bug, never reversing your stance, repeating the same comments over and over and always telling, never asking. Following this list of "not to dos" he also includes a list of "to dos" correcting the misconceptions. This list includes:

  • asking if feedback is desired
  • determining your motivation for the feedback
  • replacing "you" with "I"

In each recommendation there's examples of phrasing and comments that give you some guidance on how you can be more effective at giving feedback on projects and code.

tagged: criticism senior programmer humor recommendation feedback motivation opinion

Link: https://www.tomasvotruba.cz/blog/2018/03/19/how-to-criticize-like-a-senior-programmer/

ZFort.com:
The Mexican Standoff of PHP Frameworks
Jan 26, 2018 @ 12:24:09

On the ZFort.com blog there's a new post that talks about the "Mexican standoff" between PHP frameworks, covering some of the background behind some of the more popular ones and some of the main differences between them.

PHP is one of the most widely known and potent programming languages used today. However, despite the popularity of PHP, there are many businesses using PHP without making use of a quality PHP framework. This approach slows production time and increases costs. A PHP framework is advantageous because it provides you with modules and codebase to help structure and accelerate the web development process.

[...] For CEOs, CTOs, product owners and those in the tech industry, choosing the right PHP framework can help cut production time and costs. However, every PHP framework is unique. [...] Given the wealth of PHP frameworks available, it is important to conduct solid research in order to find the platform that’s right for you. [We'll] take a look at three of the most popular PHP frameworks (Symfony, Laravel and Yii) and break down which is the best, and why.

The article then goes on to cover three of the more widely used frameworks:

  • Symfony
  • Laravel
  • Yii Framework

For each the author covers some of the origins of the framework and some of the things that it's best at. Following these there's a section that briefly compares them and how approachable they are for developers new to frameworks. While they all have their strengths the author recommends Symfony as the framework with "the most long term potential" over the others.

tagged: framework comparison symfony laravel yii opinion

Link: https://www.zfort.com/blog/php-frameworks-standoff/

Jeff Madsen:
Your Company is Screwing Itself by Not Supporting Open Source Software
Jan 24, 2018 @ 09:30:21

Jeff Madsen has a post on his site where he shares his opinions about Open Source software and companies giving back to the projects they use and love. His basic idea is that they're "screwing themselves" if they're not contributing for a few different reasons.

This will be a short piece, so I’m not going to go down [the] rabbit hole right now [of project timing], but tell me one thing: When a construction company is handed a one-of-a-kind blueprint of a new house, do they respond, “Well, golly gee! This has never been built before? - ?I have no idea how long it would take”?

[...] If you are good at creating software estimates, you probably already know the Joel Spolsky guide to making (somewhat) accurate ones. Break it down into small bits that you can understand. [...] Now…here’s where we start honing in on my point. I may have lied to you a little bit above?—?that construction team may not know how long it takes to build a stud wall with wiring [...] because they use bloody pre-fab for everything these days!

Relating this back to Open Source, he links these "pre-fab" items back to Composer packages, Node modules, etc and how they can help make things more efficient (more than writing it all yourself). A lot of companies see OSS as a way to get free software they don't have to create or maintain. Unfortunately they don't take into account the work behind them and how nothing ever fits 100% so you end up making modifications. If you contributed those modifications back to the project that could mean never having to do it again in your own work.

He ends with a few recommendations for companies looking to contribute these fixes and suggestions back to projects including providing monetary support or looking at paid versions over free ones.

tagged: opensource software contribute back company opinion

Link: https://medium.com/@codebyjeff/your-company-is-screwing-itself-by-not-supporting-open-source-software-c0e58ff04629

Stitcher.io Blog:
Where a curly bracket belongs
Jan 19, 2018 @ 10:38:45

On the Stitcher.io blog they've shared a post that makes some suggestions about where a curly brace belongs and how that might differ from situation to situation.

Dedicating a whole blogpost to curly brackets might seem like overkill but I believe it's worth thinking about them. Not just because of one curly bracket, but because there's a bigger message in all this. Thinking about how we read and write code not only improves the quality of that code, it also increases our own and others ease of mind when working with it. It can improve the fluency of your work and free your mind to think about real important stuff.

[...] I wrote about visual code improvements a while back in a previous blogpost about cognitive load. Today I want to focus on that one little, yet very important character in our codebase: the curly bracket. More specifically, we're only going to look at the opening curly bracket, because there's little to no discussion about the closing one.

The post goes on to show several different example situations and where they think the "most correct" placement for the curly brace is. They alos talk about the difference between their use on constructors versus control structures. The main recommendation, however, is to keep things consistent across the codebase.

tagged: curly bracket constructor opinion location consistency

Link: https://www.stitcher.io/blog/where-a-curly-bracket-belongs