News for hackers. Stuff that matters.
Re:JavaScript Structs by klysm on Thursday October 10, 2024 @11:56PM (#41805945)
Typescript is the best thing to happen to JavaScript since ES6
Re:JavaScript Structs by 7bit on Friday October 11, 2024 @04:47AM (#41807603)
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...
Re:JavaScript Structs by mightyham on Friday October 11, 2024 @07:52AM (#41808668)
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.
Re:JavaScript Structs by klysm on Friday October 11, 2024 @09:23AM (#41809272)
Source maps solve this, it’s not a problem in practice
Re:JavaScript Structs by dingi on Friday October 11, 2024 @05:54AM (#41807979)
If only it had a sound type system.
Re:JavaScript Structs by klysm on Friday October 11, 2024 @09:23AM (#41809279)
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.
Re:JavaScript Structs by ericmcer on Friday October 11, 2024 @12:07PM (#41810737)
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.
Re:JavaScript Structs by klysm on Saturday October 12, 2024 @11:24PM (#41824940)
Typescript doesn’t tell the JS runtime anything about what it knows