Hacker News new | ask | show | jobs
by austin-cheney 747 days ago
> True, but the only solution to this is "get good". Because using vanilla JS isn't going to make them any less likely to make a foot gun.

That is a common misconception that only occurs in software and is exceptionally common to JS. If you want to avoid foot guns set validation criteria: lint, test automation, strong types, and so forth. Contrary to what many JS developers suggest vanity is not a solution here and even that can be automated.

I had a personal project that was this peer-to-peer file sharing utility. I wanted test automation but was not aware of a test-automation utility for the browser in a peer-to-peer environment. So, I wrote one. When I changed the project from HTTP to WS I was about to execute up to 300 tests in about 8 seconds. That was very helpful. I found that since it was fast enough I could run this test automation all the time even before manually testing in the browser.

When I was at this consultancy last year that used Vue 2.0 tiny refactors were full of risks and could take up to 2 weeks. They had no automation of any kind and it scared the shit out of me. Making heavy use of strong types due to TypeScript I was able to execute refactors several dozen times larger in about 2 hours at almost no risk in a much larger personal project.

None of that means I am awesome. It just means that by putting the proper processes in place I was allowed to be really bad and could still release hundreds of times faster at low risk. At work I had to be astonishingly stellar when tip toeing around eggshells very slowly to release anything at all. I have been doing this long enough to see the same faulty patterns repeated.

The ideal path forward has to come from somebody that understands risk analysis, can measure things, and understands compound interest. That person could be an MBA who has never programmed before. Software almost always gets this wrong and does the opposite because it likes to repeat its failures. My repeated failure is not getting out of JS sooner.

1 comments

> That is a common misconception that only occurs in software and is exceptionally common to JS. If you want to avoid foot guns set validation criteria: lint, test automation, strong types, and so forth.

The thing is, a developer can do all these things and make ugly UXes. They could also do none of them and make brilliant ones.

> My repeated failure is not getting out of JS sooner.

Have to agree. You sound like a strong backend engineer who was trapped in a frontend engineers body for years.