sometimes a little documentation goes a long way..

take for example this snippet.

$c = new Criteria();
$c->addAscendingOrderByColumn(SomePeer::SOME_ID);

$pager = new sfPropelPager('SomeRelationTable', 25);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;

this is pretty standard symfony stuff for using the propel pager to do results pagination for you. which, i should say is pretty effin sexy. serious. Kim Bassinger 1983 sexy. It handles all the pesky work of grabbing a page of results and gives you usable variables for page numbers and so on, so you can do google-style pagination. dig? sweet.

this example is modelled off of some stuff right out of the symfony askeet project, more or less, which is one of the resources i used to learn.

witness this.




53 db requests! fifty three!

This is a many to many table or relational table, used to store relationships multiple relationships between two other tables. so it's going to have a lot of look ups. Keep in mind this table which currently holds thousands of results is only paginating 25. that would make something like 2000 db requests if not for the pagination.

fear not toy soldier. fear not. a little documentation goes a long way. see the revised code.

$c = new Criteria();
$c->addAscendingOrderByColumn(SomePeer::SOME_ID);

$pager = new sfPropelPager('SomeRelationTable', 25);
$pager->setPeerMethod('doSelectJoinAll');
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;

note the bolded line. It tells the pager which of the myriad of possible db type calls to make. It makes joins on the related tables instead of doing db heavy lookups.

now witness.

three requests. Actually a longer time to process but only three requests. thats a savings of 50 requests. or, to be more succinct it saves 25 lookups for table 1, 25 for table 2.

for one line of code.

documentation. it's your friend kids.


zooomr is generating a lot of talk lately. they had some issues with their last rollout and shelly ripped them a new asshole. I like it when people call bullshit. I like it when we talk like real people and don't hide behind corporate-speak so i got a kick out of her post. As a developer myself I can imagine how the zooomr crew might feel after going through some big issues and then getting smacked around, too.

I finally signed up for zooomr the other day to see what all the fuss was about. Being labelled a flickr killer by some piqued my curiosity.

I was... underwhelmed.

I have a lot of problems with flickr. Some of their design choices just haven't scaled--ever added a photo to groups when you have like 100 groups? god!--and they really pissed me off when they didn't bother to help me protect my images from being reposted in another flickr stream. I also just can't get over the fact that what is technically trivial remains a constant sore for people with hundreds of images; Sets of sets.

So I'm ripe to leave flickr at some point if someone can offer me (as a photographer) more. I want it to be faster to upload and group images. I want to have more control over how my images are seen and I want to feel like they take my images reproduction with even a itty bitty bit of seriousness. I have other issues too, but the point is i could be converted pretty easily and along with me I may bring a number of my photographer friends and a sizable number of fans of my work. I'm not a flickr 'A' lister, mostly because i have no breasts, but I am a pretty healthy 'B' lister.

With nearly two thousand flickr users watching my stream (as contacts) and some of my images nearing 10,000 views I do okay. If i go and tell people where I'm going--I'm going to bring some of those people with me.

but I won't be going to zooomr. not any time soon at least and it doesn't have a single thing to do with any of shelly's commentary. It doesn't have anything to do with over-hyping or downtime or any of that. It comes down to a simple issue of failing to deliver on the "sharing" part of photo-sharing.

Near as I can tell there is no group functionality, nor even contact or friend list functionality. What there is, though, is a whole bunch of geo-tagging crap I don't care about. There is a LOT of crap that I don't care about.

Am I supposed to care that an image was taken in 'dead man's flats' and I can see it on a google map? really? I'm really supposed to care? forgetaboutit. I'm sure the nature photographers are having an orgiastic wet dream over that functionality--if they actually get that passionate about anything not a picturesque lake--but 90% of my images take place in my house.

If zooomr refocused itself as what it really is a portfolio site with geo-tagging which makes it an ideal fit for travellers and nature freaks with D70's I think they could carve a nice loyal user base out of nowhere. As it is, trying to go for the general market, with a hodge-podge of unlrelated tools I think they risk missing the boat entirely.

There feels to be no cohesion and no clear market that interests them but i get the distinct feeling from using it that myself and users like myself have no home there.

