Putting the final touches on the exam project me and PA have been doing I had my colleague James look over our jade markup. “What do you think, pretty?” He had been using the serenade.js template language also inspired by HAML (and Jade), last summer I was in on that project and I had a hard time wrap my head around it but I really like it now. “Have you added any shims?” He asked. “What is a shim?” I asked back.
Let’s find out!
The dictionary explanation of a shim is:
A thin, often tapered piece of material, such as wood, stone, or metal, used to fill gaps, make something level, or adjust something to fit properly.
And what does this have to do with programming? Well, shims are application workarounds that help fit when there are compatibility issues. It’small library makes an older part of an application (that has to be kept and can’t be redone) work with the new additions/changes. Think of it as a compatibility layer. The shim James was referring to was one for HTML5, more specific the HTML5Shiv, which enables styling of HTML5 elements in IE explorer versions sub 9.
<!–[if lt IE 9]>
//[if lt IE 9]>
So the shim was added to the project, and I learned something new. They really do have a name for everything, and a library for everything, a fix for everything. Except the iPhone viewport scale bug. But that is a whole other story.