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

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

5 New Features In PHP 7 That You Should Have A Look At
Oct 19, 2016 @ 09:43:05

If you've heard about the release of PHP 7 but aren't quite sure what it has to offer, check out this quick post on the StartTutorial site giving you a "top five" list of things this new version of the language has to offer.

But you must be wondering why PHP named its latest release PHP 7 and not PHP 6. Reason behind it is that, many of the PHP 6 releases were already implemented in PHP 5.3 and later, there was not really a proper reason just to change the name. What I am trying to say here is that we haven’t missed anything. Just to avoid the confusion with a dead project, PHP's latest release was named to PHP 7.

Is This Hype Valid for PHP 7? What It Actually Brings Forth for the Developers? Hop on and let’s take a deeper dive. Let's check out what new features PHP 7 has to offer. And what improvements those features will bring forth.

Their top five list covers some of the major improvements in the language:

  • Speed Improvement
  • Implementation of Type Declarations
  • Implementation of Error Handling
  • New Operators
  • CSPRNG Functions

There's a bit of explanation of each item on the list but you'll definitely want to refer to the PHP manual for more details and specifics on what changed in PHP 7.

tagged: php7 feature top5 list speed typing errors operators csprng

Link: https://www.startutorial.com/articles/view/5-new-features-in-php-7-that-you-should-have-a-look-at

Buggy PHP Code: The 10 Most Common Mistakes PHP Developers Make
Oct 07, 2016 @ 11:12:27

On the Toptal.com site a new article has been published from author Ilya Sanosyan with his list of top ten development mistakes he sees PHP developers make leading to more buggy code.

PHP makes it relatively easy to build a web-based system, which is much of the reason for its popularity. But its ease of use notwithstanding, PHP has evolved into quite a sophisticated language with many frameworks, nuances, and subtleties that can bite developers, leading to hours of hair-pulling debugging. This article highlights ten of the more common mistakes that PHP developers need to beware of.

Included in his list are common issues like:

  • Leaving dangling array references after foreach loops
  • Confusion about returning by reference vs. by value
  • Performing queries in a loop
  • Assuming $_POST will always contain your POST data
  • Ignoring coding standards

For each item on his list he provides good code examples and explanation of both why it's an issue and what can be done to prevent it.

tagged: top10 common mistakes programmers developers list example code

Link: https://www.toptal.com/php/10-most-common-mistakes-php-programmers-make

SitePoint PHP Blog:
8 Must-Have Grav Plugins to round-off Your Blog’s Installation
Aug 08, 2016 @ 10:22:52

On the SitePoint PHP blog there's a new post from editor Bruno Skvorc sharing his list of top 8 plugins for Grav he sees as "must haves". Grav is a flat-file based content management system that uses modern PHP practices such as Composer packages, Makdown for content and YAML for configuration.

I recently switched my blog over from Blogger to Grav, and while quite a nifty platform on its own, Grav really shines once you prop it up with some custom themes and plugins.

This post will list the plugins I believe to be essential for a developer’s personal blog, and the reasons behind each suggestion.

Among the plugins on his list are options like:

He includes examples of what the output of each looks like when integrated into the site and how to get them installed and configured. Check out the remainder of the post for more in his list of suggestions.

tagged: grav plugin blog installation example top8 list

Link: https://www.sitepoint.com/8-must-have-grav-plugins-to-round-off-your-blogs-installation/

SitePoint PHP Blog:
Laravel Doctrine – Best of Both Worlds?
Jun 14, 2016 @ 11:56:59

On the SitePoint PHP blog there's a tutorial posted from Francesco Malaesta about the Laravel Doctrine project, wondering if it's the best of both worlds for connecting to databases and working with entities in your Laravel-based project.

Laravel Doctrine is a drop-in implementation of the famous ORM for the Laravel 5.X Framework, and a really interesting alternative to the default choice, Eloquent. In this article, we will learn how to use it, and when.

He starts with a comparison of the two options - Doctrine vs Eloquent - and why you might choose the former over the latter. He then gets into the installation of a new Laravel project and pulling in the laravel-doctrine/orm package. He then shows it in action with a simple to-do list application, creating an entity for the tasks. From there he shows the use of the EntityManager to add a new task and find ones matching certain criteria. He makes a TaskController to handle the route functionality and creates the matching frontend views to allow the user to define new tasks. Also included is the code for the other "CRUD" (create, read, update, delete) handling for the tasks and the addition of the relationship between users and tasks.

tagged: laravel doctrine tutorial eloquent todo list

Link: https://www.sitepoint.com/laravel-doctrine-best-of-both-worlds/

