Live data from Hacker News

Don't Roll Your Own

susam.net

21–30 of 128 posts

Re: Don't Roll Your Own

#21

If you don’t “roll your own,” you must choose from what other people have created. And in this space, there are a bewildering array of options, each of which carries some new pile of abstractions that make some things easy and other things hard. Many eyes are supposed to make bugs shallow. In the webdev space, many eyes on something like React lead to numerous opinionated alternatives, each successful enough to warra…

so much this. tried to implement oauth recently.

all providers only document their bloat-spyware-buggy javascript that creates a button and handles all in the client.

then using libraries you are open to attacks in one hundred ways because those implement all the unrealistic things in the spec (including overriding issuer and setting crypto to nothing, via attacker controlled fields). after two days of evaluating i just gave up and wrote my own, server side and handling the singular case everyone uses. 20 lines, which was less then adopting the libraries.

Re: Don't Roll Your Own

#22

> Don't roll your own page scrolling. browser should not even let the page see this action > Don't roll your own link navigation. browser should not even let the page see this action > Don't roll your own text selection. browser should not even let the page see this action > Don't roll your own copy and paste. browser should not even let the page see this action I'm serious. WHY javascript code is even allowed to see…

It should be illegal for a website to hijack text copying, right clicking, or keyboard shortcuts like Ctrl*f.

Re: Don't Roll Your Own

#23

I find that most datepickers are better than the browser's default. It's a shame that they can't be styled more

I agree with a caveat: Default date pickers on mobile devices are very good. But on desktop browsers they are terrible. They break design continuity in a very ugly way and have quirks between browsers and systems. And personally, the popup calendar they provide just too small. If the system took over the date picker on desktop like it does on mobile devices instead of forcing the browser to handle it, I feel like we…

I just went and confirmed this because it’s not something I’ve really looked at and I agree. The date picker you get from a straight up on iOS webkit is pretty nice.

The one in webkit on macOS isn’t quite as good, but is better than the one in firefox if only because firefox closes the picker when you type a year in to move far through time. Good thing firefox is open source.

Re: Don't Roll Your Own

#24
In the age of AI and npm supply chain attacks I feel like there are more reasons than ever to roll your own.

One other possible title of this article could just be, don’t break UI conventions. Which is not the same thing.

Instead of trying to download and configure a date time thing (for something app specific like domain specific date ranges) rather than having to rely on the configuration of a larger library, then having to manage all future major version upgrades (and some of these npm libraries have major versions every year!) why not just create your own smaller surface area component? It’ll be literally zero maintenance compared to managing an npm dependency in your app.

Re: Don't Roll Your Own

#25
post #7

> Don't roll your own page scrolling, link navigation, text selection, context menu, copy and paste, password field, or date picker. Javascript in the browser was a mistake. And if we had to have it, the suitable scope of it was what we had around 2004. Google invested tens of billions in it realizing they had a way of owning the browser space simply by making it insanely complex. Just hire all of the web standards p…

I understand the frustration but don’t take it too far. People often post great games here, cool visualisations, useful utilities. Hardly any of those would work at all without JavaScript.

You can do terrible things with JS but you can do great things too.

Re: Don't Roll Your Own

#26

> Don't roll your own page scrolling. browser should not even let the page see this action > Don't roll your own link navigation. browser should not even let the page see this action > Don't roll your own text selection. browser should not even let the page see this action > Don't roll your own copy and paste. browser should not even let the page see this action I'm serious. WHY javascript code is even allowed to see…

All of these annoyances and more can be blocked by StopTheMadness (available for iOS and macOS):

https://underpassapp.com/StopTheMadness/

Re: Don't Roll Your Own

#28
post #5

Totally agree. What do engineers or designers think they're trying to accomplish when they mess with the scroll bar? Or the password field? "We are so sophisticated, the built in behavior is simply not good enough for us!" Congratulations, now your website is a shitty experience for your users. Well done.

In my experience, it's never the engineers nor the designers who makes those decisions. Stuff like that always comes from higher up the ladder, some middle management figure who thinks he is smarter than he is, mandates such abominations and refuses to hear reason from the engineers and the designers. The engineers and designers then proceed to do as they're told because they like that nice fat paycheck at the end of…

Or nowadays managers can use an LLM to take control, sieze the moment, and make the buy button bigger.

Re: Don't Roll Your Own

#29

> Don't roll your own page scrolling. browser should not even let the page see this action > Don't roll your own link navigation. browser should not even let the page see this action > Don't roll your own text selection. browser should not even let the page see this action > Don't roll your own copy and paste. browser should not even let the page see this action I'm serious. WHY javascript code is even allowed to see…

Also: Javascript should not be able to touch the browser history. I know it's useful for some apps. But it's too prone to abuse and that API should be revoked.

Re: Don't Roll Your Own

#30

> Don't roll your own page scrolling. browser should not even let the page see this action > Don't roll your own link navigation. browser should not even let the page see this action > Don't roll your own text selection. browser should not even let the page see this action > Don't roll your own copy and paste. browser should not even let the page see this action I'm serious. WHY javascript code is even allowed to see…

Because the web browser was burdened with the role of application host, and not just presentation of static content. There's no going backwards.
Post reply on HN