PHP
PHP Is A Spork, Not A City Destroying Monster
Here's an FJM style breakdown of Carl McDade's well thought out and persuasive article. Haha...no really it's just flamebait crap. That was a joke. There are three more scattered through this post. See if you can find them.
A few years ago a friend of mine tried to convince me to learn ASP.NET because it was much better for my web development career than PHP.
I know this friend. Huge success. He made millions building a site where people could post pics of cats with witty captions. Now he spends his days drinking Mojitos and reading old Dilbert comics - all thanks to the power of .Net and the lifeforce of crazy cat lovers.
His feeling was that ASP.NET a.k.a ".NET professional" is a real profession that requires education and training while PHP only required a text editor. That PHP would never be taken seriously by serious companies.
I interviewed at a Microsoft Certified Serious Company once. Wasn't actually a real interview. They just called me in to make fun of my PHP experience. Then they took my lunch money and threw my backpack in a tree. I told my mom I tripped and dropped it off a bridge. Needless to say I swore of Serious Companies going forward.
Regardless of how many Facebooks and Diggs show up on the web PHP will always only be given the same importance as HTML or JavaScript.
Hands down my favorite sentence of the article. Frankly I agree with him here. PHP should be given the same importance as HTML and JavaScript. Which is to say they should all be considered very important. Obviously he was going in the other direction and even if Facebook gets drunk and hooks up with Digg and they produce a mass of FaceDigg offspring you will never change his mind.
Popularity figures from the fortune 1000's servers show that ASP.NET is the unchallenged leader of the corporate market share. Microsoft ASP.NET sites have grown by 7.9% since 2005, And ASP.NET/ASP still lead Application Server technologies.
Interesting stats. Here's my counter: How many of those Fortune 1000 sites are really just content sites describing the company and what it does and how friggen rad the management team is? When in actuality the company has a ton of other servers running apps built with PHP, Rails, Python, Perl, Java...
"ASP.net: When you really just want to work on content management systems.™"
When I take a look at all the PHP job ads and compare them to ASP.NET job ads there is something that is missing from the ASP.NET announcements. This is "must be able to show previous work." This same line or something similar is one that shows in web designer job ads, PHP, JavaScript, HTML and Flash.
Carl's brain: "Shit, I forget to trash Flash earlier. I'll just sneak it in now. Whew, that was close. Back to stoking those pissy little PHP developers."
This demand is never or seldom seen in ads for ASP.NET web developers. To me this means that employers are taking ASP.NET more seriously than PHP.
Or it means they're sick of looking at CMSs.
Unit testing, design patterns and other tools of software development cannot remove the mental label that has been placed on PHP by businesses. PHP to them is nothing more than a glorified front-end template language.
People once thought the Earth was flat. And that made it true. It wasn't until people starting believing the Earth was round that it actually became round. I'm serious. Until we can get businesses to believe in unit testing, design patters and software development tools for PHP they just won't exist. PHP developers will be stuck using WordPad as their IDE and testing their programs on lab mice.
One of the things that I have been running into of late is having spent the last three years doing only PHP. It was a mistake, one that I will not make again by doing Ruby on Rails or learning any other scripting language that does not require minimal knowledge of computer science disciplines.
Wait. I could have sworn Carl just wrote he was going to start using Ruby on Rails because PHP wasn't popular enough with the Fortune 1000 companies. Clearly I'm mistaken. Let me check that again. Nope. Shit, I'm starting to think Carl might not be the most credible resource. Not 100% sure yet. Call it a gut feeling.
I also don't recommend that anyone that is looking to start a long term career in web programming start with PHP. This is because you will be in competition for work with people that come looking for jobs with a background in Java, .NET and C language.
Now I'm completely confused. Why would Java and .NET developers be competing for PHP work? Haven't we already proven that those language are 10X more widely used and 100x more Serious®? I guess they just want the challenge of coding in a language that only has 3 functions and no support for "if" statements (coming soon in PHP6).
When it comes to development tools Visual Studio stands out from the crowd. It has a reputation that is so well ingrained into IT that mentioning it in an interview or having it on your CV quells many doubts that employers have about your knowledge.
Once I was in an interview and they asked me what program I developed in. I answered "FrontPage" and managed to keep a straight face for about 5 full seconds. Ah, that was fun.
The same is not true of PHP. Zend Studio, Net Beans, and other IDE's like Komodo are not well known outside of the geek sector of IT.
Are people really picking their application stack based on the IDE's available? Really Carl? Really?
If you are good in ASP.NET and have used any of the commercial Microsoft publishing systems like Sharepoint then you will see recruiters eyes light up.
Recruiter's eyes light up if you say once successfully installed AOL and responded to an "A/S?" post in a chat room. We're not exactly talking about a hard group to win over.
The problem with PHP is that there is no commercial PHP content management product that is popular or visible to the general audience of corporate IT workers.
Apparently he's never heard of a little product called WordPress...
While you can mention CMSs like Joomla, Wordpress or Drupal these are only known to a select group of techies and not considered to be comparable to anything on the commercial market on any level.
I will bet you the souls of one hundred hobbits (don't worry I have enough to spare) that if we polled a random group of recruiters, businesspeople, moms, recent outer world arrivals, and black plague victims resurrected from the dead, that WordPress would be far more widely known then Sharepoint and Vignette (a perl product he also mentions.)
The above reasons are why I am dusting off my C++ books and will go through some refreshers. Then later on next month I will be dropping PHP and doing only ASP.NET. Richard if you are reading this you were right and I have learned my lesson.
Hey ASP.NET, don't say we didn't warn you about Carl. In two years when he hits you in the back with a steel chair and tears off his shirt to reveal a J3EE shirt don't come crying to us.
Article on JavaScript Validation
I just stumbled on this smokin' article on PHP Architect's new C7Y site. It's really some of the best PHP writing I've ever seen - even non-programmers will probably enjoy it...uh...alright I wrote. So please check it out.
I'm about 75% done rolling this into a CakePHP helper. And since Cake is going re-focus on jQuery as it's primary JavaScript library there will be no excuse for not using it.
Asset Packer for Non-CakePHP Sites
I almost never post links to other blogs posts, but I thought this was cool.
Leon Chevalier from AcidDrop.com (is this the worst name for a blog designed to showcase one's professional skills or just in the top 5?) has created a PHP class (latest version) that will automatically package and minify all your CSS and JS.
I was playing around with it to see if there was anything extra Leon was doing that my CakePHP Asset Packer wasn't. One thing I found interesting is that the actual cached CSS and JS are stored as PHP files. This is done so that PHP can set the expires headers and gzip the contents. Granted this should/could be done with the actual web server, but many shared hosts don't allow this. Even so I'm not really sure doing this is a great idea, since you're essentially trading process time for network time.
From the comments it seems like people are having success using this with their WordPress sites. It would make sense to roll the whole thing into a plugin.
Keep Your Templates Out Of Webroot
Although this may seem obvious to most developers, if you're using a template system, such as Smarty, there is no reason for the templates to live off of webroot. If for some reason you do need to keep your templates there, remember to add the template extension to apache, so that it treats the files as PHP. Otherwise you risk sending your PHP code directly to the browser.
This is all painfully obvious, right? We'll not to the folks at VerticalResponse. The other day I was attempting to setup an email newsletter, but couldn't get past the login. I was getting (split onto two lines):

So for kicks I tried the url, less everything before htdocs. To my surprise it worked, PHP code displayed exactly as it was typed in.
Curious, I tried some other templates names. I was just making guesses based off the one name I knew.
Granted these are just templates and there really isn't anything too damaging exposed. Although I only spent five minutes doing this.
This concludes "Obvious Tips, That Aren't So Obvious To Some - Part 1". Part 2 begins right about...now: Turn off display_errors on your production system. Yes, I'm still talking to you VerticalResponse.
lib.rario.us - Social Media Cataloging
lib.rario.us is a social networking site focused on the media (CDs, DVDs, games, books) that you own or are interested in. Coincidentally TechCruch recently published an article about sites focused solely on cataloging books. The TechCruch article is mainly about Shelfari, butmentions others in the same space, although they fail to mention lib.rario.us. Social cataloging seems to be an up and coming niche.
lib.rario.us is the brainchild of M. Dave Auayan, who did all the original design, development and marketing. Recently his friend Jim Myhrberg has taken over primary coding duties. Like most of these projects Mr. Auayan started lib.rario.us to fill a personal need.
I started this project mostly because it was something my wife and I wanted, a site we can put up our media collection so friends and family can see what we have and what we like. I wanted to keep the data portable so that users would be able to use their info anywhere, not just lib.rario.us.
lib.rario.us has a great feature which allows a user to export their catalog into an excel spreadsheet. The site also has custom RSS feeds for each user, so you can track your friends without having to constantly visit the site.
I think the biggest issue with social cataloging is getting the information to the site. The thought of entering all my CDs, DVDs and books is quite overwhelming. The lib.rario.us form is simple enough and it uses Amazon's API to ease the process. Also by using Amazon's data the site can normalize the entries making matches easier.
I think this is an area where one site could take a huge lead over the competition. One idea would be to use bar code scanners, such as the CueCat, to make adding items much faster. An even cooler implementation, and one that is probably more likely to gain wider acceptance, would be to use webcams as the bar scanner. Imagine just waving a DVD in front of the camera and having the site automatically add the item. Flash could be used as the interface, since it can access a users local webcam (I'm pretty sure). The image recognition piece would be fairly tricky, but if it was easy then everyone would be doing it.
lib.rario.us is written in PHP and uses MySQL. The site is currently going through a major re-write which will be built using a custom framework. The site had been live for one year now and has grown through word of mouth and social bookmarking sites, such del.icio.us.
Mr. Auayan is currently trying to figure out how to monetize the site so they can grow it even further. In my opinion this type of site doesn't lend itself well to the free/premium model (there is a buzz word for this, but I can remember it at the moment. Freemium? Anyone know?). I think there is too much competition who aren't charging, plus I struggled thinking up a feature set that could be part of a premium package.
The first thing I would do, and this would be pretty simple since the app is already tied into Amazon, would be to add unobtrusive "Want this CD/DVD/Book? Buy it at Amazon" referral links. I don't think users would mind this at all. Upon further review I see they're already doing this. I think the key is tying the ads into the catalog so that they're actually relevant to what the user is looking at. So rather than just sticking up some Google ads, I would become an affiliate at TicketMaster and have concert links for whatever band made the CD.
Another idea for monetization, although this is somewhat controversial, would be selling anonymous data. The type of information being gathered would be useful to companies doing market/trend analysis. If you had a big enough user base I think you could package the data in a way that protects the individual user's privacy, while still providing valuable information to market research firms.
I would like to extend my thanks to Mr. Auayan for sharing his project. He's facing some tough competition, but as a friend of mine always notes: competition just means there is a market for the product. Keep an eye out for lib.rario.us in the next Tech Crunch social cataloging post :)