Laravel News:
A look at what’s coming to Laravel 5.3
Jun 02, 2016 @ 11:48:55

On the Laravel News site there's a post detailing out some of the new things coming to Laravel 5.3 currently still in development but should be released in the near future.

Laravel 5.3 is currently in development and with all new Laravel releases, new features are being teased out as they are added. Here is a quick look at some of these new features.

The list of these new features includes:

  • Eloquent Collections are cleanly serialized and re-pulled by queued jobs
  • Queue console output changed to show the actual class names
  • First Or Create [now takes additional values]
  • Multiple Migration Paths

There's also a mention of the Laravel Echo functionality that makes in-app broadcasting simpler. For some of the topics there's links to other posts with more information too.

tagged: laravel v53 development features list

Link: https://laravel-news.com/2016/06/look-whats-coming-laravel-5-3/

Community News:
Laravel Internals Discussion Moves to Github
Mar 15, 2016 @ 10:18:47

The Laravel project has traditionally held discussions about the internals of the framework in an IRC channel on the Freenode.net network. The decision was made recently, however, to move the development over to GitHub (most likely to make it more accessible).

There's already several issues that have been posted on the Issues list in the GitHub repository including things around:

  • improving typecasting
  • decoupling Carbon (the date handling library)
  • a fluent interface for validation
  • enhancing the localization functionality

You can give feedback or start your own discussions by adding an issue to the list or just sharing your thoughts on current topics.

tagged: laravel community issues list internals github irc channel

Link: https://github.com/laravel/internals/issues

SitePoint PHP Blog:
3 More Joins You Should Be Familiar With
Feb 08, 2016 @ 12:18:36

On the SitePoint PHP blog Zach Wallace shares more database wisdom with his readers introducing three more JOINs you should know in your development work.

There are many ways to JOIN data from two database tables and filter the information you require. Craig Buckler wrote a popular piece on understanding JOINs; namely INNER, LEFT, RIGHT, and FULL OUTER. This article is an extension of that one.

He starts with the data he'll be working with: customers and books, linked by a book_id column. He then quickly reviews some of the joins already discussed in the previous article (LEFT, RIGHT, OUTER, INNER) before getting into the newer, more powerful types:

  • LEFT JOIN with Exclusion
  • RIGHT JOIN with Exclusion
  • OUTER JOIN with Exclusions

He finishes the post with a few other thoughts about using WHERE clauses in JOINs, the CROSS JOIN and how the JOINs relate to each other in MySQL.

tagged: join database three list inner outer left exclusion advanced example tutorial

Link: http://www.sitepoint.com/3-more-joins-you-should-be-familiar-with/

SitePoint PHP Blog:
Crash Course of Wunderlist’s API with Guzzle
Jan 11, 2016 @ 11:14:31

The SitePoint PHP blog has a tutorial posted giving you a crash course on the Wunderlist API and using Guzzle to connect with it. Wunderlist is a task-tracking, to-do list kind of application with support for multiple platforms and, for developers, a nice and relatively easy to use API.

Wunderlist is one of the most popular task management and list keeping applications out there. It allows you to create lists to which you can then add tasks that are easily checkable and have all sorts of functionality built into them. It has native apps for all the major OS’s and all your data syncs effectively over the cloud. It’s very nice to work with if you are trying to keep yourself organized and you can get a lot done even with the free version.

They've posted the final product in a demo repository but they still walk you through the whole process of setting up a simple application that can get, submit and update data via the API:

  • Creating the Wunderlist class (a HTTP client)
  • Returning data using the Wunderlist API
  • Creating and updating data with the Wunderlist API

They also talk a bit more about the OAuth flow the API uses for authentication and points out that the repository also includes a bit more functionality allowing you to get a list and mark the items as complete with a little Ajax.

tagged: crash course wunderlist api guzzle tutorial task list todo

Link: http://www.sitepoint.com/crash-course-of-wunderlists-api-with-guzzle/

Lorna Mitchell:
Generating a File List for Phan
Nov 27, 2015 @ 10:38:33

Lorna Mitchell has shared a tip she's found helpful when using the phan static analysis tool for finding only PHP files via a simple grep.

Phan is the PHP Analyzer for PHP 7 code. I've been using it, partly out of curiosity, and partly to look at what the implications of upgrading my various projects will be. [...] I generated my filelist.txt files with a little help from grep - by looking for all files with opening PHP tags in, and putting that list of filenames into a file.

The phan tool is still pretty young but it provides a good example of how to use the new php-ast handling to parse and analyze PHP code.

tagged: phan file list generate quick tip grep static analysis tool

Link: http://www.lornajane.net/posts/2015/generating-a-file-list-for-phan