Saturday, February 21, 2009

Each one of us eventually comes across a customer that wants to see a code sample. Who wouldn't really, if you know what you are looking for you should certainly cover your bases somehow. Then for us, we have the requirement of keeping some sort of portfolio of tings we worked on and projects we were involved in. The designers keep little thumbnail screen-shots, and some coders keep snippets of code (more on this later).

I have been in the hiring seat several times myself. I know that when I look at these portfolio's I question the involvement of a person, especially on large scale projects. A member of a team I headed some time ago was said to work for a well known company on what you might think of as well known software. You would assume it was high profile and that it had wide use. It sounded real impressive. However the person showed no signs of being capable of being involved at a high level as was the expectation set. Suffice it to say this is something I have come across quite often. A designer places a portfolio in front of you and says 'I worked on these.' so as to say 'I was responsible for how these look and feel'. A programmer gives you a portfolio and says 'I was responsible for these projects' so as to say 'I built these'. So how is a person to know what is theirs? Because, on a large scale project it is obvious that a single person did not handle it all. So we are forced to accept that the persons values are reflected in that product and that we can expect the same values while they work on our project. The unfortunate part is that we tend to put greater emphasis on these colorful pictures than the black and white truth of references and resume. Then seldomly do employers look past a degree of some sort. Really of what use is a BS in Computer Science when it comes with a 40 year old man if you are an Internet company?

So the rare few that take the time to check the merchandise find us off guard and scrambling for the real thing.

So as a programmer are you supposed to keep code snippets? What many people don't understand is that working in the private sector leaves us without anything to show outside of the companies we already work for. Some would assume that every coder is involved in an OSS project that we can happily place a link to the SVN/GIT repository and say 'Look for my user name codepimp99'. The truth of the matter is that hardcore coders that eat and sleep code, also eat and sleep their job untill it is done.

So what are those of us in the realworld to do?

Build a code example. When that golden opertunity comes along and you find yourself wanting to explain the private sector to a customer, you can simply email them a zipfile. It saves you time educating the world, and makes the customer happy that might just really apreciate you.

Tuesday, February 17, 2009

You Got Your View in My Controller

My number one complaint about every MVC framework I have seen so far: The controller is dependent on or otherwise directly tied to the View. While consistency for the sake of being consistent my be a worthy cause, being loosely coupled is more important. Your view mechanism may not fit every situation. If you have a hard dependency your upgrade path is all or nothing, break everything or break nothing. This becomes the foundation for clever unsupportable code.

A ideal controller would simply handle routing requests and responses and coordinate the use of the proper view with it's model. (@todo) Who cares if you are using Smarty, a __toString() method or hand jamming inline PHP. What if you want to integrate a different model? What if your application develops and you cultivate a better method of MV combination with your business logic? Why nail your feet to the floor for the sake of forcing yourself to be consistent. If you cant be consistent, you should concentrate on that fundamental flaw in your habits and fix it, because you will be constantly tripping over it regardless of what your framework does for ou.

Monday, February 16, 2009

Visual Development Heating Up

So M$ has been dominant in the visual development realm. In the past Borland had a great product but lost market to Visual Studio. Visual Basic 6 pushed M$ over the top and ever since .Net has kept them ahead of the pack. Those wanting to stay deeper in development got under the skin of the Web with PHP, JSP and PSP leaving CGI to the '90s. But, this later camp never gave up. So here we are in '09 (numerologists comments welcome) seeing the pack close in on the nitch. PHP being the highly resilient Web language it is has been targeted by a couple of notable organizations.

The first and most obvious is Adobe's Flex Builder. The move Adobe has taken with Flex is natural. Bring drag-n-drop development (and come-and-go Flash) to the masses by leveraging the Mac loving Deviner/Diseloper community. The easiest way to build such a IDE is to leverage something existing, and open source. Enter Eclipse with it's PHP modules and its attractive IDE framework. It may not be a mistake that Zend has also launched it's own IDE based on Eclipse with the clever marketing name Zend Studio for Eclipse or Zend Studio 6 depending on who you are trying to convince. This has a specific yet large target audience and community that are already using both technologies. It may also be that the Deviner/Diseloper community are also the bulk of those who are weary of moving to PHP 5 and OOP or Frameworks. Regardless, many will find this environment attractive.

