PHP
::
July 14, 2006 at 12:23 am
· Filed under PHP
I don't like to just link to stuff, but outsourcing choice at 37 signals is worth linking to. The post talks about designing interfaces with fewer choices. Really, the interesting thing here is Barry Schwartz and his book, The paradox of Choice. The paradox of choice being that having more choices makes you unhappy. Well, there is more to it than that. The New Yorker has a good summary of the book.
I watched a bunch of google tech talk presentations a few months ago. By far the best presentation was Barry Schwartz explaining The paradox of Choice. This video is worth watching.
I think these are important ideas in the quest for extreme simplicity.
Permalink
July 5, 2006 at 4:21 pm
· Filed under PHP
Astonishing. I'm quite surprised. I thought PHPUnit was fairly well integrated into PEAR (pear run-tests). I'm not sure if this is a fork, or if PEAR will continue to use PHPUnit as an external dependency?
I've never been a PEAR fan. My experiences being peripherally involved with the XML_HTMLSax package weren't encouraging. However, my opinion of PEAR has turned around in recent years thanks to work such as channels in the pear installer and MDB2.
I hope this doesn't end up a fork. I see little sense in that. I'll be interested in seeing the PEAR response.
Permalink
June 26, 2006 at 11:17 pm
· Filed under PHP
The June issue of PHP Architect is out. My column this month is on dependency injection, a topic which I've been warming up to lately.
First there was CORBA. Then insane complexity of CORBA was supplanted by the intolerable complexity of EJB. Influenced by an agile mindset and the power of Unit testing, a group of java programmers began to construct simpler alternatives to EJB. Thus, the inversion of control frameworks were born. Martin Fowler came along, clarified and renamed the pattern dependency injection. This activity has originated in the Java world, but the pattern applies in PHP as well.
It is heartening to see an industry solve a problem over the course of a decade, moving from complex vendor driven middle-ware to simple patterns. The thing I like most about DI is how dead simple it really is.
Fowler's article is a must read on the topic. However, I have two problems with most of the introductions to dependency injection. One is the use of irrelevant girl kisses boy style examples. The other is the over-emphasis on the container. The whole point of dependency injection is to move away from invasive component architectures, such as EJB. From my point of view, it is far more interesting to explore what impact dependency injection has on your design than what features your container has.
With that in mind, I tried to write an introduction to dependency injection that avoiding talking about DI containers and that tried to use real, relevant examples. For an example, I started with a typical, run of the mill dependency, torn from a popular PHP library that shall remain nameless, but easy to guess. Then I build on that with a plug-able backend in a common PHP style and then again using dependency injection.
For me dependency injection is relatively new territory, but one that I feel is an important technique. I'd like to see this technique become more widespread in PHP, especially in the current crop of frameworks.
I have a significant bias, but I think you should read the article. I hope you find it useful.
Permalink
May 10, 2006 at 9:47 pm
· Filed under PHP
There is a new google toy as of today: Google Trends. So of course, I wanted to see how PHP is faring on the trendy landscape. Here is a comparison of PHP, Java, C#, and Perl:

PHP???Java???C#???Perl
PHP seems to be holding steady, or slightly declining. But, Java is waning, as I discussed in Why isn't PHP the natural successor to Java?. C# seems to be steady and slightly increasing, while Perl is steady and slightly decreasing. So where are those Java programmers going if not PHP? Are they going to Ruby and Ruby on Rails?

Java???Ruby???Ruby on Rails
It looks like Ruby and Ruby on Rails are tiny fish in Java's pond. Perhaps those Java developers are going to C# or one of Microsoft's unsearchable variants. It would be interesting to see the MSN search trends. However, there is one area where Ruby on Rails seems to be doing well:

Struts???Ruby on Rails???framework
It used to be that most of the PHP frameworks were cloning Struts. Now they clone Rails. There is an increasing interest in frameworks.
There are countries where PHP is more popular. Here is the PHP vs. Java chart for the Netherlands. Right at the end, PHP beats out Java. Search, Derick. Search.

PHP???Java
One last Trend. What is trendier that Ajax these days? Certainly not JavaScript.