I take pictures to get them looked at. Community sites bring the people and the orgainization to allow me to focus on photography rather than promotion and i've done well by it on flickr. By neglecting this zooomr fails to attract the types of photographers that will draw the "rest" of the crowd into their fold and at some point will be forced to either specialize or collapse.

I guess for now I stick with flickr.










Today after a long meeting with a client, where I made a case for using symfony and won, i got a phone call from the client who was concerned if something happened to me in development how would he fill my shoes.

what he was really asking was how many other symfony developers are there out there? While no one can say for sure--and i don't recall what the number of downloads was--I know from the response to on symfony that there are a lot of people using this software. It's only in prebeta and it's had enough interest to warrant my efforts towards it.

I know the symfony team reads this site, off and on, and I would encourage them to help us spread the word by giving us some sort of state of the union page. I know they have the meager developers for hire page, and various other bits, but when i go to sell a client on adopting an open-source framework they want to know numbers and hard facts.

Every client we wow with symfony spreads the word and brings in more developers, more clients and more momentum.

My client has put his faith in me to lead him down the right path, and I will--but lots of other clients have been left holding the bag and need more. It isn't much work for us to give it to them...

Further to that, I'd love to hear from other developers on how we can create a more active and growing visual impact. There are many of you out there hiding in the shadows.. what would it take to get you into the light? How can we identify ourselves as symfony programmers in meaningful ways through our blogs, our websites and our projects?

symfony keeps picking up steam, it's obvious if you're paying attention--but how obvious is it if you aren't?

5 years ago I wrote one of the first blogging applications--we called them applications back then, at least till I released bigblogtool--written in php4. It took me about 6 months to write it. I was learning php as I went and it took much longer than I planned. But, when we got going we built a good base of loyal users who really loved it.

a couple years ago I sold it for a nominal fee to free up my energy for other projects.

then in april it got hacked. then a couple days ago it got hacked again. hacked bad.

and it's currently down. and will remain down till i can rewrite it. But, with my customer projects taking all my time that could be a while so I had an idea. Something I would never consider without symfony (which is why i'm writing about this here).

The idea was born of the symfony challenge. How long would it take to rewrite in symfony? Would it be quick enough that i could not take on new projects and focus on it exclusively?

my guess, my gamble, is yes. But even with that I need to have income while i work on it.

So I decided to let the users decide. I posted a letter to the users offering to rewrite it mostly on my own dime but with user donations to help cover my expenses. My expecation was this would go miserably. User's don't seem to like paying for anything, let alone a rewrite of something they have already paid for.

But, in the first few hours BBT has brougnt in $320US in donations, which is about 20% of the way to the amount i need to focus on this for a 6-8 weeks.

The prospect of writing a widely used, public facing, app in symfony and proving symfony can handle enterprise apps, and complex apps is exciting to me.

I think it would go a long way to establishing the range symfony can handle. I think it would bring some legitmacy to symfony and that means more people involved, which means more growth.

I'm all about symfony.

So, hopefully enough users find it in their hearts to chip in and keep things going. If so there will be much to write about as I write bbt v2 in symfony.

You can keep an eye on what's going on at bigblogtool. or if you think symfony could gain from this possible exposure and want to help us get to the point where this can happen, do so.

i think its a real opportunity to put some steam behind symfony. If you watched how Ruby on Rails grew, it was driven by the apps developed in it.

if you use basecamp, and have access to your own hosting i suggest you take a look at activecollab. it's written in php and is highly functional, though only in alpha.

I installed it in 10 mins and was up and running with a couple projects added. I liked basecamp a lot but never quite felt entirely okay with using a competitor to store my private project data.

if that concerns you too--take a look at it. its free!

if you can't get to the page, email me and I will email you the zip file. they are suffering from the digg effect right now.

oh, and if you're curious what a ridiculous shit storm this is creating.. read this.



according to alexa, ruzz on symfony is making a bit of a dent. Not bad at all.

I've been putting off this blog for a while so I could sort out my own timelines and milestones before letting any public information out. I'm not quite there yet but I want to get some momentum going on this project and the only way to do that is to start talking about it.

