Archive for the 'Development' Category

The Best PHP Framework to Learn

Tuesday, October 2nd, 2007

I recommend Zend Framework to the career PHP developer.

I know that there’s going to be a firestorm of disagreement or agreement if this post get’s any exposure but I am going to post it anyway. Many would shun me for naming a “best framework” for anything. From a career viewpoint, I have my reasons.

FrameworkPHP frameworks are everywhere. CakePHP, CodeIgniter, and symfony are just some samples of frameworks that have already sprouted and taken root. I’m not going to delve into the specifics of what each can do and what advantages one has over the other. There are numerous other sources that can provide better side-by-side comparisons and even benchmarks of all of the existing frameworks for PHP. I am going to make a recommendation from a career standpoint.

There are a huge number of PHP developers who are entirely independent and have no intentions or desire to get a desk job in a large corporation programming PHP and for that group of developers, feel free to totally ignore this post as it won’t make any sense from your perspective. For the rest of you who are, like me, developing PHP as a career, I will share my findings when it comes to frameworks. Regardless of which framework contains the most bells and whistles and shaves a few lines off your application, if you’re going to spend the time to learn a framework and become an expert, it had better benefit your career as well. It is with that reasoning that I make a framework recommendation.

Zend Framework LogoIn the present snapshot of the IT industry, PHP is steadily climbing as a legitimate candidate for larger IT shops. The quantity of PHP jobs increased substantially in just the past year. With certainty, developers who want to get the best of these jobs will need to keep pace with the industry and learn new skillets before they are requested within job postings. I cautiously approached issue of frameworks because I was not sure how the situation would unfold. With the completion of the Zend Framework, I feel it’s likely that this is a skill that will grant it’s early adopters an edge in the market.

Until recently, corporate PHP use has been generally limited to smaller projects, smaller companies, and smaller applications. As PHP use grows in larger projects and larger teams, the need for a framework because greater. So the simple question is: which framework will the industry adopt? While I can’t predict the future, I feel that the Zend Framework is by far the most likely choice from a corporate perspective. Companies will likely choose ZF because it is made by Zend, it has a large support community, it is likely better tested, and because Zend isn’t likely to go anywhere soon. This doesn’t mean that there won’t be groups using other frameworks on occasion, but I am predicting the choice of larger, establish companies as a general trend.

Zend Framework LogoAnother huge plus for Zend Framework is the specialties it contains with web services. Web services will undoubtedly be a firm part of the corporate future and ZF’s support for web services will only add to the case. This combined with the other basic reasons will surely make ZF the candidate of choice.

All that aside, ZF is pretty cool. It’s got a tremendous feature set, has a great syntax, and should improve the performance of any PHP dev team. Just as frameworks such as struts and tiles are prevalent in the J2EE world, the same trend will take hold as PHP becomes more acceptable to the larger groups. I recommend getting started with Zend Framework as I already have. If you start gaining experience with it now, you’ll be a step ahead of your competition when it really counts in the future.

A Little Hypertext with Your Markup?

Friday, August 24th, 2007

I have worked on countless projects over my career with varying levels of code quality. One thing that always causes me grief is overdone code. By that I mean cases where a simple solution is all that is required but some overzealous developer adds five nested tables with nine out of ten cells being empty, uses span tags everywhere, chaotic sceneand lets not forget, inline styles on everything. I’m all for fast results but I don’t think the “as long as it looks OK, go with it” rule applies in this case.

Not only does this add unnecessary size to the project and makes changes ten times harder, it also hurts SEO scores as well. No, I’m not saying that your friendly neighborhood GoogleBot is easily confused, but it does effectively dilute the weight of your text. In most cases, the “stuff” that you want bots to use to rank your site is the raw text. Yes, I understand that formatting this text is important by using h1 tags, font sizes, etc but there is also a visible-to-hidden content ratio that most bots consider. If you have 4 lines of text to display, 400 lines of formatting will cause that text to have less weight and relavancy than using 40 lines of formatting.

Proper use of CSS can greatly reduce the amount of markup on each page. However, everything can be used to much so I try to practice a less is more approach. confusing codeIf you can achieve the same result without an image, whats the point in using and image? I am not at all against the proper use of tables but if you can achieve the same result without them, then take the simpler approach. The point is to achieve the result that you want in the most efficient and to-the-point way possible. Not only is this good, clean coding, its also a solid approach to web 2.0.

Another point I can’t stress enough is adherence to W3 standards. I’ve dealt with people who have no regard for any type of web standards and not only was editing their work a headache, it was also a huge roadblock to SEO. cood codeThere might be other opinions on this out there but I can tell you that working side by side with very similar projects, one with terrible W3 standards and the other with perfect conformity. The latter appeared at the top of many of our targeted searches, gained PageRank twice as fast, and was indexed faster than the other. The project with poor conformity also stalled at a specific PageRank even though it now has twice the traffic and ten times the inbound links than the other project. I imagine its still there with the same PageRank.

“But what coding standard should I choose? HTML 4.01, xHTML?”

My experience has been that even though its painful to convert larger projects, xHTML 1.0 Strict has worked extremely well for me. If you are dealing with a great deal of legacy code, xHTML 1.0 Transitional might make your life a little easier. While Adhering to any standard is better than nothing, xHTML is basically well-formed HTML and its going to become necessary at some point to make the switch so why not start now.

Everyone loves WordPress and its tendency to get eaten up by search engines. Most of the advice I have in this post is put into practice by WordPress. Its not definitive proof that I know what I’m talking about but I think most of you would agree it all makes sense. I know this isn’t news to a lot of you that have been doing this for a while now but I am amazed to see the amount of disregard for coding standards out there. A syntax error wouldn’t slide in a conventional application so why does it happen so much with ML?

Close
E-mail It