Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.

tags refactoring

Let Your Properties be Properties

May 8th, 2007

There is a coding pattern that I see (and have used) in PHP code that defines generic methods on a class for setting and getting properties.
 
function set($name, $value);
function get($name);
 Google code search for examples
Some times there are some ancillary methods to deal with unsetting, checking for existence, setting via an array, or dealing with references in [...]

13 Comments | Read the full post »

Bad Code Smells in WACT, a refactoring review

October 18th, 2004

This post shows some bad design elements in WACT and discusses how to improve them. It lists some related bad code smells in the WACT template compiler. It is a non-trivial example of refactoring in an established application and an illustration of OO design issues.
related files:
treebuilder.inc.php
parserstate.inc.php
tagjudge.inc.php
tagdictionary.inc.php
input.tag.php
The TreeBuilder and ComponentParsingState classes may need to [...]

5 Comments | Read the full post »

PHP Coding Standards

September 24th, 2004

I have to disagree with Paul Jones on coding standards:

The thing about defining a coding style standard is that there is no objective means by which to judge one style as “better” or “more-right” than another.

I can think of several objective criteria for judging coding standards practices off the top of my head:

Does the practice [...]

6 Comments | Read the full post »

ajax api-design benchmarks blogging books ezcomponents firefox google input-filtering java javascript language-comparison late-static-binding Mac maintainability mvc mysql object-oriented-programming oop Open Source pdo pear pear-installer performance-optimization PHP php-5 php-architect php-deployment php-frameworks php-scalability php-security phparch programming-language project-management properties refactoring ruby safari security simplicity test-pattern unit-testing Usability wordpress zend-framework
  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (16)
    • Open Source (14)
    • PHP (95)
    • Software Design (28)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • Why is PHP Code Considered Hard to Maintain?  26
      moyaufarus, bez-riska.ru, Visitor338 [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  107
      name, name, Massimo [...]
    • Google Hosting  14
      Managed Hosting, nicholas, Onur Cobanli [...]
    • PHP Development From Java Architects Eye  14
      anal, deniskomarov, erotic [...]
    • Sarah Snow Stever  26
      Massimo, arabcrunch, Dubai Web Design, Development [...]
    • The PHP scalability saga continues  17
      vaginal, uceqlehwigi, panties [...]
    • Keywords and Language Simplicity  9
      Programmer, cfbow, olmse [...]
    • PHP 5.1 is out  8
      Preteen, Soma, teedattaltY [...]
    • goto in PHP  39
      jistanidiot, Goldilocks, [...]
    • WordPress BBCode Plugin  24
      ?????? ??, ?????? ??, smolenskiy [...]
    • Why is PHP Popular?  24
      art.ru, agened.ru, visasim.ru [...]
  • Pages

    • Tags
  • Archives

    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in