The Wonderful World of Bugs

Preview:

DESCRIPTION

The talk I gave on CSS bug hunting during @media 2006

Citation preview

The Wonderful World

of Bugs

1by Andy Budd of Clearleft.com

Hacks

2by Andy Budd of Clearleft.com

How many people feel they use too many hacks?

and how many people feel that use too few?

3by Andy Budd of Clearleft.com

Hacks have been

given a bad name…

…literally

4by Andy Budd of Clearleft.com

Wouldn’t be here

today if it wasn’t for

CSS hacks

5by Andy Budd of Clearleft.com

Sadly, hacks have

become synonymous

with CSS

6by Andy Budd of Clearleft.com

It doesn’t have to be

this way…

7by Andy Budd of Clearleft.com

Bug Fixing

8by Andy Budd of Clearleft.com

Browsers are buggy…

9by Andy Budd of Clearleft.com

…but not as buggy as we’d like to think

Bugs come from

lots of places•Syntactic errors

•Specificity clashes

•Overly complicated code

•Browser bugs

•Incomplete understanding of the

CSS specification

10by Andy Budd of Clearleft.com

Andy’s first law of bug fixing…

…keep it simple (stupid)

11by Andy Budd of Clearleft.com

Andy’s second law of bug fixing…

…always assume it’s your fault

12by Andy Budd of Clearleft.com

Andy’s third law of bug fixing…

…prevention is better than cure

13by Andy Budd of Clearleft.com

Andy’s fourth law of bug fixing…

…offence is the best form of defence

14by Andy Budd of Clearleft.com

Andy’s fifth law of bug fixing…

…isolate the problem

15by Andy Budd of Clearleft.com

Andy’s sixth law of bug fixing…

…use hacks only as a last resort

16by Andy Budd of Clearleft.com

Using Hacks Sensibly

17by Andy Budd of Clearleft.com

Types of Hack•Hacks that rely on parsing bugs

•Hacks that rely on unsupported or

misinterpreted CSS

18by Andy Budd of Clearleft.com

Good hacks…

19by Andy Budd of Clearleft.com

• Are valid

• Only target older browsers

• Are ugly?

Responsible hacking

• Use hacks sparingly

• Only add a small number of hacks to

your main CSS

• Better to filter hacks into separate

stylesheets

• Always comment your hacks

20by Andy Budd of Clearleft.com

Questions?

21by Andy Budd of Clearleft.com

Thanks you!

http://www.andybudd.com/atmedia06

22by Andy Budd of Clearleft.com