Shame.css
csswizardry.com
csswizardry.com
Regardless, I would agree that guilt.css would have less of a deterrent effect (think chocolate), and illustrate the premise more effectively.
You went slightly overboard there I think.
It's possibly called shame because the style sheet is public, _it shames the author_.
Every Friday, we pick 3 random lines from chance_2_buy_lunch.scss (and another 3 from chance_2_buy_lunch.coffee) and the writers of those lines have to buy lunch for the rest of the team.
I'd argue that if devs shame each other all the time, something about your culture is broken. Why? Because the normal response to shame is to want to hide it. You see that in the description of shame vs. guilt societies in the links you provided, where "Shame cultures are typically based on the concepts of pride and honour, and appearances are what counts, as opposed to individual conscience in guilt cultures." Shame is positively correlated with depression, addiction, violence, aggression, bullying, and all sorts of other nasty stuff; guilt is inversely correlated with all of them. [2]
Hacks.css sounds nicer than shame.
Simple and elegant imho. That said, I wouldn't use something like that in a project without a build step that merge stylesheets together.
There might be a subtle difference in the way people think about CSS vs. other programming that would push them to one solution or the other.
Personally I like it, while some people like putting TODOS in the code (and I do it as well) having a specific cruft file (or shame.css) allows you to put in non-code related stuff and comments at a more over-arching level.
- The name - as already has been raised by others implies that you have done something wrong.
- Adding to the file requires a degree of confidence and maturity among your team and a level of trust among the group.
- The existence of such a file might reduce effort on the part of some. After all if "shameful" hacks are OK, why bother with real solutions?
- Internal refactoring as an separate independent initiative is sometimes difficult to justify from a financial or political perspective.
In a group with self-aware, well educated, and motivated developers, these concerns might be rather small. But in many larger organizations (with practices that sometimes make Dilbert comics appear tame), this would not work as well for these and other related reasons.
Don't get me wrong, I really like the idea. And since css code is relatively "free" to be included in an arbitrary file, calling out questionable code in this way does seem to have its merits. Perhaps its the use of the term shame that tips me off, but that is a concept that is understood very differently by different people and different cultures. So - like many suggestions - it might work well depending on your group, but is unlikely to be adopted as a universal best practice.
Cool idea, but considering IE8 support is on its way out from developers what hacks are left we need to use? Using overflow: hidden instead of resolving a problem is just lazy, it's not a hack, it's plain lazy. Cool idea in theory and perhaps might have been helpful in 2008, but it's 2013 and browsers are all at a point now where we can use CSS and not have to worry about consequences or support except for maybe browser vendor prefixes.
This is really just another manifestation of the "Broken windows theory"[1], which I've witnessed in code many times over. I think it's just a fact of human nature, also similar to the "When in Rome..." adage; it doesn't make you feel nearly as dirty to do something awful (whether it's in code or in a run-down urban environment) when there's already lots of problems to begin with.
//TODO HACK HACK HACKITY HACK
You mean comments in CSS specifically?
I'll take that as an offhand comment you didn't give much thought to, because wow, there most certainly are lots of legitimate uses for comments in code.
IMHO comments are best used in a handful of situations, such as:
1) Marking hacks 2) Explaining unusual, non-obvious sections of code 3) Noting historical reasons for doing something in a non-obvious manner 4) Noting pitfalls to be avoided 5) Making passive aggressive remarks about the "business guy" who made you do something terrible
Not an exhaustive list of course, but I do think that it's best to think twice before writing a comment, asking yourself "how can I make this more obvious with my code?"
You could extend this to a _shame.sass file too, of course.
Related: is there a good short "remedial CSS for programmers" book or something?
* https://github.com/necolas/idiomatic-css
* http://coding.smashingmagazine.com/2009/04/08/from-table-hel...
* http://engineering.appfolio.com/2012/11/16/css-architecture/
* http://www.stubbornella.org/content/2011/04/28/our-best-prac...
This could make shame.github.io/shame.css available to all sites at no charge to the users...
I know I can search my codebase for HACK and see all of my greatest embarrassments.
> "overflow:hidden;" instead of working out what’s actually broken our layout
Suggested reading: http://colinaarts.com/articles/the-magic-of-overflow-hidden/