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

Jason McCreary:
Writing Clean Code
Aug 14, 2017 @ 10:42:02

In a new post to his site Jason McCreary makes a case for writing clean code in your development processes. He makes three main suggestions of practices you can integrate into your workflow to help make the code you write cleaner.

I noticed [legacy codebases] all suffer from the same fundamental issue - inconsistency. Often the result of years of code patching, large teams, changing hands, or all of the above.

This creates a problem because we read code far more than we write code. So as I read a new codebase these inconsistencies distract me from the true code. My focus shifts to the mundane of indentation and variable tracking instead of the important business logic.

In my experience, I find I boy scout a new codebase in the same way. Three simple practices to improve the readability of the code.

His three suggestions for improving the overall code quality center around standardized formatting rules, consistent naming practices and avoiding nested code. He uses an example piece of code to help illustrate these recommendations with explanations for each.

tagged: clean code top3 suggestions formatting naming nested

Link: https://jason.pureconcepts.net/2017/08/writing-clean-code/

Magium Blog:
3 Best Practices for Selenium Testing when Constructing Your Page
Feb 17, 2016 @ 09:55:26

In a new post to the Magium site Kevin Schroeder shares three helpful tips you can use for the Selenium testing of your application based on some of his recent development on the project.

Having spent now about two months building out Magium there are a couple of things that are worth sharing as I’ve been working through several different versions of Magento. These practices (best practices?) may or may not be “officialized” by the Overlords of the Internet but what I have found is that I have the most trouble when these practices are not executed.

The basic premise behind each of these is that the quickest path to the most specific element is best.

His three tips avoid things like long XPath expressions to locate single items and favor consistency and simplicity:

  • Wrap ALL text in an HTML element – leave no orphaned text
  • If an element has function, identify it.
  • Group data using classes and IDs

He ends the post with a reminder that a well-structured page not only helps with testing but is also a good goal to strive for related to maintainability.

tagged: selenium testing magento tips top3 structure

Link: http://magiumlib.com/blog/3-best-practices-for-selenium-testing-when-constructing-your-page/

Geshan Manandhar:
3 Bundles to get started with REST in Symfony 2 and some tips
Aug 13, 2014 @ 12:18:05

Geshan Manandhar has a recent post that shares three Symfony bundles that can help you out greatly when creating RESTful applications and APIs. Links and a summary of each bundle are provided.

"I found out that you guys just build an amazing mobile app for your e-commerce venture, I heard you are using Symfony 2 for your back-end APIs. How did you make it that fast?" This is not very different that what I was asked some months back. The answer is we use a Service Oriented Architecture (SOA) where all back-end service follow the REST architecture to communicate with all the clients. The client can be built in any language as longs a they can do HTTP calls. Lets look at what Symfony 2 bundles you can use to build a similar scalable, fast and cacheable REST APIs.

His suggested bundles (all available to be installed via Composer) are:

The first two help more with the overall API structure and handling while the last (Lexi) is an effective way for handling authentication for the requests to your application.

tagged: symfony bundles rest api top3 list

Link: http://geshan.blogspot.ae/2014/07/3-bundles-to-get-started-with-rest-in.html