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

Christian Mackerprang:
How terrible code gets written by perfectly sane people
Nov 30, 2016 @ 12:16:26

Christian Mackerprang has an interesting post to his site sharing some of his thoughts about why terrible code gets written by sane people - developers that know what they're doing but, for other reasons, write code that's a mess of anti-patterns and inconsistency.

What I discovered after some months working there [on a legacy Python project], was that the authors were actually an experienced group of senior developers with good technical skills. What could lead a team of competent developers to produce and actually deliver something like this? What I’ve come up is a list. These are some bad habits that even experienced teams can get into which will severely affect your end product, more than any static code checker or development methodology could rescue it from.

His list of reasons covers six of the reasons he sees for the "good people, bad code" situation happening:

  • Giving excessive importance to estimates
  • Giving no importance to project knowledge
  • Focusing on poor metrics such as “issues closed” or “commits per day”
  • Assuming that good process fixes bad people
  • Ignoring proven practices such as code reviews and unit testing
  • Hiring developers with no “people” skills

For each item in the list he briefly covers why it's a bad thing for your engineering group and references to other sources on good suggestions to fix the situation.

tagged: terrible code sane people opinion reasons

Link: http://chrismm.com/blog/how-terrible-code-gets-written-by-perfectly-sane-people/

SitePoint PHP Blog:
Pay the Price for Open Source
Nov 25, 2016 @ 15:18:18

The SitePoint PHP blog has a post from the godfather of the PHP community Cal Evans about paying the price for open source - giving back to Open Source projects that you use every day.

Back in the early days of Open Source – when Dinosaurs roamed the earth and Rasmus was a young man – there were two types of open source projects we talked about: those that didn’t cost any money, and those that gave you the freedom to redistribute and modify the code.

[...] Fast forward a few dozen years and here we are, Open Source is now an ecosystem, not a user group that you and five friends attend, or a magazine to which you subscribe. The problem is that most of us have stopped talking about the different types of open source, we just assume it is both.

He talks about how PHP is technically both kinds of free but also points out that open source will potentially die out (as it is now) without one major piece - users contributing back, giving their time and effort to keep it (and related projects) free. He talks about how you can give back, and not necessarily monetarily. He talks about one of his own experiences with giving back (to WordPress) when his work wasn't accepted, but he also points out that even though it may be rejected it doesn't mean you should stop.

What ever project you are working with, take the time to give back. Don’t let Open Source die in our generation.

Preserve this great concept; this ecosystem that we have helped build and that has allowed us to build so much. If you are a developer, find your favorite project and give back. If you run a company or a team of developers, give them time on your dime to give back to a project. Help keep the Open Source ecosystem thriving for the next generation of developers.

tagged: opensource pay price giveback contribute opinion

Link: https://www.sitepoint.com/pay-the-price-for-open-source/

Joe Ferguson:
Use Laravel Shift for your next upgrade
Nov 24, 2016 @ 09:13:23

In this new post to his site Joe Ferguson takes a look at Laravel Shift, an automated service that makes it easier to upgrade your Laravel-based application quickly.

I’ve had an eye on LaravelShift.com since it first made it’s way across my twitter feed some time ago. I’ve also had the pleasure of meeting and talking with it’s creator Jason McCreary at a few conferences over the past year. I think it’s really awesome when community members are able to take a product to market that not only scratches their own itch, but can provide value to the rest of the community as well.

[...] I built NerdsAreDrinking on Laravel 5.1 because that was the current version at the time. We have seen two more release since: 5.2 and 5.3. The upgrade process isn’t terrible however there is a lot you may need to take into account. Rather than upgrade from 5.1 to 5.2 and then 5.2 to 5.3 I decided to use Laravel Shift to do the 5.1 to 5.2 upgrade for me.

Joe then talks some about his experience using the service and was impressed at the speed of the service to create the required Pull Request for the update. He includes a link to the PR so you can see what the upgrade looks like too. He feels like the money spent (around $11 USD) was well invested and would definitely use the service again.

tagged: laravel laravelshift upgrade opinion service version

Link: https://www.joeferguson.me/use-laravel-shift-for-your-next-upgrade/

Laravel News:
Can Frameworks lead to tribalism among developers
Nov 21, 2016 @ 10:21:50

On the Laravel News site there's a new article posted by Percy Mamedy posing the question: "Can Frameworks lead to tribalism among developers?"

