No Good Can Come of Bad Code: Ask Dr Web in A List Apart

Remember: the future will come whether you design for it or not. If your company charges $300,000 for a website that won’t work on next week’s most popular device, your company won’t be able to stay competitive in this business. It might not even be able to stay in the business, period. After all, clients who pay for sites that break too soon will look elsewhere next time—leaving your company perpetually hunting for new clients in a downward spiral of narrowing margins and diminishing expectations.

Your company’s survival is tied to the ability of the products it makes to work in situations you haven’t imagined, and on devices that don’t yet exist. This has alwaysbeen the challenge of web design. It’s one A List Apart has taken seriously since we began publishing, and our archives are filled with advice and ideas you can boil down and present to your bosses.

Source: No Good Can Come of Bad Code

Big Web Show № 117: The Real Macaw – Stop Writing Code, Start Drawing It

Macaw, the superhot web design tool of the future

IN BIG WEB SHOW Episode № 117, Tom Giannattasio, Founder/CEO of Macaw, “the superhot web design tool of the future,” joins me to discuss a paradigm shift: can we really draw semantic HTML and succinct CSS? How it works. Pixels, percentages, ems, or rems? Designing a design tool. How to quit your job. From Kickstarter to startup. Team building. Responsive design, responsive community.

Chicago, Chicago

An Event Apart Chicago—a photo set on Flickr. Photos of the city and the conference for people who make websites.

AN EVENT APART Chicago—a photo set on Flickr. Pictures of the city and the conference for people who make websites.

Notes from An Event Apart Chicago 2013—Luke Wroblewski’s note-taking is legendary. Here are his notes on seven of the ten presentations at this year’s An Event Apart Chicago.

#aeachi—conference comments on Twitter.

Chicago (Foursquare)—some of my favorite places in the city.

An Event Apart Chicago—sessions, schedule, and speaker bios for the conference that just ended.

AEA Chicago 2013 on Lanyrd—three days of design, code, and content on the social sharing platform for conferences.


THE NEXT AEA event takes place in Austin and is already sold out (although a few spaces are still available for the full-day workshop on multi-device design).

A handful of seats are available for the final event of the year, An Event Apart San Francisco at the Palace Hotel, December 9–11, 2013. Be there or be square.


In Defense of Descendant Selectors and ID Elements

Except when I occasionally update Designing With Web Standards, I quit writing hands-on, nuts-and-bolts stuff about CSS and HTML years ago. Publishing abhors a vacuum: other designers and developers took my place. For the most part, this has been a good thing—for them and for our industry. The best writers about code have always been those who spend 25 hours of every day up their necks in it, as I used to. While folks like me migrate into strategic or supervisory roles (providing us with new places to innovate and new things to write about), a new generation of code crafters is making new discoveries and sharing new teachings. Ah, the magical circle of life.

But amid the oodles of resulting goodness, I find occasional stinkers. Take the notion, now concretizing into dogma, that id should almost never be used because it has “too much specificity,” and that class names are always preferable. Respectfully, I call bunk.

To my knowledge, this notion comes out of Nicole Sullivan’s brilliant Object Oriented CSS, an approach for writing HTML and CSS that is designed to scale on sites containing thousands of pages, created by dozens of front-end developers over a period of years, generally with no rules or style guide in place (at least no rules or style guide until it is too late). On sites like these—sites like Amazon or Facebook that are hosed from the get-go thanks to too many cooks and no master chef—the use of structural id and descendant selectors can be problematic, especially when inept coders try to overwrite an id-based descendant selector rule by creating ever-more-specific descendant selector rules.

In this particular (and rare) circumstance, where dueling developers have added rule after rule to a huge, shapeless style sheet that is more of an archeological artifact than a reasonable example of modern code, Nicole’s admonition to avoid descendant selectors based on id is probably wise. If you have the misfortune to work on a huge, poorly developed site where you will never have permission to refactor the templates and CSS according to common sense and best practices, you may have to rely on class names and avoid descendant selectors and ids.

But under almost any other circumstance, properly used ids with descendant selectors are preferable because more semantic and lighter in bandwidth.

The way I have always advocated using id, it was simply a predecessor to the new elements in HTML5. In 2000, we wrote div id="footer" because we had no footer element, and we wanted to give structural meaning to content that appeared within that div. Today, depending on the browsers and devices people use to access our site, we may well have the option to use the HTML5 footer element instead. But if we can’t use the HTML5 element, there is nothing wrong with using the id.

