News Feed
Sections




News Archive
feed this:

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

SitePoint PHP Blog:
Best Practices REST API from Scratch - Introduction
July 22, 2014 @ 09:39:12

The SitePoint PHP blog has posted the second part of their series looking at building up a REST API "from scratch". In this latest post Vita Tardia introduces some of the basic topics and the best practices that are around their use.

The current internet ecosystem has literally been invaded by APIs, and for good reasons. By using third party APIs in your products or services, you have access to a ton of useful features - such as authentication or storage services - that can benefit both you and your users. By exposing your own API, your application becomes "part of the mix" and will be used in ways you've never thought before… if you do it the right way, obviously. In this two part series I'll show you how to create a RESTful API layer for your PHP applications, using a collection of real world best practices.

He talks about how a REST API is a "user interface for developers" and the actions the different verbs could take on the same endpoints (PUT, POST, GET, etc). He uses the Slim framework in his examples and helps you get an instance all set up and working. He includes a bit about getting SSL/HTTPS up and running for all requests to the site too. From there he gets into the bootstrapping of the application and the first version of controller handling. He also includes code examples touching on JSON handling, authentication and good error handling.

0 comments voice your opinion now!
tutorial rest api introduction slimframework bestpractices

Link: http://www.sitepoint.com/best-practices-rest-api-scratch-introduction/

PHPBuilder.com:
Top 11 Best Practices for PHP Development
July 07, 2014 @ 18:08:30

PHPBuilder.com has offered the top eleven practices they see as a must for any PHP developer to incorporate.

Right from its inception, PHP was widely used to develop web based applications. Since PHP is a scripting language, one must follow some rules while developing. This article will discuss the best practices that are generally followed in the PHP world.

Their "top eleven" list includes things like:

  • Error reporting should be turned on
  • Meaningful and consistent naming standards
  • Deep Nesting should be avoided
  • Use adequate comments
  • Use Cache mechanism wherever required

You can read up on their full list and the descriptions of each in the full post.

0 comments voice your opinion now!
bestpractices development tips list top11

Link: http://www.phpbuilder.com/articles/application-architecture/optimization/explore-the-top-11-php-best-practices.html

QaFoo Blog:
Testing Find the Sweet Spot
July 18, 2013 @ 11:52:01

On the QaFoo blog there's a recent post interviewing Johann Peter Hartmann, the CTO of Mayflower, about current PHP testing practices and how to find that "sweet spot" that works for your development.

Talking to interesting people spawns ideas and spreads insight knowledge. Therefore, I talked to Johann Peter Hartmann about testing culture and how PHP projects should approach testing in 2013.

They talk about things like:

  • The move from "spaghetti code" to "quality code"
  • A discussion of the current tools
  • Defining a unit testing strategy
  • Test Driven Development

They also talk some about the training that the QaFoo folks provided to help them (Mayflower) work all of this out for their organization.

0 comments voice your opinion now!
unittest bestpractices company organization

Link: http://qafoo.com/blog/051_testing_sweet_spot.html

Brandon Savage:
"Do This, Not That" Now Available!
December 20, 2012 @ 10:50:36

Brandon Savage has officially released his book, "Do This, Not That" - a book targeted at beginners to the PHP language, trying to teach them best practices for some of the most common situations they might come across.

Too many books on best practices read like a manual. They are dry, boring and cover topics that you don't care about. "Do This, Not That" is different. A collection of essays, it highlights those areas for which best practices are either not well known or not well defined. It offers clear solutions that will be easy to implement. I've taken the time to research and identify what I feel are the best practices, and condensed it into a two hour read that will leave you feeling empowered, not exhausted.

If this sounds interesting to you, you can pick up a copy on the official site for about $30 USD and, if you're more of a try-before-you-buy sort, you can read a sample chapter covering type hinting.

0 comments voice your opinion now!
dothisnotthat book published language bestpractices introduction


Joshua Thijssen:
Introducing the REST cookbook
December 13, 2012 @ 10:18:57

In an effort to share the REST-related information he's been helping people out with over time, Joshua Thijssen has created a new resource that's less about the basics of REST and more about how to handle specific situations - restcookbook.com.

This is why I decided to setup a simple website, that pretty much tries to answer any question about REST. It's not completed yet.. Actually, it hasn't got many posts to begin with :), but a start has been made and we will fill it with questions and answers about REST and HTTP issues.

As of the time of this post, it only has a few articles, but they're a good start like:

0 comments voice your opinion now!
rest cookbook resource bestpractices api resource


