jQuery Form Builder 0.4

I need to write an extension application on top of my popular jQuery Form Builder plugin so I finally took the time necessary to perform some long-wanted updates. The xml-based form loading system is finally gone, replaced by a pure JSON solution. There’s a lot more code cleanup, some bug fixes, and now some sample MySQL integration in addition to existing static data loading examples.

The extension layer I’m working on will add functionality for building basic quizzes and scoring them, and hopefully, some MongoDB support. When completed I’ll push that functionality as well. But for now, I need your help in testing the changes in 0.4.

As usual, source code and downloads are on GitHub.

Published by Michael Botsko on 12/15/2011

My Opinion of SASS and LESS for CSS

I’ve been working with CSS for more than a decade and I know all too well the problem areas, primarily in browser support and development difficulties. Tools like Firebug and similar page inspectors have changed how I debug problems but as developers, we’re always seeking the more efficient route.

On paper, the ideas behind Sass and Less seem amazing. Shorten css development by using variables (for colors, etc), reduce the amount of written syntax by calling functions once, that when compiled, produce all necessary vendor prefix equivalents, and so on. By themselves, those were enough to convince me to try it.

I tried Less first, which is mainly different by the fact that it uses javascript to compile the real css. For those unwilling to add another script and process time to the client-side there are server-side solutions as well, and then there’s Sass. Sass has essentially the same features but is compiled on the server by Ruby gems.

However, when I began using these in already-live projects I discovered how painful they are. Here is a quick rundown of everything I’ve discovered about using these technologies versus hand-written CSS.

The Environment

Right out the gate, using Sass was a pain because I had absolutely no development environment for it. I had to install ruby, as well as the gems for compiling it. Firebug needs an additional plugin (and the gems need additional configuration) so that it will point you the Sass file and not the compiled css file. All of my editors/IDEs needed special plugins in order to recognize the syntax (for coloring, etc).

Now this is all install-once-and-you’re-set stuff but it still throws several additional steps into the mix when I move to new machines, etc.

Every day of work I need to ask the compiler to watch the project for changes. When I forget to do this, I get frustrated wondering where my css changes are.

The Nesting Danger

One of the benefits of sass/less is the ability to nest selectors. The sass could look like:

body {
  /* ... styles ... */
  header {
    /* ... styles ... */
    nav {
      /* ... styles ... */
    }
  }
}

When compiled, the selector for nav becomes:

body header nav {  }

The issue is that while attracting you with a nicer layout in the raw css file, it’s compelling you to build unnecessarily complex selectors. Although there are times when you need to specify the hierarchy, it’s not every time. In one project I’ve taken over, almost everything is nested this way.

It’s a performance hit to the browser because every chain becomes longer and requires a more specific application of the styles. The bigger issue is that it becomes an absolute nightmare trying to override styles. When I’m attempting to override a base style for a larger screen size I must repeat the entire selector because CSS requires that specificity.

So I’ve wound up writing selectors that look like the following:

body #main ul li a { float: none }

It creates a lot more hassle about figuring out what the exact selector needs to be, debugging it when it’s not working, and sorting through the clutter this adds.

Commit Spam

When using version control it’s very easy to suddenly see a huge amount of commit spam from the compiled css. You can bypass this by compiling the css on deployment but that’s a bit more effort. If you have development configurations in place, sass will leave a lot of comments in the compiled css referencing the original location of the sass-version. These change with every compile and if you have a thousand-line-long css files, your commit diffs will be absolutely huge, even for a one-line change.

In fact reviewing said commits will be impossible because you can’t figure out what changed in all of that mess. In order to avoid that, you need to be sure that you never commit compiled code with any development/debug info left in.

When you’re working by yourself I see more of a benefit to using these technologies but when you’re working with a team, you’re not the only one who has to do these steps. It becomes the entire team.

Conclusion

I’m ready for you tell me why I’m wrong. But in the end I have to ask if all of this work is really worth not having to write extra vendor prefixes (which we all copy/pasted anyway) and having to refer back to your notes for each rgb/hsl/hex color code? It seems like that’s a lot easier to do to me.