In the modern world of web development, it is common practice to make use of frameworks for building large scale applications instead of starting from scratch. [...] In the PHP world, we have seen the emergence of hundreds of frameworks thanks to a large and dedicated community. Some developers even develop their own framework re-using components and parts of other frameworks thanks to an awesome tool called composer.

[...] As part of an experiment, I wanted to see how my fellow developers would react and to what extent they were willing to go to defend their own frameworks if I praised Laravel as being the best framework out there. [...] As expected, responses were flowing in; some even brutal. Everyone defended their framework of choice with extreme passion and dedication. This has lead me to the conclusion that there is an intense sense of identity and kinship that developers have around their framework of choice.

His results came in from a post he made wondering how fellow developers would react to the statement "Google Trends says it all...Laravel is king." He talks about these results and the obviously relation to tribalism in technology choices and how it binds like people in groups, a common human need.

We all as developers feel this intense love and passion for our tools, it’s part of who we are, and I think it’s what makes our Job so unique; we code because we enjoy to and because we love to.
tagged: framework tribalism developer opinion technology group choice

Link: https://laravel-news.com/2016/11/can-frameworks-lead-to-tribalism-among-developers/

Andreas Creten:
Does code need to be perfect?
Nov 11, 2016 @ 09:55:57

On his Medium.com blog Andreas Creten has written up a post that tries to answer the question "Does code need to be perfect?" As developers we have a drive to take pride in our work and want it to be the best code possible. However, that can lead to some bad practices...

In the past months I have asked myself a lot why we always strive to write perfect code. Picking up coding again for an internal project made me realise our team (and probably a large part of the rest of the software development world) spend a lot of time on writing perfectly formatted, ordered, patterned and tested code. But is this really necessary?

[...] The engineers want to write perfect code using the latest techniques, make sure that the code is well documented so they can fully understand how everything works and that it has tests so they can easily update things later. Product owners on the other hand just want things to be done, fast and cheap, so they can ship new features or convince new clients. How can you make these conflicting views work together?

He offers a few different suggestions for those developers wanting to craft the perfect codebase including coding for "now" not the future and the fact that "perfect code" just doesn't exist. He offers some suggestions for dealing with that "non-perfect code" you come across in your codebase, when starting from scratch makes sense and thinking about how "perfect" the code needs to be at the outset.

tagged: perfect code opinion development practices

Link: https://medium.com/we-are-madewithlove/does-code-need-to-be-perfect-a53f36ad7163#.jdqre42fu

Laravel News:
Can you be an expert developer in 10,000 hours?
Oct 26, 2016 @ 09:32:48

On the Laravel News site there's a new post that tries to answer the question "can you be a an expert developer in 10,000 hours?" This is based on some prior research (not specific to programming) that anyone can be an expert on anything in about 10 thousand hours worth of work and study on the subject. This post takes the ideas presented there and applies them to the world of development, trying to see if there's a good match.

Back in 1993, psychologists K. Anders Ericsson, Ralf Th. Krampe, and Clemens Tesch-Romer said that 10,000 hours of deliberate practice of a specific skill will make one an expert. Fast forward 15 years, and Malcolm Gladwell’s Outliers made the 10,000 hours rule famous. And in 2012, Macklemore solidified it’s fact status: it officially takes 10,000 hours to be an expert at anything.

How does this rule correlate to coding? If you’ve been working full time as a dev for five years, you’d be considered an expert by the parameters of the rule. [...] The problem with the 10,000 hours rule to excellence is that most domains aren’t static.