I am currently in pre-beta (really the planning stages) of a new community site for symfony developers. The idea springs from this blog, obviously. I want to present a central location for symfony bloggers to write about symfony and an easy way for people to find, follow and learn more about symfony.

the idea is not all that special it just leverages the advantages of symfony to allow us a custom experience for a specific use.

so I am opening up the prebeta sign up page for now. If you sign up you may be invited to become a beta tester and will get updates on the project as they arise (no spam!).

check it out.

http://onsymfony.com

please help spread the word if you can :)



I'm an early adopter, they're early adopters, he's an early adopter--wouldn'tcha like to be an early adopter too?

early adopters are those crazy kids riding roller blades in 1984. Using the web in 95-96. Using blogger in 1999. Using bittorrent for thier tv in 2003. Using delicious in 2004, Digging their ability to eschew traditional news in 2005. and so on. we try out the new shit because we have enough curiosity to offset the hassles of learning new things without worrying if it sticks.

and we help weed out the ones that one stick for those of you who aren't so curious.

but early adopters have their limits too and when they hit them things start to fall apart. I remember well the first bubble and the fevered pace of application releases. I remember everyday having my computer life slightly altered by some new and interesting idea that was easy and mostly painless to learn and take advantage of. I remember near the beginning of the end, there were 100s of the same applications all fighting for marketspace and "eyeballs" by feature bloat.

I remember also that they said this "bubble" was going to be different.

Let me point out that bubbles are important to the cycle of development. They bring in new developers and innovate many ideas which alter the way we use our computers. Proof of this is evident in the very fact you are reading this blog. But there is inevitably a second wave of developers that come in for the high stakes who duplicate existing ideas with new designs and hope to flip quick.

The market then becomes saturated with 100s or, these days, 1000s of the same "type" of applications and it actually hurts growth because both early adopters and late adopters have too many options to decide a winner.

Things usually implode shortly thereafter.

I'm going to say it. The end is nigh.

We can't possibly need another feed reader, photo sharing site, re-implementation of a search interface through an api, social bookmarkng site, social news gathering site, video sharing site or any of the "Social apps" and i think it's time someone asks some questions about whether we need any of them at all.

Myself, I have zero interest in podcasting or making videologs. No one I know has any interest in this stuff and even YouTube is realizing its more about delivering the content than users creating content.

delicious and digg both work exactly like i need them to at this time and myspace is garbage, we all know that. Further, we know that everything that tries to copy myspace with a prettier interface misses the mark because there is no incentive for change for most myspace users. Add video, add podcasts, add whatever you want it's not enough to give up their friendlist and all those hours putting that disgusting corpse bride background on the page.

People say hacking myspace is hard but people do it all the time, they expend the energy to figure how to customize their pages and it has the unintended benefit of cementing, rather than destroying, the relationship between the user and myspace.

anyways, myspace isn't worth my energy to write about. Signup all 6 billion humans and it still won't interest me because in 2006 most people, even the supposedly young-digital ones live the most interesting parts of their lives offline.

So as web 2.0 begins to sway and jerk and heads to it's ineluctable meeting with history I encourage you, fellow developers, to be wise and throw out your ideas for a social ______ website and take some of these breakthroughs in thinking we've had over the past couple years and apply them to non-geek, non-early adopter markets.

Web 2.0 is really only as successful as the things that are born of it's death.

We've learnt a lot, some people have got famous, some have got rich. Now lets cannabilize this thing. Let's take the best ideas we have and take them out into the real world where the rest of the planet lives and spends.

You can see the precursors of this in a few "new" job search engines, real estate sites, and so on. But few is the key word. There are markets that exist in a technology vaccum and those markets could be split wide open by one or two good developers with web 2.0 techniques in hand and a willingness to work in a market thats not quite as sexy as social ____.

Take the geneology market. Literally take it.

Many users out there are still using some dos based tools. Even the best are struggling through outdated, outmoded, poorly planned and delivered windows software. Big software companies won't go near this market because it's not large enough to invest but there are literally tens of thousands of users, possibly more, desperate for better software and generally they are older with money to burn.

how much revenue is being made by 90% of the apps being released at this late stage of the bubble?

Oh, right.. none.

in case you're behind on whats happened so far:

you can dig any of the above stories (or this one if you too!), help a guy out.