Published by Michael Botsko on 9/27/2011

Web Hosted Bug and Issue Tracking

I’ve never been satisfied with issue tracking software. It essentially boils down to the fact that developers seem to sacrifice a clean design and usable product for features or vice versa – the tools our clients would find usable were never the same tools that the developers and designers could find usable.

This will never be a problem again, thanks to Snowy Evening. Snowy-Evening.com has been in development for almost two years and despite an amazing list of features (all listed on the home page) it has an incredibly clean and very easy to understand design. Our clients have been using it for a year and there are several well known web companies already using it for their projects.

I highly recommend you checkout Snowy Evening – it’s free while it’s in beta.

Published by Michael Botsko on 6/11/2011

Sizing Text to Container with jQuery ExpandText

A frequent problem with text on the web is that there’s no way to automatically adjust the font size based on the dimensions of it’s containing element – at least in a way that changes size when the container does.

Continue reading this post…

Published by Michael Botsko on 5/23/2011

Installing Sphinx Search Server

I’ve always used MySQL fulltext indexes with a match query for keyword searches but I’ve never been happy with the results and lack of configuration choices. The limited nature of word interpretation and the boolean searches were useless when visitors didn’t know how to use search operators. Fulltext indexes require the MyISAM table structure – yet we generally prefer InnoDB because of performance and foreign key constraints.

For a recent project I decided to finally (long overdue, I know) make the the transition to an external search and indexing application called Sphinx.

Continue reading this post…

Published by Michael Botsko on 5/7/2011

Git Push/Pull Alias Functions

I’ve been using Git for just over two years now. It’s one of the few systems left that doesn’t have a graphical user interface I prefer. In the past years, many choices have either been launched or announced but I’m still a command-line only person.

I grew tired of typing the full push/pull commands so I’ve finally spent some time searching for the best bash function on the net… which appears to be http://forrst.com/posts/My_gitstuff_bash_shortcuts_for_working_with_g-BwI

Edit your bash profile and place the “gpush” and “gpull” functions after anything that currently exists. I personally didn’t use the aliases shown in the pasted code sample, as I already use a different set.

vi ~/.bash_profile

When running gpush or gpull they will activate the associated commands on the current branch.

Published by Michael Botsko on 5/7/2011

The Best & The Essential WordPress Plugins

I’ve worked with WordPress for at least six years now – on both personal and client projects. As a company we’ve been focusing on larger custom-built projects in the past few years so staying current in the WP community has been a lot more difficult.

Because of this, I’m transitioning the WordPress courses to a new instructor so that I can focus on my series of web development courses (which are my primary focus anyway). Before I put the materials I’ve developed for the WordPress courses into eternal digital storage I thought it would be best for me to share the list of tips and plugins used or mentioned in any of these courses.

Continue reading this post…

Published by Michael Botsko on 4/30/2011

Sharing a Snippets Library through Dropbox

I’ve been using the Mac application Snippets and it’s been getting better with each new release. One essential feature that’s still missing is any support for syncing a library through a service other than MobileMe. I’ve even contacted them about the issue, as many have.

However, I’ve recently learned that there is a way to share the library using Dropbox – not sync it, but share it. Simply move the library itself. I had considered this option before (since it’s how I use 1Password) but there seemed to be no way to move the Snippets library.

Continue reading this post…

Published by Michael Botsko on 4/30/2011

HTML5 & CSS3 – Wireframing in the final product

I began writing a few web development articles for WebDesignerDepot.com a few months back, and the first of the series has been published this morning. Head on over to read HTML5 & CSS3: Wireframing in the final product. I’ve already turned in the next two articles and I have a few more underway.

Published by Michael Botsko on 4/26/2011

Web Development Course Updates

At the end of the current term, it will be two years since I began teaching evening web development courses for Portland Community College. I’ve taught a wide range of topics including Javascript, jQuery, HTML5, CSS2 & 3, PHP, MySQL, and WordPress. In the past few months I’ve also been involved in planning a new structure and flow of courses for Summer 2011 and beyond.

Continue reading this post…

Published by Michael Botsko on 4/22/2011