Hacker News new | ask | show | jobs
by cgrand-net 4962 days ago
By doing such a change they violates their contract. Can't you negotiate an alternative change? Eg the strong around the span or using styles instead of strong or move the username class to the strong tag?

Anyway if you really want to program defensively against such changes, roll your own replacement to content fn which would replace the cornets not of the current node but of all its terminal descendants.

I'd like to know more about your workflow.

1 comments

My example above was possibly too simplistic. I'm not using Enlive at the moment but am merely trying to gauge what kinds of contracts would allow the developers and designers work together most efficiently. I can imagine a fairly big difference between, for example, the following two contracts:

a) "Don't touch the markup without an explicit agreement between the two of us."

b) "Please make sure you have an element with a data-content-for='user.username' somewhere in the HTML."

More often than not it's a variation of b) not involving custom attrs (a matter of taste). It's the same kind of contracts you have to set up if you are also doing some heavy JS anyway.

Sometimes the design is forced upon the team (eg corporate intranet) and then one has to resort to ugly and brittle selectors but still I prefer that to slicing and dicing the design to add loops and conditionals – especially when the intranet's corporate branding change every 9 months :-/

(Thanks for rewording your reply)