As for descendant selectors, in a site not designed by 100 monkeys, it is safe to assume that elements within an id’d div or HTML5 element will be visually styled in ways that are compatible, and that those same elements may be styled differently within a differently id’d div or HTML5 element. For instance, paragraphs or list items within a footer may be styled differently than paragraphs or list items within an aside. Paragraphs within a footer will be styled similarly to one another; the same goes for paragraphs within an aside. This is what id (or HTML5 element) and descendant selectors were made for. Giving every paragraph element in the sidebar a classname is not only a needless waste of bandwidth, it’s also bad form.

Say it with me: There is nothing wrong with id when it is used appropriately (semantically, structurally, sparingly). There is plenty wrong with the notion that class is always preferable to descendant selectors and semantic, structural ids.

Please understand: I’m not disparaging my friend Nicole Sullivan’s Object Oriented CSS as an approach to otherwise unmanageable websites. No more would I disparage a steam shovel for cleaning up a disaster site. I just wouldn’t use it to clean my room.

I’ll be discussing code and all kinds of other things webbish with Chris Coyier and Dave Rupert on the Shoptalk podcast today. Meanwhile, let me know what you think. And don’t forget November 30th is the sixth international celebration of Blue Beanie Day in support of web standards. Wherever you may stand on the great id debate, please stand with me and thousands of others this November 30th.

Build Books With CSS3; Design a Responsive Résumé

“WE ARE ALL PUBLISHERS,” claims Issue No. 353 of A List Apart for people who make websites. Design books with CSS3; craft a responsive web résumé.

Building Books with CSS3

by NELLIE MCKESSON

While historically, it’s been difficult at best to create print-quality PDF books from markup alone, CSS3 now brings us the Paged Media Module, which targets print book formatting. “Paged” media exists as finite pages, like books and magazines, rather than as long scrolling stretches of text, like most websites. With a single CSS stylesheet, publishers can take XHTML source content and turn it into a laid-out, print-ready PDF. You can take your XHTML source, bypass desktop page layout software like Adobe InDesign, and package it as an ePub file. It’s a lightweight and adaptable workflow, which gets you beautiful books faster. Nellie McKesson, eBook Operations Manager at O’Reilly Media, explains how to build books with CSS3.

A Case for Responsive Résumés

by ANDREW HOFFMAN

Grizzled job hunting veterans know too well that a sharp résumé and near-flawless interview may still leave you short of your dream job. Competition is fierce and never wanes. Finding new ways to distinguish yourself in today’s unforgiving economy is vital to a designer/developer’s survival. Happily, web standards whiz and mobile web developer Andrew Hoffman has come up with a dandy differentiator that is just perfect for A List Apart readers. Learn how to author a clean résumé in HTML5/CSS3 that scales well to different viewport sizes, is easy to update and maintain, and will never grow obsolete.


Illustration by Kevin Cornell for A List Apart.

Designing Apps With Web Standards (HTML is the API)

The Web OS is Already Here… Luke Wroblewski, November 8, 2011

Mobile First Responsive Web Design, Brad Frost, June, 2011

320 and up – prevents mobile devices from downloading desktop assets by using a tiny screen’s stylesheet as its starting point. Andy Clarke and Keith Clark.

Gridless, HTML5/CSS3 boilerplate for mobile-first, responsive designs “with beautiful typography”

HTML5 Boilerplate – 3.02, Feb. 19, 2012, Paul Irish ,Divya Manian, Shichuan, Matthias Bynens, Nicholas Gallagher

HTML5 Reset v 2, Tim Murtaugh, Mike Pick, 2011

CSS Reset, Eric Meyer, v 2.0b1, January 2011

Less Framework 4 – an adaptive CSS grid system, Joni Korpi (@lessframework)

Responsive Web Design by Ethan Marcotte, 2011

Adaptive Web Design by Aaron Gustafson, 2011

Web Standards Curriculum – Opera

Getting Started With Sass by David Demaree, 2011, A List Apart

Dive into Responsive Prototyping with Foundation by Jonathan Smiley, A List Apart, 2012

Future-Ready Content Sara Wachter-Boettcher, February 28, 2012, A List Apart

For a Future Friendly Web Brad Frost, March 13, 2012, A List Apart

Orbital Content Cameron Koczon, April 19, 2011, A List Apart

Web standards win, Windows whimpers in 2012, Neil McAllister, InfoWorld, December 29, 2011

Thoughts on Flash – Steve Jobs, April, 2010

Did We Just Win the Web Standards Battle? ppk, July 2006

Web Standards: Wikipedia

