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!