Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 
Blog Feed

Archive for January, 2008

PHP: Where’s it at?

Thursday, January 31st, 2008

By “where”, I literally mean “where”. PHP is typically used in server-side scripts, the output of which is served over the internet. As expected. But I’ve just finished writing an article on PHP-CLI, or using PHP on the command line, and we also have an article in the works on desktop applications in PHP.

Given the fantastic resources available for PHP development, and the possibilities for desktop applications, PHP-GTK- and WinBinder-based desktop applications written in PHP could be really powerful. Sure, they’re not terribly efficient, but I suspect in the next few years these applications - especially PHP-GTK, thanks to Glade - will really take off.

Keep your eyes peeled on the DT homepage for an interesting overview of desktop application development in PHP; if you really can’t wait, head to gtk.php.net and amuse yourself with the vast array of UI elements you can draw in just two lines of PHP. Where do you think PHP is headed? Will desktop apps really take off, or are they just a passing craze, like Wiimote-powered media players?

Keep your developers happy

Wednesday, January 30th, 2008

Over the years, I’ve seen quite a few different development environments, and I’ve come to the conclusion that there’s one perfectly simple way to keep software development running smoothly: keep your developers happy. Read on for the how and why of cheerful developers. (more…)

4 PHP Professional Development Paths

Monday, January 28th, 2008

So, you’re an up-and-coming PHP developer, you’re spending a lot of time learning new tricks and you’re always on the bleeding edge when it comes to using technologies in your web applications. What’s next? Here are some of the options available for professional development. (more…)

jQuery: Interaction Design for PHP Developers

Monday, January 28th, 2008

It doesn’t advertise itself as such, but the jQuery JS framework is quite possibly one of the best JS frameworks for PHP developers. Most of the frameworks out there are designed for developers with JavaScript experience, and understandibly so. But when I first started using jQuery, my JavaScript experience was something along the lines of “take the dollar symbol out and your PHP is magically syntactically valid JS”. (Pitiful, I know.)

The main advantage of jQuery for us PHP developers is that it utilises our existing knowledge. When PHP code brings you closer to the HTML and other UI needs - CSS, for instance, - jQuery leverages that knowledge. It takes a little while to get used to functional programming, of course, but with CSS selectors, basic method chaining, and an approach to event handling that just works, jQuery is an ideal framework for PHP developers getting started with JavaScript interaction design.

So, next time you’re looking to get your hands dirty with DOM, DHTML and AJAX, head over to jQuery.com and give it a go.

Web Hosting: Leave it to the Professionals

Monday, January 28th, 2008

Web hosting: the bane of our existence. Time spent preparing servers, publishing code, dealing with deployment issues — as opposed to throwing money at unreliable oversold shared servers. Here’s why you should leave web hosting to the professionals (more…)

GOTO is coming to PHP!

Monday, January 28th, 2008

GOTO, the infamous much-loathed feature of languages in decades gone by, is (sort of) coming to PHP. Read on to see why it’s actually a good thing.
Luckily, it’s not that bad. In fact, it’s quite handy. (more…)

Rails vs. PHP: Fair Comparison?

Sunday, January 27th, 2008

It’s a common point of heated debate between Ruby on Rails and PHP developers - can we really compare Rails with PHP? While most PHP developers would contest it, it’s a perfectly good comparison. Here’s why. (more…)

Choosing a framework

Sunday, January 27th, 2008

When it comes to choosing a framework, PHP developers are very much spoilt for choice. From Rails-alternatives, to .net-in-PHP attempts, beginner-oriented procedurals to full-on enterprise systems, and even those that let you code however you like, there’s bound to be a framework out there for you. Of course, if there isn’t, you can always take an existing one and modify it to suit your needs (although most are sufficiently extensible).

Wikipedia has probably the definitive list of major PHP frameworks, covering everything from CakePHP to Drupal to the Zend Framework, and includes a few notable yet less-known options. Of course, this doesn’t tell you much about them; the comparison table is a little more helpful, although it isn’t restricted to PHP-frameworks.

There are a few important features to look for in frameworks:

  • MVC: the Model-View-Controller design pattern, one of the more popular patterns, and certainly an effective one. Many of the big OO frameworks use this, and it’s good for those new to framework-based development.
  • Templating: a templating engine is pretty much standard, if only through the V in MVC, but make sure it’s there.
  • Caching: save yourself writing your own caching system when you find yourself dugg or slashdotted.
  • Form validation: one of the most common yet most frustrating features of building PHP web application, a framework that simplified form validation is invaluable.
  • Inbuilt CMS: depending on what you’re building, having a CMS ready-built for your framework can be really useful. Drupal and Joomla both come with CMSs.
  • Inbuilt auth: Many frameworks choose not to include authentication, but not having to write your own user authentication system is a fantastic time-saver for basic application development.

Beyond this, take a look at the options out there. If you’re familiar with Rails, take a look at CakePHP and CodeIgniter. If you’re more of a .net person, Prado might interest you. If you’re looking for a CMS that you can code on top of, take a look at Joomla. One website even has a feature-by-feature comparison, although beware of following it entirely, as it doesn’t really reflect the true power of each framework.

Of course, while you may be undecided on your choice of framework, one thing is certain: you should be using a framework, if only one you hacked together in a couple of hours. Most frameworks will help you code quicker and more consistently, code reuse is suddenly the drop-in-place approach it should be, and it’s always handy to be familiar with a dev shop’s adopted CMS when sending them your resume.

8 Cool Functions in the GD2 extension

Sunday, January 27th, 2008

Most PHP developers have at least heard of GD2; thanks to its prolific use in CAPTCHA generation, the image functions in PHP are standard practice for many. But the extension’s uses don’t end there. After the fold, here are eight cool things you probably weren’t aware could be done with GD2, and might be useful for your web applications. (more…)

Before you code…

Sunday, January 27th, 2008

So, you’re about to build an entire web application in PHP. You’ve worked out how you’re going to do it, you’ve got a general idea what it’ll look like, maybe you’ve even chosen a framework (if you don’t have any to choose from, find some). Before you go any further, take a step back and run through this checklist.

  1. Plan. Do some design mockups, work out what functionality will go in what classes. You can never plan enough, and good planning can save you days of code rewriting later.
  2. Research. This is probably one of the most-forgotten areas of project planning. Chances are what you’re building has been done before, so do a bit of research on existing applications similar to yours. Consider any problems you may encounter and see how other applications handled these challenges. SourceForge is a great place to start.
  3. Future proof. Depending on your application, this might not be terribly important, but consider what technologies are being used at the moment and may start being used. This article has a few suggestions. For example, maybe in future you’ll add a microformat-export function, and your code needs to be structured differently to support that?
  4. Don’t reinvent the wheel. Most developers I’ve seen simply don’t practice this enough. Sure, you’re using your framework for some common tasks, but many people assume they’ll need to write a lot of their own code for complex routines. Before you start, check out PEAR and PHP Classes.
  5. Set some timeframes and get into it! Now that you have a good idea of what you’re going to build, and how you’ll make it happen, set some goals and get coding!

Blog Categories Blog Archives
Advertise with Us!



Tutorials Scripts Web Hosting Developer Manuals
Resources