AfterAnimator
Re:Node.js adds experimental support for TypeScript
on Tuesday July 30, 2024 @09:25AM (#41108951)
For this case, I've switched to using `foo.at(3)` now instead, as it returns `T | undefined`, so you have to handle the undefined case.
Re:Google Chrome pushes browser history-based ad targeting
on Thursday September 07, 2023 @12:32PM (#37421532)
They're blocked in Safari
Re:AWS us-east-1 outage
on Tuesday December 07, 2021 @01:33PM (#29476361)
I believe he means a literal bin. E.g. Amazon takes products from all their sellers and chucks them in the same physical space, so they have no idea who actually sold the product when it's picked. So you could have gotten something from a dodgy 3rd party seller that repackages broken returns, etc, and Amazon doesn't maintain oversight of this.
Re:Ask HN: Is it worth it to invest in learning TypeScript?
on Sunday November 07, 2021 @12:08PM (#29141243)
I disagree, for me it saves a lot of time by giving you more IDE tooling that you can lean on and less stuff you have to hold onto in your brain.
Once you're proficient in TS, adding type annotations really doesn't take much time, and it helps save time testing by letting the compiler "test" your code before it even runs.
Re:Ask HN: Is it worth it to invest in learning TypeScript?
on Sunday November 07, 2021 @12:03PM (#29141197)
I already feel like living in JS land is coding against a moving target, so refactoring is something that happens extremely often anyway. I wrote and manage a few projects that are several hundred thousand LOC each and my strategy has just been to allow JS and TS to coexist but if I touch a JS file, the first thing I do is refactor it to TS, and then start whatever new work I needed to do. It usually goes pretty quickly unless you have code that was hacked together or designed weirdly in the first place, then I treat it as a good opportunity to do small refactors with types to just clean things up in general. The TS refactor has been going on for maybe a year and a half now and is mostly complete, and I'd say this approach has worked quite well. Maybe if you're working on a larger team you'll need to co-ordinate a little more with when types can be slapped onto existing code.
Just as an aside, the amount of bugs I've found just by refactoring to TS is incredible, the compiler has made me aware of edge cases that I hadn't thought of. Just adding types to old code and getting red squiggles telling me why it won't compile has taught me quite a lot about random aspects of JS that I've never considered.