The article goes on to talk about the ever-changing world of technology (as compared to static activities where the rules aren't going to change). They talk about the Laravel framework and how it has evolved since beta/version 1 and how, if the 10k rule is applied, no one is an "expert" as it changes so fast. There's also a link to a study that debunked the 10k rule and so they shift to trying to answer another question: how much does it take to be just considered "good"? This is related back to software engineering and where in the process could it be that you move from "good" to "great".

Maybe the real question here is instead of trying to be an expert software developer, what aspects of your job can you improve in 20 hours of practice? Maybe the focus shouldn’t just be on the code; after all, your job is more than just staring at glowing screens all day. Identifying specific areas of weakness that you can devote time to strengthening every week may be the key to becoming that expert that you desire to be.
tagged: expert developer good tenthousand hours development opinion

Link: https://laravel-news.com/2016/10/10000-hours/

Medium.com:
10 Modern Software Over-Engineering Mistakes
Oct 19, 2016 @ 12:45:19

In this recent post to his Medium.com site Subhas Dandapani shares what he sees as the top ten modern software over-engineering mistakes developers make in modern application development.

Few things are guaranteed to increase all the time: Distance between stars, Entropy in the visible universe, and Fucking business requirements. Many articles say Don't over-engineer but don’t say why or how. Here are 10 clear examples.

Important Note: Some points below like “Don’t abuse generics” are being misunderstood as “Don’t use generics at all”, “Don’t create unnecessary wrappers” as “Don’t create wrappers at all”, etc. I’m only discussing over-engineering and not advocating cowboy coding.

Points in his "top ten problems" list include:

  • Engineering is more clever than Business
  • Everything is Generic
  • Shallow Wrappers
  • Overzealous Adopter Syndrome
  • In House “Inventions”

Each item in the list comes with a bit of explanation and an image or two where appropriate. There's definitely some things in here that are a bit debatable, but development has and will always have a file line between over-engineering and "just the right amount" of work. The trick is figuring out where that line is for your development work.

tagged: top10 list modern software overengineering engineering mistake opinion

Link: https://medium.com/@rdsubhas/10-modern-software-engineering-mistakes-bc67fbef4fc8#.byuwr484j

Symfony Finland:
What's in store for PHP performance?
Oct 18, 2016 @ 10:20:51

On the Symfony Finland blog there's a new post looking ahead at what they see in store for PHP's performance in a post-PHP 7.0.x world.

PHP 7.0 made significant improvements in terms of performance and memory use for real applications. Many applications deliver twice the throughput with much less memory just without any changes to the application code.

But with networked API driven architectures individual response times are increasingly critical for end-user experience. Luckily, there are quite a few unbeaten paths for regarding PHP performance.

These other "unbeaten paths" they mention include a trend towards using asynchronous patterns and the use of application servers (long running PHP processes). There's also mentions of JIT (just in time) compilation, defined request and response objects and the improvement of other possible PHP runtimes.

tagged: language future performance improvement opinion

Link: https://www.symfony.fi/entry/whats-in-store-for-php-performance

Exakat Blog:
6 good practices for "use" in PHP
Oct 14, 2016 @ 10:49:51

On the Exakat blog there's a new post sharing six good practices for "use" in PHP. The "use" keyword has a few different places it is used in PHP (like importing namespaced classes and passing in values to closures).

While reviewing code recently, I realized there are no guidelines for use. Every modern code do use ‘use’ (sic), as importing classes from composer or a framework is the norm. There are now quite a few variations in syntax for importing classes or traits. Although the impact on performance is low, as use is solved out, having a clean approach to ‘use’ is important to keep the code clean and readable. Let’s review what are the six good usage of use.

Each of the six tips they share come with a bit of explanation and code to back them up:

  • Do not import unused classes
  • Alway use alias
  • Place all use at first
  • Avoid using the same alias for different classes
  • Group use expression for easy reading
  • Limit the number of use expression

Some of them could be argued as to whether or not they're a "best practice" but it'd definitely interesting to see some tips for the use of this increasingly common little keyword.

tagged: bestpractice use statement keyword top6 import alias opinion

Link: https://www.exakat.io/6-good-practices-for-use/

Reddit.com:
How is everyone doing development locally today?
Sep 23, 2016 @ 12:08:17

On the /r/php subreddit from Reddit.com there's a post from Spvrtan asking the community what technologies they're using for local development in their day to day development work.

It's honestly been over 5 years since I last touched PHP on the back-end. At that time, other than "doing it live", XAMPP was the top dog for local environments. Is there a new player in the space or should I go with the same? I've been working primarily as a front-end engineer for the past few years during my full-time employment roles and touched the back-end on projects I've worked on but they've all been Java-based.

They also ask what other developers are using for their deployment tools and pipelines. Answers to the post so far include some of the usual tools and methods including:

  • Docker
  • puphpet (for use with Vagrant)
  • Homestead from Laravel

Other comments also mention the manual creation of virtual machines and even support for local installations rather than virtual ones. What's your development environment like? Head over to the topic and share your own setup too.

tagged: reddit rphp local development virtualmachine opinion deployment

Link: https://www.reddit.com/r/PHP/comments/54487o/how_is_everyone_doing_development_locally_today