Live data from Hacker News

Shame.css

csswizardry.com

21–30 of 57 posts

Re: Shame.css

#21
post #17

We have the same thing in Javascript, we call it 'hacks.js'. That's the place you go when things are broken and you're not yet ready to pay down tech debt. Hacks.css sounds nicer than shame.

One key difference here for me is that the word "hacks" might imply that the addition of hacks to that file are acceptable; where as the word "shame" implies that the hacks are less than acceptable and should be used as a last resort.

Re: Shame.css

#24

Pedantry: can we call it "guilt.css" instead? In psychological literature, guilt is defined as the "I did something bad" emotion, shame is the "I am bad" emotion. The crucial difference between them is that guilt can be fixed by making amends. That seems like exactly the mindset you want to encourage with this: guilt.css implies that you feel guilty about all the hacks you have and want to make amends, while shame.cs…

> implies that your codebase is a steaming pile of shit.

You went slightly overboard there I think.

It's possibly called shame because the style sheet is public, _it shames the author_.

Re: Shame.css

#25
This is a great idea and to be honest the only time I ever use hacks is when I am adding in compatibility for IE8. I disagree with the !important declaration though. I use LESS for writing CSS and while it's definitely a valuable asset to have, the ability to nest and have super specific queries generated means when you'e writing media queries, you sometimes don't want to have to replicate the nesting and specificities instead of just going .element and using !important instead saves time and space. Why is everyone so against using !important? Sometimes when you're overriding CSS added to an element via Javascript you have to use !important, regardless of how specific you are.

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.

Re: Shame.css

#26

Why is overflow hidden a hack?

overflow: hidden; is not a hack. It can do a lot of things which in his opinion are hacks (wtf). Suggested reading: http://colinaarts.com/articles/the-magic-of-overflow-hidden/

It's not that overflow: hidden in itself is a hack, but it's application to counter collapsing due to floats. Already in the first paragraph, your link states that float containment is a side-effect. While I do use it for this exact reason, it leaves a bit of an aftertaste. And when it comes to css, isn't that the definition of a hack?

Re: Shame.css

#27

Pedantry: can we call it "guilt.css" instead? In psychological literature, guilt is defined as the "I did something bad" emotion, shame is the "I am bad" emotion. The crucial difference between them is that guilt can be fixed by making amends. That seems like exactly the mindset you want to encourage with this: guilt.css implies that you feel guilty about all the hacks you have and want to make amends, while shame.cs…

I don't know about psychological literature, but in common usage where I'm from, "guilt" is what you feel when you know you've done something you shouldn't, whereas "shame" is what you feel when you believe others either do or will frown on something. In that context, I think "shame" is more appropriate — essentially, it's a collection of code that brings some degree of shame to the project, not code that you should feel guilty for writing. Think, "It's a shame I had to resort to this."

Re: Shame.css

#28

This is a great idea and to be honest the only time I ever use hacks is when I am adding in compatibility for IE8. I disagree with the !important declaration though. I use LESS for writing CSS and while it's definitely a valuable asset to have, the ability to nest and have super specific queries generated means when you'e writing media queries, you sometimes don't want to have to replicate the nesting and specificiti…

For me shame.css doesn't necessarily contain hacks. In mine you will find less thought out selectors that are added in haste and anything else that doesn't conform to the high standard I set myself.

Re: Shame.css

#29
Unfortunately I think most of my CSS would deserve to be in shame.css

Related: is there a good short "remedial CSS for programmers" book or something?

Re: Shame.css

#30
The idea itself sounds good and recognizes what tends to happen especially later in a project. There a number of challenges though:

- 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.

Post reply on HN