October 02, 2009 by Brandon Weiss
Despite the fact that everyone agrees commenting your code is a good idea, it seems like few developers if any actually do it; especially in web development. I can't remember the last time I opened up an app or site and saw regular comments explaining functionality or what some extra complicated snippet of code was doing.
Worse yet, developers pride themselves on making their code as lean as possible, often refactoring multiple times; the less lines the better. Clever code is great, but without comments it's even harder to understand than its syntactically simpler predecessor.
I think what happens is that most developers work in a vacuum. Sure we might go to dev meetups, and talk shop with our friends, but we're most likely freelancers, or the only people at our companies that fit a particular role (front-end developer, back-end developer, etc.). So we figure that since we're the only people working on the site, is it really necessary to take the extra hours to document our code? Who would we be documenting it for, ourselves?
This type of thinking is endemic, and I'm definitely guilty of it myself, but it's so unbelievably shortsighted. The code we are writing is most likely going to be around long after we are not. We'll leave the company, or get fired, or any number of other possible scenarios. And our legacy will be what? A bunch of unnecessarily complicated — possibly bad — logic that someone else has to muscle through to get anything done? Or worse, has to rewrite completely?
I want someone to look at the work I've done and smile, not wince. I don't want my legacy to be frustration and discontent. So I'm going to start commenting everything that needs it, right now. You should too.
July 09, 2009 by Keith Norman
This technique was contributed by one of our campers at Camp Firebelly, Sarah Keane. Here's how it works:
Apply a font-size of 62.5% to the body tag:
body {
font-size: 62.5%;
}
This sets the base font size to 10px, which makes it super easy to figure out how many em's to set for your other font sizes. They will just be taken from a base 10. So 1em is 10px and so forth. For instance, if you wanted to set p tags to 12px:
p {
font-size: 1.2em;
}
Or set your h2 tags to 16px:
h2 {
font-size: 1.6em;
}
Thanks Sarah for the awesome tip!
Also, just an aside for the non-believers that set their font sizes in pixels because it's easier: you are doing a disservice to any of your IE users who want to increase or decrease their browser font size settings. IE does not increase/decrease font sizes that aren't set with a relative sizing (either % or em). This is a major accessibility issue that you should really take the time to fix. Think about it.
recent comments
categories
- Accessibility (2)
- Advertising (6)
- Book Review (5)
- Business (14)
- Camp (4)
- Community (32)
- Design (43)
- Development (26)
- Environmental (17)
- Exhbition (4)
- Fashion (2)
- Film Review (4)
- Film + Video (8)
- Food (1)
- Fun (4)
- Games (3)
- Geocoding (2)
- Health (5)
- Icon Design (1)
- Illustration (2)
- Life (14)
- Motion (7)
- Music (2)
- Philanthropy (16)
- Photography (2)
- Resources (21)
- Shopping (5)
- Socio-Political (32)
- Technology (14)
- Tutorials (10)
- Typography (11)
- Volunteer (4)
- Web Design (18)
archives
- June 2010 (1)
- March 2010 (1)
- February 2010 (1)
- January 2010 (2)
- November 2009 (9)
- October 2009 (14)
- September 2009 (7)
- August 2009 (9)
- July 2009 (11)
- June 2009 (7)
- May 2009 (10)
- April 2009 (9)
- March 2009 (16)
- February 2009 (15)
- January 2009 (14)
- December 2008 (9)
- November 2008 (17)
- October 2008 (11)
- September 2008 (1)
- August 2008 (9)
Twitter feed is temporarily down!


























