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

SitePoint PHP Blog:
How Privileged Are Programmers? Are You a John, Too?
Apr 25, 2017 @ 09:31:16

On the SitePoint PHP blog Christopher Pitt has written up a new article, a story about "John" a developer caricature that's all too familiar in the development world and how you can grow up from "being a John". It's all based on Christopher's own experiences too.

John was a developer. To be specific, he was a young, white, straight, young, self-taught developer. He wasn’t rare, but he was special. John grew up with a couple parents, who paid for everything he needed.

[...] John got average grades, but it was ok because [according to mum]; “he’s just bored of schooling, and too clever”. He walked right out of high-school and into a programming job. The pay wasn’t great; only enough for a small apartment and modest groceries [for one]. In time he’d earn more. [...] Over the years, John quickly got bored of programming. He loved the thought of the career, but it was all so boring. He moved jobs every year or so, and only then when his idiot bosses stopped seeing how much he mattered to their company.

He talks about his own past, how he realized he was a "John" and how he made the conscious decision to grow up and out of that situation. He talks about those being born into comfort and how they're not always forced to grow up or to really struggle. He mentions other common "John" points of view ("we can always just move jobs" or "meetings are just a distraction"). He's angry with himself for seeing so much of his previous life in these examples. He's also angry to see these same patterns in other developers around him, other "Johns" that treat him the same way with excuses, failed promises and delays.

I think of all these clever little things I could do, to force John to work. All these processes and mantras and check-lists. Then I despair. The only thing that’s going to make John realise he is wasting away is wasting away enough to fall through his safety net. He’s going to have to grow up on his own, and maybe then he’ll pay it forward to his future employers and clients.
tagged: john programmer privilege example opinion experience

Link: https://www.sitepoint.com/how-privileged-are-programmers-are-you-a-john-too/

Stefan Koopmanschap:
To Exception or not to Exception
Apr 21, 2017 @ 16:21:47

In the latest post to his site Stefan Koopmanschap offers some advice on when to use exceptions and when to avoid them (the result of a recent Twitter discussion).

I recently found myself in a discussion on whether or not exceptions could be used to control program flow in software (specifically in PHP applications). That triggered me to post a tweet:

Exceptions should not be used to control expected application flow. Discuss.... @skoop

This triggered quite a bit of discussion, which gave me a lot of input on this topic. I want to thank everyone who joined that discussion for their input, which was really valuable. In this blogpost I'll do a summary of the different arguments in the discussion, and give my opinion on this.

He goes on to define the term "program flow" and how that relates to the idea of using exceptions to control it. He then talks about naming things, the "intent" of your code and how the right names can make your code clearer and easier to maintain.

tagged: exception flow program naming opinion

Link: https://leftontheweb.com/blog/2017/04/21/to-exception-or-not-to-exception/

Russell Walker:
Is Best Practice Actually Poor Practice? Dependency Injection, Type Hinting, and Uni
Apr 05, 2017 @ 13:26:03

Russell Walker has a post to his site sharing his thoughts defending dependency injection, type hinting and unit testing against some of the common objections.

I've recently been in discussion with a colleague who thinks that dependency injection (DI) is over-used and, in cases where the dependency is a concrete class, unnecessary (in the latter case, he advocates simply creating new objects on the fly).