Javascript???AJAX
Notice how Javascript searches are declining while Ajax is ascending. Strangely I would have thought that the interest in AJAX would have created an increase in Javascript searches. It doesn't look like the total search volume of the two terms together is increasing that much. Looking at the news volume graph is striking. The AJAX press release machine is in full gear. So is AJAX the thing that everyone is talking about, but nobody is doing? Can you say Web 2.0 bubble?
Please use the AJAX enabled comment form below to tell me how wrong I am.
DISCLAIMER: These graphs and conclusions are for entertainment purposes only. Opinions expressed should not be construed as trendy advice. The particulars of any person's concerns and circumstances should be discussed with a qualified trend spotting practitioner prior to making any decisions.
Permalink
April 6, 2006 at 1:57 pm
· Filed under PHP
Earlier this morning, I ran across the Heroes of might and magic online mini-game (via digg). The game is written in PHP and uses the prototype and scriptaculous java script libraries. The interface is very drag and drop oriented and it uses Ajax to update game status. The graphics are very good. No flash as far as I can tell.
Their server is getting crushed right now, intermittently not responding and running out of MySQL connections. The javascript crashed my browser a couple times. Still, I was intrigued by the combination of Ajax and PHP and I liked the interface. Definitely one to bookmark for later. (I'd like to track down that crasher when I get more time.)
What is the state of Ajax games? of PHP games? Are there other PHP/Ajax games that I should bookmark?
Permalink
March 29, 2006 at 10:16 pm
· Filed under PHP
Ok, maybe I watch too much reality TV, but I'd like to see a show called "The Coding Apprentice."
Starting with 18 candidates, each week, they are randomly divided into teams of 2, 3, or 4 (perhaps solo on odd weeks). Then a charity is selected with a need for an application. Each team is given a week to create a solution. The charity reviews the solutions and picks the application they like best. Then, the teams that weren't picked go back to "the conference room" and make a presentation to Steve Jobs about the merits of their solution and the problems with the other teams solutions. Then Steve fires one candidate. At the end, the winner is given funding to start a software company and can hire some of the candidates that weren't chosen.
What reality TV show would you like to see "Geekified?"
Permalink
March 21, 2006 at 6:34 pm
· Filed under PHP
The March issue of php|architect came out yesterday. I'm excited to see this issue finally out. I've taken over writing the monthly Test Pattern column from Marcus Baker and this issue contains my first column.
Writing doesn't come easy to me. Writing this blog for the past two years has helped me improve. However, I have to admit that I was quite worried just before the column was due. I just re-read it for the first time since turning it in and I am happy with the result. This is due in no small part to some great advise and encouragement from Marcus.
This month's column takes on the topic of organizing code. I wanted to convey some of the fundamental principles underlying the object oriented paradigm, but in a way that goes beyond objects. In the mid 90's, I had what I consider a major professional epiphany when I finally understood object oriented programming. This month's column is my best attempt to concisely explain the heart of that epiphany.
I'm proud of this month's column. I hope you'll check it out.
Chris Shiflett has some thoughts about the security corner column in the same issue.
Permalink
March 11, 2006 at 10:07 am
· Filed under PHP
James Gosling, the "father of Java," recently commented on PHP:
"PHP and Ruby are perfectly fine systems," he continued, "but they are scripting languages and get their power through specialization: they just generate web pages. But none of them attempt any serious breadth in the application domain and they both have really serious scaling and performance problems."
...
PHP (for example) is able to make things simpler because it's 100% aimed at web pages, Gosling explained. Whereas with Java, he said, "We have a balancing act: we need the simplicity but we also need power."
The headline here should be "Father of Java says writing web applications in PHP is simpler." This is pretty much what I said in my Comparing PHP with other languages post:
Why is Java considered so complicated? One reason is that it is designed to run on everything from servers to cell phones, from desktops to dishwashers. It's scope is impossibly general. Of course, specialized tools such as Rails and PHP are more productive for their sweet spot applications.
Both .NET and Java have this be all things to everyone mentality. If you need that generalization, fine, but generalization is not without cost as Gosling points out.
He called Simplicity and Power "evil twin brothers" - "Building systems that have a lot of power just attract complexity. Because of the way that the world has become so interconnected it helps to have systems where it carries over from one domain to another. You can do web presnentation stuff really well in PHP but you couldn't write a library that does, say, interplanetary navigation.
So, if you are writing software for interplanetary navigations, by all means, choose Java. If you just want to write really good web applications quickly, choose PHP.
Regarding the scalability and performance characterization. I'm so tired of that. PHP performs and scales just fine for many people. Flickr makes an interesting case study of PHP scaling:
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML

Love him or hate him,
John C. Dvorak has written an article concerning the topic of this blog. John is bugged by CSS. The idea is great, it just falls apart in practice noting how Firefox displays CSS differently from Internet Explorer, which displays it differently from Opera he says.
"Everyone loses here, from users who can't under?stand why things look screwy, to developers who can't get CSS to do the job right, to baffled content providers.And what's being done about it? Nothing! Another fine mess from the standards bodies."
If we could get atleast two of the popular browsers on the same page, than we would be set. Imagine if IE and Firefox rendered code the same way. Every other browser would be forced to follow or die a slow and miserable death.
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML
While we're
on the subject of new browsers...
- Firefox 2 beta 1 is now available as a developer preview, for testing purposes only. (I guess that's a little redundant, isn't it?) Its features include: support for Javacsript 1.7; inline spell checking in text boxes; and the ability to reopen accidentally-closed tabs (I definitely need that one, with my command-W-happy fingers).
- Opera 9 has been released, with a lot of cool new features. To name just a few, it boasts built-in BitTorrent, thumbnail site preview, and one-click ad blocking. And there's more, so much more!
- All the cool kids are talking about Flock, with its built-in blog integration and photobar. If that doesn't have "Web 2.0" written all over it, I don't know what does.
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML

Check out this Slashdot
interview with H?kon Wium Lie, the originator of the CSS idea. (Can you believe it's been over
10 years since CSS was proposed? Time flies when you're coding with tables!) Lie currently serves as CTO of Opera Software.
In the interview, Lie suggests that before releasing IE 7, Microsoft should ensure that the browser passes the Acid2 test and supports TrueType downloadable fonts. He also discusses XML, microformats, Ajax, and (of course) the future of CSS. Read the interview and watch him effortlessly knock down all suggestions that CSS is somehow lacking in capabilities.
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML
Internet Explorer 7 Beta 3 has been announced and is now
available for download. Features include tabbed browsing, RSS integration, multiple search engines via the built-in search box, and more. Sure, these are all features that Firefox, Safari, etc. have had for a quite some time, but as the old saying goes, better late than pregnant. There are no new CSS features, however; Microsoft has stayed true to their promise that, for better or for worse, as of this March IE 7 was "layout complete."
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML

In his article "
HTML's a Tag Too," Bryan Veloso discusses the benefits of applying styles to the
element. He argues that by making more effective use of
, developers could eliminate the need for a wrapper div. Everything would effectively be "moved up" a level - apply global styles to
instead of
, and then
can serve the same purpose as the wrapper div would have. Bryan points out that this can be particularly handy in XHTML 1.1, in which the
no longer stretches the entire length of the page.
It's a neat idea, but for many developers - particularly those of us who work on large, enterprise-level sites - it is simply impractical. On large sites, rarely would you want to declare a global background image, for example. Or, you may not be able to access certain elements of a page at all, due to CMS limitations or other restrictions. However, for a small-scale site, styling
could be a good way to reduce divitis, as long as you're mindful of scalability issues.
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink
December 31, 1969 at 6:00 pm
· Filed under .NET, DHTML/CSS, Lotus Notes/Domino, PHP, Photoshop, SEO, XML
WebdesignFromScratch.com recently gave sunhome.biz a slick re-design and they documented there thoughts and motivations so everyone can learn. The
original design was drab with a large white space in the middle of the page. Also, the original design doesn't consider the needs of its target audience, senior citizens. The
new design is much easier to follow and more pleasing to the eye. Give the article a read to learn the specifics of what they changed and why they did what they did, which is the best way to learn good design.
Read?|?
Permalink?|?
Email this?|?
Linking?Blogs?|?
Comments
Permalink