The second of note here comes from what once was Borland, if only by name. Delphi for PHP does for PHP what Delphi did for Pascal and Builder did for C++. It was hard to take it seriously when it first appeared, especially with shaky products out there like PHP Builder. So is it a real contender. Only time will tell, but it certainly makes an interesting attempt at creating an environment for solid development. True to the Delphi style, it builds on the solid singular layer of a capable language, resulting in a RAD environment that is predictable and supportable. It is hard to take a product serious when it comes from the same software gene pool as 3rdRail and TurboRuby. But looking under the hood, what CodeGear has created is the way to make your own framework, controls and widgets, usable in a visual development environment. Through the VCL for PHP framework, you have the means to properly bridge the gap between your developers and your designers. Simply create the adapter classes and configuration files needed and you can soon be dragging and dropping your own controls (Javascript included) defining how they appear and act in true RAD fashion. I wonder if it would even be possible to use this environment for Flex development?

Neither of these products are the first of their kind. (Worthy of mention is also the control faculties of Dreamweaver - now Adobe's) But given the amount of PHP developers that wish to stick to what they know while gaining the power of a visual development environment both these products offer a real opportunity. So what do you see in your future? Is there a visual development environment in your web development future? Does there need to be?

The obvious gains are undeniable. What would really make these take off is if there was a completely free version of such tools available to developers. I have only played with each, but if you have used either in depth I would welcom your impressions.
First Impressions of Cake PHP

Cake 1.2.1
So it has been a long time since I revisited Cake PHP. It seem like a reasonable framework with MVC. The Model is reasonably smart. Cut to the point I don't like the pluralization and command-line code generation is so '90s.

Commandline Skeleton in the Closet
It is great to copy other projects, esp. successfull ones like RoR. But lets leave out weaknesses, esp. where your programming language is weak. There is a reason people don't spend all day in some sort of PHP shell instead of bash. How hard is it to integrate class creation into the controller? (@todo) My last project did this with great success. I plan on doing it again in my new frame work also.

Pluralization
What better way to cripple your framework and make translation a nitemare. So maybe it works great, but if I have learned anything from my programmers, it is that people tend to make rules where they dont need them. It makes them feel good, like they are acomplishing somehting by puting borders on what they are doing. In many ways this is a sign of a lack of experience. Cake has been arround for, what, three or four years? I am not saying the team has a lack of experience. It was just an oversight that is imposible to change now. Remember, my code huffing is to learn from good and the bad of others. I was going to implement my site in Cake PHP until I caught them doing a foreach in the template and echoing out a multi-dementional array, *cringe*. So haven't decided if my live site will use it, but maybe I will still do an implementation for record.

Positive
I don't hate Cake, dont get me wrong. I have utmost respect. There is a huge community behind it and it is constantly developing. It is a great way to dive in and get something running fast with relative robustness. More as I think of it...

Wednesday, February 11, 2009

Back to Open Range Development

Yes, sir, I am back to development I can blog about. So here I stand on the cusp of my 5th gen framework. Unfortunately I will have to backtrack to 3rd gen since the 4th gen is jailed IP. So it is time for some heads-up coding. I learned a few things from my team of developers on the last gig, and saw some good and bad things. So what is my platform of choice this time around? Well the .NET community slowly came around to jQuery, so I haven't counted them out entirely. In fact the 3.x+ series seems to be really nice, even though there are some obvious efforts on M$ part to take hostages for their silo. Seriously though I'm not going to abandon my 'right tool for the job' mentality.

In developing my new framework in PHP I will need to take a look around at other frameworks again. Skimming from the cream of the crop in popularity and some old favorites. Sniffing at them to see what gets me high. I will keep track of my adventures in Code Huffing here and share some things I find.

I have been using Zend Framework since it's first public release, so I will start there and look closly under the hood. (@TODO) My impressions from working with it have been mixed, fortunately it is meant to be pieced out for use with other libs/frameworks to it's credit. I would like to say "Zend_Db FAIL!" upfront but I want to be serious and give it a last look before I pass judgment. I have found some parts to my liking. It does have one of the most comprehensive View and Controller class sets out there. Not that I like them, but the ZF team has recently gone back to the PHP philosophy of simplicity so maybe the latest version has improved a bit.

Once I give ZF a tearing apart I will take a look at acouple old friends Cake (@todo) and Symfony.(@todo) My favorite framework of all time Qcodo as wained and supposidly been respun as QCubed.(@todo) I am not in love with the name, even though it offers a cute domain name, but we will take it under the hood and see if it is still viable.

Then we will start our own. So why start my own yet to be named framework? Cause I can and want to. Few have the cross platform/language/framework perspective I have, and I have come to like the basic ideas of certain pieces of my experience. Like ADO.NET for data access for example.(@todo) I might experiment with PHP 5.3 namespacing (@todo) and some other things. I like a much more simplified MVC and a much more dynamic data model that makes business modules easier to manage. (@todo) I like a light controller, light yet flexable data model that leans on the business modules for context apropriate view generation. I like an event driven model, which .NET 2.0 feal significantly short of, despite trying very hard. An event driven model is poor in most of the PHP world too. (@todo) I like the idea of a Deligate and a Restfull style event bus spanning the JS/Server communication. All this and more will make my framework a bit different and highly optimized to of all people: myself.

Stay tuned!


Wednesday, September 13, 2006

JAM for your Web Sandwich

So you have been giving so much Ajax love that you pass more XML than anything else. It is time to lean up your XML usage and get native. What do we call this jungle fever? I personally refer to it as JavaScript Append Method - JAM. You are already using JSON right? Right?? (don't answer just do it) If not, forget all the markup overhead of XML. If you are passing JSON back to the browser, simply JAM your response object on the end of the DOM. Like this:

$.fn.json = function jam( url ) {
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = url;
$('head',document).append( script );
}

Yes that is a jQuery plugin. Even better JAM your JSONP on the end of your DOM.

Is any of this new? No. It is, however, time to revisit the way you are thinking. Ajax was a great buzz word in it's time. Just like the 'Push' of the mid 90's. Reflect if you will on your site, webapp, or Web page. If you have been implementing Ajax, have you spent a lot of time taking advantage of modern JavaScript? Conversely, are you using a snazzy library for doing your Ajax? If the former has been your focus, why not make it your goal to move from XML (a great exchange format for non-web applications) to a more consistent, less verbose approach. Then take your data and just JAM it in a page. If you are using a library. I challenge you to find the fastest library out there. Then look under the hood to see what makes it tick. I bet it is JSON, maybe even JSONP. Heck, I bet it just could be JAM.

This has made my life simpler. In fact I have a nice PQ&J sandwich in the works. I will keep you posted.

Tuesday, July 25, 2006

ZCE: PHP Samurai For Hire



Zend is getting ready to offer what many have been waiting for: PHP5 Certification tests. Why is this so important? Many people who started on, or who were already using PHP5 saw limited need for a test that focused on PHP4. This was in fact the focus of the only existing Zend PHP certification. Since I take PHP seriously I went ahead and got the Certification, and I intend on taking the PHP5 test as well.

I found several things interesting about the new test. (details here) The first thing that struck me was the section on the differences between PHP4 and PHP5. This may frustrate some who are dead set on being PHP5 purists. The fact of the matter is that there are a lot of examples and code snippits on the internet that are written in PHP4. If you are the type of person who is always looking to program the absolute best, you need to know the difference so you can differentiate between versions of code. Also, so you know what the problem is when one of your people snag some code from the Internet and slap it in an application and it doesn't work quite right. Because you wouldn't do that right?

The rest of the test focuses on several obvious items like OOP and Security. These are some much needed test items. This way a person who claims to be a ZCE5 can be assumed to know at least the basics.

At this point I am still wondering if Zend is addressing the largest issue I see surrounding the Zend Certification Exam. That is employer education. I am working toward becoming an MCSD. Two of the reasons is for respect and higher pay. While people who are Zend customers respect the ZCE and offer compensation higher than most. There are all kinds of companies out there using PHP that don't even know that Zend exists, or that there are Zend Certifications. While this is a marketing issue, if Zend wants the ZCE to really be important they need to fly it on the front of every piece of literature and website and bag of peanuts they hand out. "Put your application in the hands of someone who knows, hire a ZCE today!" should be the mantra of the Zend Enterprise. A ZCE already trusts and uses Zend, it would be good business for them to push the ZCE as PHP samurai for hire.

Friday, June 16, 2006

Programmable Web

This is what people in the know call the next step in web evolution. What does this mean for us programmers? Well, it means a simplifying of server function. More accurately put: it means server portions of applications will need to specialize around the data they are concerned with. No more highly customized data for the UI. This is what is lending itself to DFD (Design First Development). While DFD is a logical future step, it may not be the best design tactic for enterprise applications. As Joseph Moore brings out, it doesnt work well for scale.

Still the UI is coming back into the limelight as the driving force behind applications. My latest project is moving forward because of a nifty JS/CSS/HTML only mockup. Because I started there, I know that I can simplify my server code. I don’t want to say that DFD is the way to go, but sometimes it does help to consider it.