I know I'm way way late. I apologize. Even the awesome powers of symfony can't rescue you when you're in over your head as far as I am. Plus, I had to set my oven on fire. I just had to!

>Where were we?
We were at hour 2.5 and we had a working backend (with photo uploads) and a partially working frontend that displayed text content and matched the style already established for the site in the previous incarnation. We had plenty left to do, but 97.5 hours left in which to do it.

>Well, how many hours did you use?
As if I'm going to tell you know so you can stop reading before we cover the interesting bits. sheesh.

>Okay, so what did you accomplish?
You ask all the right questions grasshopper. It's like you're reading my mind.

In the following hours I:

  • built up a login/security for the backend.
    • I opted for just a straight password stored in the app settings file. There is only one user and it just doesn't make sense to me to have a db table for one user. Further, I didn't bother with persistant sessions. It's very rare the users update this site and when they do, looking at past behavior, they tend to do small, quick updates. Knowing this saved time that was spent in the previous version allowing them to add users and control access levels. But, if you've read Getting Real by those 37signals folks you know it makes more sense to write what they need rather than what they might never use. This time savings shouldn't really go to symfony directly, but in part, because it frees up time to think about the merits of what your implementing it makes your implementation tighter. Call it time saved by proxy.
    • The downside to this choice is that their password is linked to me changing it if they forget it or lose it. In some situations this would equal death, in practical reality, objectively looking at user needs and behavior I can tell you it may cost me 5 minutes over the next two years of deployment. These are the choices we need to make on a case by case basis and symfony lets me write for the customer because I know if i have to change something later it's pretty painless.
  • I got the mainpage loading the "featured" image.
    • this is a plus for the user. I have no idea why, maybe because I was over-schedule, but in the previous version I didn't get to letting the user pick the image they wanted for the mainpage. They didn't mind, but it's a small feature that gives them a way of keeping the site feeling fresh and it's one field in the db. This took literally no time to do as it was one call to the db and one line of code to display it.
  • I got the gallery page going with a list of valid, viewable images ordered by sort id
    • this I blew out a couple of extra hours on. Once again I tried to climb the css hill to accomplish the peculiar layout required. And I do mean required, they were very commited to it looking exactly how it does. The issue is it's a three column table with left images aligned to the left, center images centered and right images aligned to the right. Where the rub comes in is the images are all the same height, but varied widths. Using all the css magic I could come up with I inevitably ended up with the center columns not lining up (because the percentages would change from line to line) and sometimes wrapping columns onto the next line. I eventually decided it wasn't worth it to keep working on this problem and instituted the same ugly table solution from the previous version.
  • I created the slideshow/veiw image page.
    • This was simple enough. It's pulling an image from the db and at the same time establishing what the next image will be. Nothing complex there. What was interesting about this step is that some of their images are quite long, and break 800x600 compatibility when placed next to the navigation menus. The solution was to write a small image tools class that grabbed image properties, then decide which css class to decorate the image with at load time based on the width of the image. Regular images go beside the menu, wide images go below it. Simply by declaring a different css class which lays out the image in a different spot. I then took this code back to the mainpage featured image and factored it in, so the same effect happens if they choose a narrow or wide image for the featured image.
    • The basic functionality is view image, click on image for the next image. Get to the last image and by cycled back to the gallery page. Standard enough and I would've loved to add some ajax functionality to make it a bit sexier, but the customer's like how it works and it matches the style and tone they have established.
    • I tried to optimize the loading of images by using an array in the session to see if it would save some time.
    • After playing with various implementations for this I decided it wasn't worth the time savings to have to be concerned about images being out of date, changed, deleted from the backend but still cached in session and the site speed was plenty fast enough with symfony's built-in caching so i moved on.
  • I went over the site from top to bottom looking for security problems.
    • Just standard checks for any risky code, or possible places for sql injection, or unescaped characters, or other hot spots. I found nothing but I code with these issues in mind initially so they tend not to crop up later. It should be noted that symfony's data imlpementation allows you to essentially use a command pattern style call where you are calling by explicit mysql paramaters and limiting calls through doSelectOne which gives you a really solid database level protection from the most common unsafe data techniques. I still recommend escaping unverified data and using common sense, but for those new to web app development they get a quick start, free level of security right out of the box.

