Re:JavaScript Structs
by klysm on Thursday October 10, 2024 @11:56PM
(#41805945)
Typescript is the best thing to happen to JavaScript since ES6
[ Parent
| on HN ]
Types are great, but I prefer Not having to transpile everything. Stepping throught the TS Code with a Debugger ist non trivial.
Re:JavaScript Structs
by nolist_policy on Friday October 11, 2024 @07:51AM
(#41808656)
You can use 90% of typescript from pure JavaScript: https://www.typescriptlang.org/docs/handbook/jsdoc-supported...
I'm not sure what setup you have, but debugging TS code is pretty trivial. I use vite for all my projects at work and when running the dev server there is seamless integrations with the debugging dev panel in Chrome or Firefox.
Source maps solve this, it’s not a problem in practice
If only it had a sound type system.
Hasn’t caused me any practical problems
Re:JavaScript Structs
by mardifoufs on Friday October 11, 2024 @12:20PM
(#41810840)
It has a very good type system, imo better than most "natively" typed languages.
Yeah I was almost gonna say it makes this proposal feel redundant. I can enforce object shape pretty well using TS, not sure why we need another OOP like thing that tries to do the same.