Svelte decided to ditch it because it became unpractical due to the compilation step for their library. I think for libraries it makes sense to go the jsdoc way as long as consumers can choose typescript.
Comment on Which side are you? Javascript or Typescript
jpeps@lemmy.world 1 year ago
What Typescript drama is there? It’s fantastic. It’s been an industry standard for years. In my anecdotal experience the only people that hate it are juniors who did pure JS at their bootcamp and seniors that have refused to learn anything for the last 5 years.
beeb@lemm.ee 1 year ago
marcos@lemmy.world 1 year ago
Am I the only one scratching my head trying to understand why Svelte supported it at the first place?
The TS type system is not a good match for the project.
fidodo@lemm.ee 1 year ago
I feel like there’s no typescript drama, just JavaScript drama. Things are pretty happy in the TS community. I’ve been writing js code since it literally first came out. I’m definitely no js hater. In the early days js code bases quickly turned to spaghetti code, but I genuinely think the js community has done miracles turning what was essentially a super simplistic toy language into a seriously good production quality language. I’ve seen first hand how much work has gone into it, and while most of the js community has been great with embracing change for the better, there’s always been the niche of detractors against any change that adds complexity even when it makes coding safer and more productive.
I’ve always had a love hate relationship with JavaScript, but with typescript it’s really been just straight up love. Pretty much all the trouble I have with typescript has been due to external libraries that use types lazily or incorrectly, and even then there are solutions to add safety to your own codebase. Sometimes I run into some trouble with the type system itself, but it’s pretty much always because I’m doing something really complicated that would be hard in any type system. I’ve been working with typescript for years now and my code bases are some of the most solid ones in my company. Typescript is really safe as long as you’re actually using it and not telling the compiler to ignore types through using any or making unsafe assertions.
It makes no difference to me if other people prefer JavaScript. Any important js library will get ts support anyways through definitely typed, and if a library is so sloppy it can’t be typed well then it’s not a good library to use anyways. Having people proudly announce they only want to use JavaScript is also great for hiring. It easily tips me off on who not to hire.
fusio@lemmy.world 1 year ago
or people used to work alone never having to go back to their code (e. g. bad consultancy jobs)
jpeps@lemmy.world 1 year ago
Even alone I find it indespensible. I find it’s mainly useful for writing code correctly the first time around.
fkn@lemmy.world 1 year ago
Some people think better with typing information explicitly written out. Some people don’t. In my opinion it is a creativity thing. Some people like to make art that is photo realistic, some people like to make abstract art.
I understand both viewpoints. In my free time I vastly prefer late bound, dynamically types languages with robust reflection engineers built into their interpreters. For work, I heavily prefer late bound, strictly typed with reflection optional or minimal.
Different people think differently.
jpeps@lemmy.world 1 year ago
I think that’s fine if that’s how you like to work on your own, but I’d challenge anyone to do that and write better documentation while also getting a team or whole business to do the same. A huge strength of TS is that it gives people no choice but to document their work.
fidodo@lemm.ee 1 year ago
TS is amazingly powerful when it comes to refactoring. When people say they don’t see how TS makes you more productive it just makes me think they never refactor their code.