Archive for the ‘Articles’ Category
Over-engineering syndrome and becoming results-oriented
In January, I reflected on year 2009 as it pertained to my programming career. What had I accomplished?
I thought long and hard about this. I didn’t publish any kick-ass new websites. I didn’t make any major contributions to an open source project. The crowning achievement of my year was a Facebook app that accidentally exploded in popularity when it was really just meant to be a “Hello World!” app to learn the Facebook API.
But this made no sense — I spent more time than I ever had in code over the past 365 days.
Somewhere along the way I lost sight of the goals. I did not become a programmer because I was amused with math, engineering, or manipulating computers. I became a programmer to create things that have a real impact on the world in some way, even if only slightly. When I first started programming, my code was hideous, insecure, and unmaintainable. But they worked. They had an input, and more importantly, they had an output. And that output did something useful. Why did the culmination of my last year of work have so little output?
The past year has been a great learning experience in other ways, of course. I learned Zend Framework inside and out. I built my own true MVC stack from scratch for learning purposes. I spent tons of time understanding different domain model implementations and formal ORM libraries. And now it’s time to put that knowledge to use. I’m switching gears back to being a results-oriented developer.
This made me realize why developer managers push deadlines so hard. Ship your code. Perfect code is not perfect unless it’s shipped.
Understanding design trade-offs and cutting features is a skill, not an option.
Resources for Zend Framework
One of the most challenging aspects of the Zend Framework is that while there is a large volume of resources available for Zend Framework, sifting through this to get answers to specific problems can be tough. This is partially the fault of the nature of the framework — a very uncoupled library means there is a lot of ways to implement it, many of them undocumented.
If you dig deep enough, though, you’ll find that someone out there has probably tried to do whatever it is you are trying to accomplish — or at least something like it. Here’s my list of the top resources I use to reach solutions for my Zend Framework problems.
- The Reference Guide – Duh, right? It’s #1 on my list, and it should be #1 on yours. If it isn’t, are you sure you’re reading it fully? I can’t tell you how many newbies I’ve talked to that simply have not read the appropriate reference guide section on the functionality they are asking about. It’s not perfect and it has some holes, but it is by far the most definitive resource.
- EDIT: As the much respected Matthew Weier O`Phinney points out in the comments, I’ve forgotten one of the best resources out there: The mailing lists. Take your pick or just sign-up to fw-general@. You may even end up with a reply from the author of the component you’re dealing with.
- Stack Overflow – Stack Overflow is a Q&A site full of knowledgeable developers. My favorite part about Stack Overflow is developers that otherwise have no concrete online identity such as a blog or twitter will respond to posts. There are many knowledgeable “lurkers” who come out of the wood-works and often have clever solutions to problems that I wouldn’t find on Google. Also, there are even some ZF contributors such as Bill Karwin who will personally respond to your questions.
- Surviving the deep end – After I read this, I could barely go back to my Zend apps in progress without completely restarting them from ground up. If MVC was ever unclear to you before reading this, read this now. Especially the section on controllers and models.
- Zend Framework in Action – Although intended for the Zend Framework 1.0 release, the concrete real-world examples it provides for some of the framework’s most core classes ([ccei_php]Zend_Controller[/ccei_php], [ccei_php]Zend_Auth[/ccei_php], [ccei_php]Zend_Acl[/ccei_php], [ccei_php]Zend_Db[/ccei_php]) is still relevant.
- IRC – This outdated protocol still thrives among hardcore developers, and PHP programmers are no exception. Join the #zftalk channel and ask your question. There are usually attentive and experienced users there who have probably ran into the problems you’re facing. Several large ZF contributors also lurk here as well.
- Twitter – I’ll admit, it’s not my cup of tea but it’s been a great resource for others. Ask your question, throw on the #zf hash tag, and cross your fingers.
- Blogs. Although most of the relevant ones will popup in a Google search, there’s a couple I subscribe to regularly (that you can see on my links section to the right). If it’s on my blogroll, it’s because I feel any new post they make will be relevant and insightful. Each one is worth checking out.
- and last but not least… nothing explains the code in more detail than the code itself. One of the most important lessons you can ever learn in programming is nothing teaches you like diving into the code yourself. Although the task can seem daunting at first, it’s often a better solution than an endless Google search or waiting for answer.
Anyways, hope this helps someone. Maybe eventually this site can be added to the list above !
Hacking Geshi syntax highlighter to recognize Zend Framework classes
This is kind of off-topic, but pretty neat. I was able to modify my Geshi WordPress plugin (called CodeColorer) to recognize Zend classes and link to the proper ZF Manual page. Example:
[cc_php]
//Example of automatic Zend_ class linkage!
Zend_Acl Zend_Amf Zend_Application Zend_Auth Zend_Cache
Zend_Captcha Zend_CodeGenerator Zend_Config Zend_Config_Writer Zend_Console_Getopt
Zend_Controller Zend_Currency Zend_Date Zend_Db Zend_Debug
Zend_Dojo Zend_Dom Zend_Exception Zend_Feed Zend_File
Zend_Filter Zend_Form Zend_Gdata Zend_Http Zend_InfoCard
Zend_Json Zend_Layout Zend_Ldap Zend_Loader Zend_Locale
Zend_Log Zend_Mail Zend_Measure Zend_Memory Zend_Mime
Zend_Navigation Zend_OpenId Zend_Paginator Zend_Pdf Zend_ProgressBar
Zend_Queue Zend_Reflection Zend_Registry Zend_Rest Zend_Search_Lucene
Zend_Server Zend_Service Zend_Session Zend_Soap Zend_Tag
Zend_Test Zend_Text Zend_TimeSync Zend_Tool_Framework Zend_Tool_Project
Zend_Translate Zend_Uri Zend_Validate Zend_Version Zend_View
Zend_Wildfire Zend_XmlRpc ZendX_Console_Process_Unix ZendX_JQuery
[/cc_php]
It wasn’t too tough to do either. Replace your Geshi library with this one or, if you want to use the same WordPress plugin as I’m using, download the entire CodeColorer plugin and extract to your WordPress plugins directory.
Note: I probably have not added all Zend class documentation links – I didn’t recurse through the whole ZF library and add every class because most actually don’t have a dedicated manual section. In most cases I only added the main parent class. I’ll try to keep this as updated as possible with new ZF releases.
Last file update: January 5th, 2010
Download CodeColorer WordPress plugin
Download only Geshi library