Hacker News new | ask | show | jobs
by metaskills 763 days ago
LMAO. Yes, I love ESM modules. So maybe more like 2012 or 2015. Would you like to see TypeScript?
5 comments

Thank you for using vanilla JS!
Not OP, but I use TypeScript because it adds a layer of safety to the codebase.

It's like having good test coverage - you can make large changes and if the tests pass (the code compiles), you can be fairly confident that you didn't mess anything up.

I've written Ruby for years, so I'm used to dynamically typed languages. But JavaScript is it's own level of special, and there's so many ways you can accidentally mess things up.

Having tests cover every single path (especially failure paths) can be very time consuming, and often hard or messy to setup (how would you mock the OpenAI module returning an error when adding metadata to a thread?), where as using something like TypeScript can make sure your code handles all paths somewhat correctly (at least as well as the types you defined).

Your code looks clean, and you appear to have good test coverage, so you do you though :-)

Yes this is great so much easier to work with
Y'all just made my day!
I was pleasantly surprised to see the .js. THANK YOU!!
Please, no