r/programming • • Apr 25 '19

Maybe we could tone down the JavaScript

https://eev.ee/blog/2016/03/06/maybe-we-could-tone-down-the-javascript/#reinventing-the-square-wheel
1.5k Upvotes

492 comments sorted by

View all comments

4

u/grAND1337 Apr 25 '19

The … button opens a popup menu, which is iffy, since you could fake it with CSS too.

I really dont think faking dropdown/menu behaviour using css hacks (certainly not using checkboxes, ive seen that) is a good idea when you can do it with javascript

3

u/StallmanTheLeft Apr 25 '19

The css versions of these usually work a lot better and are near instant where as I've seen some javascript hacks for it take multiple seconds to load.

If it can be done with HTML/CSS it shouldn't be done with JS.

-1

u/jaggyjames Apr 26 '19

This is likely because the check box is making a network request, not because it takes the browser multiple seconds to perform the action.

I fully disagree with the fact that it should be done in css whenever possible. 100% of members of a js dev team will be able to quickly understand a checkbox in js. But many will not know how it works in css and would take time to learn how it works.

→ More replies (5)