Trying and failing is better than not trying

So last night I had some delusions of grandeur and my buddy Nick wasn’t around to talk some sense into me.

Here’s the story.

Recently, I have been experimenting and using Compass, a really great CSS framework that comes with a base of excellent default styles and custom styles along with blueprint-css, yui and other CSS framework support.  Anyway, it’s amazing and has great Rails project support.  I decided to try YUI, Yahoo’s CSS framework since Chris Eppstein told me that it had great Flex / Fluid grid support.  This kind of behavior was important since I had tried using Blueprint on a previous project, and even though it does so many things right, it isn’t really that agile since if you change the layout, mainly the width of the web site, you have to go around and change all the class names to reflect the new layout.

What I wanted was a way for me to express blueprint-css span’s in % or em rather than px.  You can sort of do this using Compass and Sass, however, it doesn’t really work since the container div always needs a fixed width.  I wanted to be able to nest grids within grids using % units so that the site would fill the screen.  YUI lets you do this using however I ran into problems when nesting.  Also, YUI uses an obscure class naming system that I really didn’t like.  After trying to make it work for a few hours I began thinking that I could do this much easier and better than Yahoo did.  As it turns out, the guys at Yahoo are very smart since there are so many edge cases that you need to cover.  I scaled down my project and began writing very common CSS layout patterns such as a 50% / 50% grid, 30% / 70%, 70% / 30% etc.  After about 5 hours, I had managed to write it.  It worked, it was awesome and it was almost exactly the same as the YUI classes minus edge case coverage.

So, am I upset that I wasted my time?  No, not all.  I am happy that I tried to do it, even though I came to an existing conclusion.  The act of doing it helped me understand div based grid systems in CSS better and also gave me an appreciation for the edge cases and how common they actually are.  At the same time, I still think I have the seed of an idea, and with a more liberal time frame in mind, I have started working on a fluid CSS framework similar to blueprint-css using Sass.  I will post it, when I have something more substantial than a YUI clone.

Moral of this story.  Just do it!  Don’t like a tool you are using? Try and rewrite it.  Don’t like your editor? Go and write your own.  Don’t like Mac or Windows, try hacking on Linux.  Chances are you will not get as far as you thought, but that’s okay in fact that’s what learning is all about.  Give it a shot, the best thing that could happen is that you will have something really amazing to share, the worst thing is that you will gain an appreciation for the problem you are solving and for the tools and people who help you solve them.  Also, keep in mind that everyone undersells themselves and thinks that the person on the other side of the screen is smarter.  You are smarter than you think you are, so go prove it.  When you do prove it, let me know!

Thank you and take care,