The Web Standards Project: FAQ (updated), February 27, 2002

To Hell With Bad Browsers, A List Apart, 2001

The Web Standards Project: FAQ, 1998

The Web Standards Project: Mission, 1998

HTML5 at A List Apart

Mobile at A List Apart

Browsers at A List Apart

Web, Mobile, Responsive, Content | Notes from An Event Apart Seattle Day 1

IF YOU couldn’t be among us for An Event Apart Seattle 2012 Day 1 on Monday, 2 April 2012, these notes by the illustrious Luke Wroblewski will almost make you feel you were there:

Content First – Jeffrey Zeldman

In his opening keynote at An Event Apart in Seattle, WA 2012 Jeffrey Zeldman talked about the need to keep content front and center in websites and the web design process.

Big Type Little Type – Jon Tan

In his Big Type, Little Type talk at An Event Apart in Seattle, WA 2012 Jon Tan talked about important considerations for font setting and selection on the web.

Silo-Busting with Scenarios – Kim Goodwin

In her Silo-Busting with Scenarios talk at An Event Apart in Seattle, WA 2012 Kim Goodwin described the value of using scenarios as a design tool and walked through an example of how to do so.

Five Dangerous Ideas = Scott Berkun

In his Five Dangerous Ideas talk at An Event Apart in Seattle, WA 2012 Scott Berkun outlined truths about how the world works that creatives don’t like to talk about.

Adaptive Web Content – Karen McGrane

In her presentation at An Event Apart in Seattle WA 2012 Karen McGrane discussed the need for structured content on the web.

Rolling Up Our Responsive Sleeves – Ethan Marcotte

In his Rolling Up Our Responsive Sleeves talk at An Event Apart in Seattle, WA 2012 Ethan Marcotte walked through ways to tackle thorny issues in responsive design layouts, media, advertising, and more.


Watch http://www.lukew.com/ff?tag=aeaseattle2012 for notes on Day II, beginning momentarily.

AEA swag thermos (part of the complete 2012 swag set) illustrated by the magnificent Kevin Cornell for An Event Apart.

The Big Web Show #64: Jenn Lukas – You Code, Girl!

Front-end developer Jenn Lukas. Photo by EllisLab.

IN EPISODE No. 64 of The Big Web Show, I interview front-end developer Jenn Lukas about how to tell if you’re a designer or coder; in-house versus product development versus consulting; Girl Develop It, a code teaching activity for budding women web developers; the designer/developer collaboration; tabs or spaces; jumping on the SASS bandwagon; staying sane during #siteweek; maintaining an active roster of side projects; the importance of writing; and loads more.

Jenn is Interactive Development Director for Happy Cog. She was named one of Mashable’s 15 Developer/Hacker Women to Follow on Twitter, and you can find her on Twitter posting development and cat related news. She also writes for The Nerdary and is a monthly columnist for .net Magazine. You can see Jenn speak at a variety of conferences, including SXSW, JSConf (both US and Germany), and Standards.Next. She also supports promoting women in technology by teaching HTML and CSS classes for GirlDevelopIt.

Listen to this week’s episode at 5by5.tv.

Links in This Week’s Episode

Articles by Jenn Lukas

Transitioning Max Height
December 15 2011, The Nerdary
The Gift of Giving
December 15 2011, Cognition
I have a new crush and its name is figcaption
August 11 2011, Cognition
Are Doctypes the New Lunch Tables?
April 14 2011, Cognition
Happy-Libs: We’re All In It Together
April 14 2011, Cognition
Hyphestaria
June 24 2010, The Nerdary

Subscribe to The Big Web Show

The Big Web Show features special guests and topics like web publishing, art direction, content strategy, typography, web technology, and more. Get episodes delivered to you automatically:

Credit

Photo: EllisLab

Getting Started with Sass – A List Apart

CSS’ simplicity has always been one of its most welcome features. But as our sites and apps get bigger and become more complex, and target a wider range of devices and screen sizes, this simplicity—so welcome as we first started to move away from font tags and table-based layouts—has become a liability.

Fortunately, a few years ago developers Hampton Catlin and Nathan Weizenbaum created a new style sheet syntax with features to help make our increasingly complex CSS easier to write and manage—and then used a preprocessor to translate the new smart syntax into the old, dumb CSS that browsers understand.

Learn how Sass (“syntactically awesome style sheets”) can help simplify the creation, updating, and maintenance of powerful sites and apps.

A List Apart: Articles: Getting Started with Sass.


Illustration: Kevin Cornell