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:
7 More Mistakes Commonly Made by PHP Developers
July 25, 2014 @ 11:29:28

Following several other posts with the "common mistakes PHP developers make" theme, Bruno Skvorc has posted his own list of seven things he sees developers doing over and over.

Back at the end of June, TopTal, the freelance marketplace, published a post about 10 Most Common Mistakes PHP Programmers Make. The list wasn't exhaustive, but it was well written and pointed out some very interesting pitfalls one should be wary of - even if I wouldn't personally list the mistakes as very common. I encourage you to give it a thorough read - it has some truly valuable information you should be aware of - especially the first eight points.

His additions to the list of common mistakes includes:

  • Using the mysql extension
  • Not rewriting URLs
  • Assigning in Conditions
  • Being Too Transparent

You can read the full list and summaries of each in the rest of the post.

0 comments voice your opinion now!
common mistakes list more

Link: http://www.sitepoint.com/7-mistakes-commonly-made-php-developers/

Anna Filina:
Common PHP Mistakes
July 21, 2014 @ 13:53:31

Anna Filina has posted her own addendum to a top ten list of common PHP programmer mistakes, adding seven more of her own.

I was recently asked by one of my readers to give feedback on the following article he read: 10 Most Common PHP Mistakes. It is well written and very thorough. Most of the tips are specific to PHP, others are about web programming in general or database performance. It's a very good read. I was also asked to contribute to this list, so here are 7 more tips.

Her list of seven touches on topics like caching, allowing SQL injection, disabling error reporting and ignoring accessibility. She also includes some configuration settings, code and links to other tools/resources to help provide information on preventing these other mistakes.

0 comments voice your opinion now!
common programmer mistakes additional tips

Link: http://afilina.com/common-php-mistakes/

Toptal Blog:
10 Most Common PHP Mistakes
July 17, 2014 @ 12:52:40

On the Toptal blog Ilya Sanosyan has a post sharing what he sees as the top ten most common mistakes PHP developers make on a day to day basis. While most of the tips are code-specific there are one or two that are a bit more abstract.

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 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.

Among the items on his list are things like:

  • Leaving dangling array references after foreach loops
  • Confusion about returning by reference vs. by value
  • Memory usage headfakes and inefficiencies
  • Assuming $_POST will always contain your POST data
  • Thinking that PHP supports a character data type

Each of the items comes with a good description, some code and suggestions on how to avoid and/or fix it in your applications.

0 comments voice your opinion now!
common language mistakes top10 list

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

Timoh's Blog:
PHP data encryption cheatsheet
June 17, 2014 @ 10:52:44

Timoh has published a data encryption cheatsheet to his blog today. It's "a short guide" to help you prevent some of the more common encryption-related problems in your application, specifically around symmetric data encryption.

This cheatsheet assumes a "client-server" situation, which is probably a typical case with PHP applications. Naturally the recommendations given here are not the "only possible way" to handle data encryption in PHP, but this cheatsheet aims to be straightforward and tries to leave less room for mistakes and (possibly confusing) choices.

The cheatsheet includes information on topics like:

  • Encryption algorithm / mode of operation / nonce (initializing vector)
  • Encryption and authentication keys
  • Key stretching
  • Key storage and management
  • Data compression

It's jam-packed full of great information, so definitely check it out if you're doing any kind of encryption in PHP.

0 comments voice your opinion now!
data encryption cheatsheet common mistakes

Link: https://timoh6.github.io/2014/06/16/PHP-data-encryption-cheatsheet.html

Doctrine Project:
Our HHVM Roadmap
December 24, 2013 @ 11:57:58

The Doctrine project has posted an update about the work being done in collaboration with and to help its performance with HHVM (the HipHop VM from Facebook) and talking about their future plans.

Facebook has been pushing HHVM alot lately, helping open source projects to get their test-suite running 100%. For Doctrine HHVM is particularly interesting, because of the performance gains that the complex PHP algorithms inside ORM would probably get. From my current feeling Doctrine will be the PHP open-source project getting the most gain from running on HHVM. However with the tests not yet passing on the ORM, we can only imagine how big that performance improvement will be.