Brandon Savage:
Private Methods Considered Harmful ("Do This, Not That" Excerpt)
December 10, 2012 @ 11:26:42

A while back Brandon Savage mentioned a book he was writing ("Do This, Not That") to help PHP developers learn some of the best practices associated with the language. Today he's posted an excerpt from the book for your enjoyment.

This great series of highly focused e-books will offer tips, tricks and best practices focused on core areas of PHP development, including databases, security, filtering, regular expressions, configuration and more. Since it will be a series of tightly targeted solutions, developers will be able to pick all, some or just one of the offerings that solves their specific problem(s).

This excerpt looks at private method use in your applications and why they could be considered "evil" if not used correctly.

0 comments voice your opinion now!
book excerpt private method dothisnotthat introduction bestpractices


Community News:
PHPBestPractices.org - A Short Practical Guide
August 23, 2012 @ 10:07:01

There's another site tossing their hat into the "best practices in PHP" ring (the other being PHP The Right Way) with what they call a "short, practical list for common and confusing tasks" in PHP - PHPBestPractices.org.

[Outdated tutorials and information is] one of the reasons why new PHP programmers are so frequently blamed for ugly, outdated, or insecure code. They can't help it if the first Google result was a four year old article teaching a five year old method! This document tries to address that. It's an attempt to compile a set of basic instructions for what can be considered best practices for common and confusing issues and tasks in PHP. If a low-level task has multiple and confusing approaches in PHP, it belongs here.

The site has sections for topics like:

If you're interested in helping out and adding more content to the site, contain the maintainer and let him know.

0 comments voice your opinion now!
guide bestpractices common issues confusing


Anthony Ferrara's Blog:
The Secure Programmer's Pledge
July 17, 2012 @ 12:23:22

Anthony Ferrara has posted a pledge he recommends all developers take to improve the security of their applications.

Every day I come across code that is insecure. Sometimes the code is so hilariously insecure that any 10 year old could break it. I've also gotten into discussions with people who should know better about their practices. It's very, how to put this, disheartening. It's sad that the average developer knows (and cares) so little about proper security practices. So, I've put together a simple pledge (or manifesto, if you'd like).

The pledge includes the ideas of data storage techniques, taking responsibility for user data, reusing existing/tested libraries instead of writing your own and being open to constantly learning. He elaborates on each point, giving a little context for each.

Are you a secure programmer? Do you want to be? Then take the pledge, and fight for the security of your applications. It's all of our responsibility, so do your part!
0 comments voice your opinion now!
security programmer pledge bestpractices


Community News:
PHPEasy.co.uk Launched
July 12, 2012 @ 09:29:35

Carl Gresswell has put together a new site that aims to provided tutorials for budding PHP developers out there looking to advance their knowledge of the language and some of the best practices surrounding it - PHPEasy.co.uk.

I have created PHPeasy with the aim of providing tutorials, tips, code snippets and news on the subject of PHP. I rarely get the opportunity to discuss PHP and share thoughts with other like minded developers, so I'm hoping that this blog will allow me to do that. I aim to provide resources that will be useful to coders of all levels, whether a newbie or master I'm hoping that there will be something for everyone.

It's a relatively new site, but there's already a series posted (parts 1-3) about some of the basics of working with object-oriented programming in PHP:

0 comments voice your opinion now!
tutorial oop programming bestpractices


Community News:
PHP, The Right Way Site Launches
July 10, 2012 @ 08:12:34

In response to some of the recent talk about the quality of PHP and some of the recent suggestions about the right and wrong ways to write PHP, the PHP The Right Way site has been lunched.

There's a lot of bad information on the Web (I'm looking at you, W3Schools) that leads new PHP users astray, propagating bad practices and bad code. This must stop. PHP: The Right Way is an easy-to-read, quick reference for PHP best practices, accepted coding standards, and links to authoritative tutorials around the Web. It is important to understand there is no canonical way to use PHP. That's the beauty of it. This website introduces new PHP developers to best practices, available options, and good information.

The site has some "getting started" tips for working with PHP 5.4, links to some of the current PSR standards and gets into some of the best practices for things like proper OOP structure, namespacing and using the SPL. There's also hints on using Composer for package management, working with databases and some basic parts on security and testing.

Additionally, the site is also an open source project so you can contribute your own content (it'll have to be approved before merging) on topics you might not see or want to improve.

0 comments voice your opinion now!
phptherightway bestpractices topics opensource contribute



Community Events





Don't see your event here?
Let us know!


interview introduction opinion laravel install unittest code language series symfony2 podcast developer list threedevsandamaybe framework experience refactor release testing community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework