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

Stanislav Malyshev:
PHP 5.4 (Looking Back) & 5.6 (Looking Forward)
September 01, 2014 @ 09:42:13

In two new posts to his site Stanislav Malyshev takes a look both forward and back at the PHP language, where it came from in the 5.4 version and ahead into the just released 5.6 version discussing the good, bad and road ahead.

With 5.6.0 having been released and 5.4 branch nearing its well-earned retirement in security-fixes-only status I decided to try and revive this blog. As the last post before the long hiatus was about the release of the 5.4, I think it makes sense to look back and see how 5.4 has been doing so far.

Having taken a look in the past, now it's time to look into the future, namely 5.6 (PHP 7 is the future future, we'll get there eventually). So I'd like to make some predictions of what would work well and not so well and then see if it would make sense in two years or turn out completely wrong.

In the look back at 5.4 he talks about some of the good (the release process, $this in closures) and some of the "not so good" including traits and the overall adoption rate. He also includes a few "don't know" items such as the overall performance and the inclusion of the mysqlnd driver. In the look forward he talks about the impact of things like constant expressions, phpdbg and function/constant importing (for better or for worse). He also briefly mentions two hurdles to the adoption of 5.6: OpenSSL becoming more strict and the overall adoption rate.

0 comments voice your opinion now!
lookforward lookback opinion version good bad

Link: http://php100.wordpress.com/2014/08/30/php-5-6-looking-forward/

Ulrich Kautz:
C-based Web Frameworks for PHP
February 27, 2013 @ 11:09:46

In this recent post to his site Ulrich Kautz takes a look at an interesting development in the PHP framework world - C-based frameworks installable as PHP extensions. He covers some of the good and bad things about this approach.

At the End of 2012 I had my first contact with a C-based PHP frameworks, namely YAF. Coincidently, some day afterwards Bruno from phpmaster.com pointed me towards Phalcon - a more modern interpretation of the same idea. So I was hooked.

In his "good idea" category he notes that it's faster because it's already loaded in on the request (no long list of includes) and the memory footprint is less than a PHP equivalent. The "bad" side of things mentions some pretty major hurdles though, including the small communities vs larger ones on PHP-based frameworks and the issues that could come with debugging/upgrading.

0 comments voice your opinion now!
cbased framework extension good bad phalcon yaf


The Coders Lexicon:
My Love / Hate Relationship With PHP Traits
February 11, 2013 @ 12:50:45

On the Coder's Lexicon site, there's a recent post talking about the author's love/hate relationship with PHP traits, a relatively new feature of the language that apps for more "drop-in" functionality similar to mixins in other languages.

When I saw the introduction of PHP traits in 5.4.0 I was eager to learn all about them and how they worked. [...] PHP traits, in my opinion, are handy and very flexible. I guess that is the "love" part of my relationship with them. [...] However, I feel that traits also meddle with a bit of the inheritance rules that have been proven time and time again. Is it possible to love as well as hate something at the same time?

He talks first about "the love" he feels for using traits in his code. He talks about their usefulness for geting around PHP's single inheritance structure and being able to "bolt on" functionality as needed. Then comes "the hate" of them, noting that in the wrong hands, they could lead to very messy and lazy coding practices (including the deadly diamond of death problem).

0 comments voice your opinion now!
love hate traits good bad example mixin opinion


Brandon Savage:
When To Write Bad Code
January 29, 2013 @ 11:14:51

Brandon Savage has posted some of his thoughts on when it's okay to write bad code in your development lifecycle:

I've been there myself. I recently needed to prototype something. As I sat down to work on it, I had absolutely no idea how I was going to write the component I was working on. And so, I started working - without a plan, without writing tests, without designing an architecture, and without really knowing how the component was going to end up. You know what? The component came out working, but when I was done it was ugly. Totally ugly. The code was bad. But I had a solution, and a solution that worked.

He points out that sometimes, doing things "the right way" can stifle creativity and experimentation - two things that a developer needs to solve the problems they face day to day. He notes that refactoring is a part of their job and moving from a rough prototype to a finished product often improves this skill and can find issues not discovered before.

This does NOT mean that developers can push bad code into a repository. Nothing lives longer than temporary code; see to it that your finished code is always good.
0 comments voice your opinion now!
bad code opinion prototype experiment creative refactor


PHPMaster.com:
PHP Traits Good or Bad?
January 21, 2013 @ 09:19:48

In this new post to PHPMaster.com, Callum Hopkins takes a look at one of the more recently added features of the PHP language, traits an tries to determine if they're a good or bad thing for PHP development.

In early March 2012, the PHP Group announced the release of PHP 5.4. Developer eagerly anticipated the release because of the many new features 5.4 would bring, the most sought after being traits. [...] Traits have have been generally accepted by the PHP development community, mainly because it's a feature that exists within other programming languages like Java, C++, and Python. [...] Are they a feature which will help raise the level of PHP development, or are they just a fad?

The starts with a few reasons why he thinks traits are bad like their potential for abuse and the difficulties that could be caused by using them instead of something like an interface. On the good side, though, he mentions things like allowing for "multiple inheritance" and their addition showing growth in the language.

0 comments voice your opinion now!
traits feature language introduction good bad


DevShed Forums:
PHP is a fractal of bad design? Hardly.
August 29, 2012 @ 09:41:55

A while back there was an article that put a negative spin on PHP ("PHP: a fractal of bad design") and there was a huge community response to it with over 1400 comments on the post itself. Over on the DevShed forums, there's a lengthy new post that goes back over that article, piece by piece, and evaluates everything that was said.

As I've seen this article a number of times, I'd like to go through it to see what everyone has to say on the subject. Warning: This is just stupidly, ludicrously long. it takes an existing 5-page article and tears it apart nearly sentence-by-sentence.

He goes back through each of the sections - Stance, Arguments, Philosophy, etc - and includes quotes from the articles and his own impressions/thoughts about them. There's a section covering some of the individual complaints that were mentioned and things like PHP's OOP model and security.

0 comments voice your opinion now!
opinion forum response article bad design


Pim Elshoff's Blog:
Dependency management
February 14, 2012 @ 12:04:18

Pim Elshoff has a recent post to his blog about dependency injection in PHP applications and some of the good and bad things about implementing it. He includes examples of a few different types of "injection" ranging from using globals to an actual dependency injection container.

This article describes common pains and symptoms of bad dependency management and common techniques for dealing with project-wide dependencies. [...] For the purpose of this article I am talking about classes using other classes. To manage your softwares dependencies then becomes designing your software architecture such that the depencies are good. The following sections will talk about what's bad, with good being the absense of bad.

In his "problems" section he includes things like "it's easy to do wrong", "it's hard to get rid of", the "low rate of reuse in bad DI" and how bad DI can make for "untestable software". He points to a few packages (including PHP_Depend) that can be used to determine your dependency levels. His methods for "injection" include using the global scope (so bad), using injection in a constructor/setter, making a service locator (registry) and using a full-blown dependency injection container.

All techniques, tricks and gimmicks aside, managing dependencies is more about actual design than abstract design patterns. You yourself are responsible for keeping the number of dependencies as low as possible and designing your system such that access to dependencies is provided in a sane, understandable manner.
0 comments voice your opinion now!
dependency management injection bad technique architecture


Stuart Herbert's Blog:
Introducing ContractLib (Programming Contracts)
January 13, 2012 @ 14:11:52

In this recent post to his blog Stuart Herbert introduces a system he's created to handle "contracts" in PHP development - ContractLib.

Programming contracts are tests around functions and methods, and they are normally used: to catch any 'bad' data that has been passed into the function or method from the caller, and to catch any 'bad' data generated by the function or method before it can be returned to the caller. These are pre-condition and post-condition tests, and they are tests that either pass or fail.

He points out that by having contracts you not only increase the robustness of your code but you also save time not trying to hunt down data-related issues. Using pre-conditions, you can can check data to ensure things like correct formatting, data that's out of range and data that might be missing. His ContractLib comes with a set of tests that provide good examples of how to use the functionality. Installation instructions are included.

0 comments voice your opinion now!
programming contract contractlib test data bad


Community News:
Launch of CSIPHP
July 08, 2011 @ 10:08:12

Jeremy Kendall has started up a new blog that's a sort of "WTF in PHP" listing of some of the random (and bad) code that he comes across daily - CSI:PHP.

It all began with a new gig and an amazingly horrific codebase. I began tweeting the most unbelievable, most frustrating snippets I could find. After quite a few of those tweets, Chris Hartjes replied with, "Looking at your tweets I cannot even fathom what your job is. CSI:PHP ?" A concept was born.

Some of the posts so far include eval() hell, a bad use of preg_replace and a bad method for calling mail(). Currently there's not a way for others to contribute their own code WTFs, but from what I hear it's possible for the future.

0 comments voice your opinion now!
csiphp wtf humor bad code


NetTuts.com:
Why You're a Bad PHP Programmer
February 21, 2011 @ 09:02:16

On NetTuts.com today there's a new (slightly inflammatory) post about why you're a bad PHP programmer - really why some of the practices you follow might be in the "bad things to do" playbook.

We all have our bad habits. In this article, we'll go over a list of bad practices that are worth examining, reevaluating, and correcting immediately.

In his list of things to avoid are suggestions like:

  • not planning before coding
  • opting for brevity over clarity
  • no coding standards
  • code duplication
  • practicing "Not Invented Here" (NIH)
  • not working on side projects to introduce yourself to new technology
0 comments voice your opinion now!
bad programmer suggestion opinion bestpractices



Community Events





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


wordpress application podcast threedevsandamaybe laravel project library release series list api introduction code language framework developer interview configure install community

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