One of their goals is to be able to run DBAL/ORM on HHVM with 100% passing tests. So far they've been working on Common project functionality and have three as fully supported under HHVM - Collections, Inflector and Lexer. Work is still being done on other parts of the codebase, with the ORM and DBAL being the lion's share of the job.

0 comments voice your opinion now!
doctrine project hhvm facebook orm dbal common

Link: http://www.doctrine-project.org/blog/our-hhvm-roadmap.html

Reddit.com:
Why don't you contribute to PHP?
September 05, 2013 @ 13:26:29

On Reddit.com today nikic asks you why you don't contribute to PHP, that is to the language itself or the community around its improvement.

I know many of you care about PHP and have suggestions about how to improve it. My questions is: What prevents you from writing a mail to the internals mailing list with your suggestion/proposal (or to participate in existing discussions)? [...] I'd be interested in your opinions and hope that things can be improved based on them.

Some of his own examples to kick off the discussion include time constraints, not being able to write the patch themselves and some of the issues with the culture of the internals mailing list. Other suggestions from the comments include lack of confidence in coding skills (C++), the possible lack of interest in the RFC and the current state of the language's codebase.

0 comments voice your opinion now!
contribute language reason common list

Link: http://www.reddit.com/r/PHP/comments/1lsha2/why_dont_you_contribute_to_php/

NetTuts.com:
20 All Too Common Coding Pitfalls For Beginners
November 12, 2012 @ 14:52:59

On NetTuts.com there's a great list of tips and things to keep in mind if you're a budding programmer - a set of common pitfalls to watch out for as you hone your skills.

Regardless of our current skill level, we all were beginners at one point in time. Making classic beginner mistakes comes with the territory. Today, we've asked a variety of Nettuts+ staff authors to chime in with their list of pitfalls and solutions - in a variety of languages. Learn from our mistakes; don't do these things!

The article starts off with some Javascript tips, but quickly gets into some more PHP specific things like:

  • Use Ternary When Appropriate
  • Use Guard Clauses
  • Keep Methods Maintainable
  • Avoid Deep Nesting
  • Don't Overuse Variables

There's also two "extras" thrown in more concerning general programming practices - using methods to represent actions and some basic code readability suggestions.

0 comments voice your opinion now!
common issue beginner developer javascript general


Ulf Wendel:
Not only SQL injection I don't trust you!
September 26, 2012 @ 08:34:59

On his site today Ulf Wendel talks about SQL injection and some comments that came up during a recent webinar about common MySQL mistakes PHP developers make.

Never trust user input! Injection is a threat . You are the new web developer, aren't you?. Never trust user input is the first rule I had to learn as a web developer in anchient times. Injection can happen whenever user input is interpreted or used to compose new data. A quick recap of the #3 mistake from todays Top 10 MySQL Tips and Mistakes for PHP Developers web presentation. A webinar recording should be available in a couple of days.

He points out a few "don't" things to avoid - like directly injecting superglobal values into your query and to remember that not all SQL injections are because of escaping issues. The real key? Validating input - be sure you're putting values into your query that are of the correct type and contain what you expect.

0 comments voice your opinion now!
sqlinjection mysql webinar common mistake


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


PHPMaster.com:
Layer Supertype Pattern Encapsulating Common Implementation in Multi-Tiered Systems
July 04, 2012 @ 17:13:39

On PHPMaster.com there's a new post looking at a design pattern that's commonly in use by developers but they might not know its name - the Layer Supertype pattern and its use in multi-tiered systems.

Inheritance offers a straightforward way to easily spawn a large number of objects that are semantically related to each other without having duplicate code. The concept is ridiculously simple - yet powerful: you first drop as much logic as possible within the boundaries of a base type (usually an abstract class, but it could be a concrete one), and then start deriving refined subtypes according to more specific requirements. [...] Not surprisingly, this repetitive encapsulation/derivation cycle lays down on the formalities of a design pattern known as Layer Supertype.

They describe the "supertype" as a replacement for an overly bloated domain-related model. Their example replaces a PostInterface/CommentInterface with a more generic "AbstractEntity" that handles some of the basics for you - getting/setting, checking a field, setting an ID and outputing the information to an array.

0 comments voice your opinion now!
layersuprtype designpattern inheritance common logic



Community Events





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


interview framework symfony install tool library version release opinion security podcast composer language application laravel introduction series package community voicesoftheelephpant

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