>Okay, So how long did all that take?
At the end of the above list I was somewhere around hour 9 or 10. Yes you read that right.

>What's left?
I rolled it out on to the new server. I cleaned up any unwanted files because I have to deploy by ftp and then thoroughly tested the wheaties out of it for any unexpected behaviors. Satisfied everything was as it should be, I emailed the customer that the rebuild was done, advised them to inspect it and play with the backend functionality some and let me know if everything was cool.

>Oooh, a picky customer playing with 10 hours of work--what did they say?

"It looks, and works great Ruzz. Thanks very much for taking the time. I'll have to add new images soon. Hope things are well with you."

>Zero complaints, really?
Really, really. This is the true measure of the effectiveness of this process. Did the customer feel they lost or gained? Did they find fault with the changes? Was I able to successfully rebuild the site from scratch in a new version of the language (php5) and a new framework and satisfy the customers needs in the same or less time? The answer to all of the above is yes. a resounding yes.

>So, what was the total time invested?
The goal was to get the site to exactly the functionality they make use of and possibly improve a few places in 100 hours or less. Total time invested from opening my editor to being done is 11 hours. I'm removing an hour for the time i wasted on css and because I like round numbers and calling it 10 hours. That's a 90 hour time savings. That's a 10x increase in productivity where every hour is worth 10 in non-symfony development.

>Wow, I'm impressed. Is there anything else you want to say about this?
Yes, actually. I want to point out that not only did I save 90 hours but I was able to take code developed here, and apply it to other projects immediately. Further, I learnt more and more about symfony through the process which goes to comfort and understanding which futher accelerates future development. I didn't get any fancy new technology into this release but that's because my life is overloaded and this isn't a paying gig, not because I didn't have time left to do it.

>Anything else?
I just want to say, personally, symfony is to me what Ruby on Rails promised me it would be. I spent a lot of time and effort over the last 4-5 years looking for a solution like symfony. I wrote my own framework which while rewarding had none of the class of symfony. I went to C#/ASP.NET devleopment for a year hoping to find something better, and I spent 6 months in Ruby on Rails-land before discovering symfony.

I recall reading Ruby on Rails creator David Heinemeier Hansson's weblog talking about how RoR has actually made his non programming life better. How it made him feel less flawed, and happier about what he was doing. How it free'd him from the dread all programmer's know about writing crap code, only half understanding things, and feeling less able than your peers. He, in essence, felt RoR was a type of coming home. While I don't care for the syntax or visual style of Ruby, I can say that in my 4-5 year quest I many times asked myself if I Wasn't the problem, rather than the language or framework and upon finding symfony I can see a lot of pent up potential finding a way out. I am actually excited to develop again.

My "developer stress" has declined greatly. You know that feeling of noise or fuzz that washes over your mind when you try to understand something new which is just beyond your ken.. well, the calm i get from developing with symfony has brought that noise down and I'm able to explore new ideas again without dread or fear, to me that's worth more than 90% time. That's everything.

>Can we see the site?
Sure you can. You can go to www.williamanderson.ca and look around. Remember while you're there these aren't my design choices, or even my implementation choices. It's a simplistic site that meets the needs of the user explicitly and in my world that's a success.

>What's next?
What's next is a top secret pre beta symfony app I am working on for fellow symfony devleopers. I don't want to release the details just yet because I'm having trouble keeping my schedules on track and it's better to wait it till things are calmed down some. But, hopefully, soon there will be much more symfony talk on the web. If you have a blog, blog about this. Think it's amazing? crap? bullshit? Exactly what you needed? talk about it. Get the word out there. symfony is competing with a lot of lesser frameworks and it takes people talking about that to help people making choices about what which framework to use.

I'm a bad blogger. I know. I know.

If wishes were lasagna dishes we'd all have coronaries.

I've been staving off this last piece to try to make it fit with a little tidbit of news regarding symfony that I want to share and that's delayed me slightly because there's only so much attention to go around. Fear not, dear loyal readers. I will finish up the last peice and get it on your plate with a nice piece of news to help you wash it down.. and I wll do so..

shortly. ahem.