Hacker News new | ask | show | jobs
by dylan604 511 days ago
why make everything need a class rather than just styling the DOM elements directly. Why wrap a checkbox into a div rather than just a <form>?

why did you skin the cat that way when there's 98 other ways to do it?

maybe there's a logical reason more than "that's just what came to mind", maybe not. that's the beauty of the whole thing. there is no one way

3 comments

I'm not sure that argument holds here, not every solution in programming is equally good just because. A <progress> element has the advantage of semantically actually representing a progress bar, which improves accessibility and who knows what other browser behavior and heuristics. In general you should try to use semantically correct HTML tags unless you have a really good reason not to. Maybe in this case he couldn't get the appearance he wanted using <progress>, which would be an acceptable reason.

Obviously this is nitpicking and this UI was made for fun rather than being a serious library intended for production. But that's a different criticism of the GP than the one you made.

It's released with an MIT license so you're free to made any "improvements" you see fit to make. Fork away my friend. Then come back and do a Show HN with a full and complete write up for every little decision you've made. Not just you, but anyone else in this thread that needs to know.
I think it's fair to discuss design decisions of open source project, even if you never plan on actually implementing suggested changes.
Not every question is a criticism that needs to be defended against. The person you're responding to could very well just like to know the reason if one exists, no more, no less.

If you know a better way to get that info than asking the question, I'm all ears.

(major digression ahead)

This is actually something I've been digging into for a while, trying to improve my own communication. My own current best answer for this sort of situation is the social expectation is that a neutral question will always be accompanied by praise and gratitude, and any question asked that lacks that accompaniment will be interpreted as antagonistic.

For example, the comment you're responding too could have started with "This looks really cool, ..." or "Wow, this takes me back..." or "I can see a lot of effort went into this..." and it would have resulted in the question coming off as neutral instead of critical to some people.

What's fascinating is when I mention this kind of thing I almost always get one of two responses

* Of course that's how it works, everyone knows that!

* That's ridiculous, no one can be expected to do that!

I think I'm more cynical. Almost everything stated on the internet will be perceived as antagonistic. At least by some. It's more a representation of the reader's internal state rather than an issue with the question / statement. Unless, of course, the question / statement is overtly antagonistic.
It's definitely not just on the internet, I've been working for years to learn how to not upset people for asking reasonable and genuine questions IRL. It's a real struggle to this day to notice I'm failing to engage in the social ritual correctly and come up with appropriate extra positivity on the spot just so I can be considered a non-antagonist.
I think internalization is important for self improvement, so I admire the way you frame this. Try not to downplay the other part's role, though. They are also making a choice in the exchange.
To be fair, software discussions in particular are absolutely overflowing with snark, reflexive dismissals, and just general one-upmanship. So I can understand people assuming the worst.
Precisely why it is perfectly fine and good to be inquisitive, and ask why people do things the way they do. It's the point of a show and tell.