[...] In my opinion, this line of thinking is misguided, but he sent through some links to pages that he felt supported his point of view (including Tony Marston's rant on DI, and the Laravel documentation about 'facades' - which are actually used as an alternative syntax for the service locator [anti-]pattern). I genuinely wanted to understand the reasoning behind his point of view, as it flies in the face of just about everything I have ever read regarding best practice in PHP development. After reading those resources he sent though, I began to notice some misconceptions about what unit testing actually is, as well as confusion about the difference between code that is "strongly typed" (usually good) and "tightly coupled" (usually bad), and also a tendency to blame the wrong thing when problems arise.

He then breaks the rest of the post down into a few of the common objections and makes an attempt to set the record straight:

  • Not All Automated Tests Are Unit Tests
  • Using Mocks to Test in Isolation
  • What, Never Ever Create Objects on the Fly?
  • What About Those Laravel Facades?
  • Hidden Dependencies and Other Dangers
  • Strongly Typed is not Tightly Coupled

He ends the post with "another reason" that there could be issues with developers dismissing best practices in their development - a misunderstanding of the principle and how to correctly implement it.

tagged: bestpractice dependencyinjection typehint unittest opinion

Link: http://russellscottwalker.blogspot.co.uk/2017/03/is-best-practice-actually-poor-practice.html

Tomas Votruba:
Why Is Doctrine Dying
Apr 04, 2017 @ 13:13:45

In a recent post to his site Tomas Votruba shares some of his opinions about why he thinks that Doctrine is dying sharing three of the reasons he sees for this trend.

Do you use Doctrine ORM? If so, do you follow its evolution on Github? Symfony is evolving, Laravel is evolving, Nette is evolving, world is evolving... Doctrine not. Today I will show you 3 reasons why.

I've been thinking over 2 years about this post. I wasn't sure if it's only negative hype feeling or real thing. It's still the same so it's time to write about it.

He starts off by stating that Doctrine is "an awesome tool" but suggests that it is stuck in its legacy world and hasn't been able to evolve much past some of its original functionality. In his opinion this is because of the project's "system setup" not the code quality or maintainers. He then offers the Doctrine project three suggestions on what they could do to help change the course of the project. This includes becoming more competition to other options and consolidating the 20+ Doctrine repositories down to a much simpler structure.

tagged: doctrine project dying opinion suggestion

Link: https://www.tomasvotruba.cz/blog/2017/03/27/why-is-doctrine-dying/

Quora.com:
What are some things you wish you knew when you started programming?
Mar 21, 2017 @ 10:24:44

Leonid Mamchenkov has linked over to a great thread over on Quora that asks the question "[What are some things you wish you knew when you started programming?

](https://www.quora.com/What-are-some-things-you-wish-you-knew-when-you-started-programming)?"

The post is originally from Ken Mazaika, CTO, Co-founder & Mentor @ thefirehoseproject.com but it has expanded way beyond his original list of 27 things. There's comments sharing everything from personal experiences out to their own lists of things they wish they knew. Topics mentioned include:

  • the "cognitive burden"
  • the importance of getting away from the screen sometimes
  • the value in listening, not just hearing, your colleagues
  • thinking about security at all times
  • learning the "why" of coding, not just the "how"

There's a lot more in this post so get over and start reading. There tips in here for everyone, both those new to programming and those that have been doing it for years.

tagged: wish you knew programming opinion experience quora

Link: https://www.quora.com/What-are-some-things-you-wish-you-knew-when-you-started-programming

SitePoint PHP Blog:
The State of PHP MVC Frameworks in 2017
Mar 03, 2017 @ 09:49:40

The SitePoint PHP blog has a new post sharing the current state of PHP MVC frameworks in 2017. The article doesn't focus on any particular list of frameworks (though the more popular ones are used in the examples) and instead focus on the overall trends they've seen in frameworks and their use.

A simple question prompted me to sit down and write this follow up to my article from about a year ago: "Any thoughts about where things are today?"

He suggests that, while several of the major frameworks are still in active development and are seeing new features in recent versions, the front-runners are probably Laravel and Symfony. He includes trend numbers to back this up (popularity, basically) but also briefly touches on others: CakePHP, CodeIgniter and Zend Framework 2. He then breaks it down into two groups: Symfony/Laravel and "the rest". The post wraps up with a look at the rise of microservices, the "destruction of the monolith" and a more recent emphasis on scalability over just features.

tagged: state mvc framework 2017 opinion laravel symfony trend popularity

Link: https://www.sitepoint.com/the-state-of-php-mvc-frameworks-in-2017/

David Lundgren:
The allure of static proxies
Mar 02, 2017 @ 10:52:47

David Lundgren has a post to his site talking about the allure of static proxies in your development and some of his own experiences using them in his own code (and in using Laravel).

Several weeks ago I started playing with Laravel. Primarily because several colleagues are using it, and have suggested that I take a look at it. During my time reviewing how to build a view template I came across references to Html, Form, View and other static calls. Initially I was not impressed due to the use of so many static calls. I have come to an understanding about how static calls in certain circumstances can actually enhance code readability.

He talks about how static calls have been considered an anti-pattern for a long time due to difficulty testing and tight coupling issues. That being said, he did start to see the value in using them in certain situations, how his use relates to the proxy design pattern and some of his own conclusions about using static calls.

tagged: allure static proxy opinion laravel facade cleancode

Link: http://davidscode.com/blog/2017/02/27/the-allure-of-static-proxies/

Michelle Sanver:
We can all learn from the Drupal community
Mar 02, 2017 @ 09:17:51

Michelle Sanver has written up a qucik post on the Liip blog sharing a few things she thinks we can all learn from the Drupal community.

I started hearing about Drupal 8 back in 2014, how this CMS would start using Symfony components, an idea I as a PHP and Symfony developer found very cool.

That is when I got involved with Drupal, not the CMS, but the community.

I got invited to my first DrupalCon back in 2015. That was the biggest conference I have ever been to, thousands of people were there. When I entered the conference building I saw several things, one of them was that the code of conduct was very visible and printed. I also got a t-shirt that fit me really well – A rarity at most tech conferences I go to. The gender and racial diversity also seemed fairly high, I immediately felt comfortable and like I belonged – Super cool first impression.

She goes on to talk about more of her experiences at the conference, both in how it was run and about her fellow attendees. She ultimately shares the main message of the post:

[...] Embrace our differences, and each other, and accept that we do different things and we are different people and it doesn’t matter because that is what makes community work, that is what makes us awesome. Diversity matters, Drupal got this.
tagged: drupal community opinion learn experience conference

Link: https://blog.liip.ch/archive/2017/03/01/can-learn-drupal-community.html

Jason McCreary:
Lumen is dead. Long live Lumen.
Feb 28, 2017 @ 15:17:59

In a new post to his site Jason McCreary offers some of his opinions around why he thinks Lumen is dying. Lumen is a micro-framework from the creators of Laravel offered as an alternative to the full-on Laravel framework.

You’ve already read the title, so I’ll just say it, I think Lumen is dying, if not already dead. Now let me tell you why…

Jason (creator of Laravel Shift) shares some of his own statistics around Laravel versus Lumen "shifts" and some graphs that help to support the theory. He suggests that part of the issue is that there's less focus on a wider, more general use of the tool and how he suspects that the Lumen feature set will continue to lessen. He ends on a more positive note, though, suggesting that Lumen as it stands may not exist in the future but may live on integrated into the Laravel framework.

tagged: lumen project laravel dead opinion

Link: https://jason.pureconcepts.net/2017/02/lumen-is-dead-long-live-lumen/

Laravel News:
Habits of Highly Productive Tech Teams
Jan 27, 2017 @ 10:18:22

On the Laravel News site there's an article posted from Sharon Steed covering some habits of highly productive tech teams including topics like trust, meetings and understanding roles.

There’s always a lot of talk about “culture” on tech teams. And that makes sense: managers generally hire people that will fit in well with the group they’ve assembled because they know there’s more to work than just doing the job. Being able to get along with your coworkers, being reliable, and looking the part are also important. A big part of building a solid company culture is about creating an environment which helps your employees be productive. Unfortunately, a lot of what we do in tech has the opposite effect.

She talks about the role of perks in an effective workforce and how, despite some seeming very nice on the outside, can cause burnout as it encourages longer work hours than normal. From there she moves into some suggestions about "meeting culture" and some of the major drawbacks to meetings (including how they can distract from "real, paying work"). There's a nice flow chart included in the post too that can help you determine if a meeting is really necessary or not. From there she goes on to talk about the other two topics mentioned above - employees knowing and understanding their roles and fostering trust between them through things like delegation and effective listening.

tagged: highly productive teams technology opinion trust meetings roles

Link: https://laravel-news.com/habits-of-highly-productive-tech-teams