15
3

Don't Roll Your Own …

25d 4h ago by programming.dev/u/codeinabox in webdev@programming.dev from susam.net

The alternative of using someone else's framework for every single basic function is equally bad.

It needs to be balanced.

I skimmed the article and they just say:

  • Don't roll your own page scrolling.
  • Don't roll your own link navigation.
  • Don't roll your own text selection.
  • Don't roll your own context menu.
  • Don't roll your own copy and paste.
  • Don't roll your own password field.
  • Don't roll your own date picker.

For a date picker I initially disagreed but then their argument about how you can just use 2x input type=date for the start and end date and then it's consistent across every site was pretty reasonable. I'm not gonna go read mdn on its capabilities right now so maybe there's still some valid use cases for not using one, like conveying to the use what valid ranges they can select.

But yes I agree you shouldn't use a library for something simple like left-pad

HTML5 is a beast of a spec. Like, if properly used it is enough to make a functional UI with modal and tooltips and whatnot. This is what makes it popular for not just "web" application IMHO because you then no longer need to learn yet another DSL for UI (electron, react native, capacitor js, expo)