Hacker News new | ask | show | jobs
by jimmychoozyx 1041 days ago
Eh, I just didn't need it.

I learned it but never saw the need for the extra overhead.

It's full of these situations. And I'd rather just see less code due to "Attention Economy" issues-- the more things to focus on, the less focus each thing receives. It's easier on the big picture, if there's less things going on. TS has a ton of terms and concepts that I just don't need to make my business logic work.

const cat Cat cat<T Cat> = cat

vs.

const cat = cat

dto? iterface? i can define those without typescript. Just plain objects with comments about what they do and what they are.

Anyway, yep it's just my personal opinion of course.

My opinion is basically... I think in some cases there's a desire to make things overly complex, sometimes even as a way to gate keep--

I'm not saying that's what is happening here.

But sometimes I feel that way about Typescript leaking into all of the Javascript ecosystem.

1 comments

Fair enough. Idk who downvoted me, but based on your reasonable response, doesn't seem like it was you.

Ultimately, TS enforces those implicit comments you mentioned and adds some explicitness to the code.

Whatever works for you and gets your job done

But it's worth mentioning, TS with some of the strict settings disabled is basically JS but with some added benefits, primarily due to the TS type checker still being available. No need to go fully in, you can just as easily add explicitness and overhead where necessary and write JS everywhere else to avoid the overhead.

Nah twas not I.

While working with TS in VS Code, I liked the intellisense of TypeScript + VSCode... it was able to piece itself together better than vanilla JS-- it predicted which objects, functions, or files I would reference quite well. So, I'll give it that.

I totally see a reason for it in the corporate realm of developer churn and in the vein of keeping projects very structured and stable. I might give it another go eventually.

For my own projects where I try to keep mental overhead low, and reduce focus on anything over than the main business logic, I prefer plain JS (e.g. within an ExpressJS or ReactJS project)

you're right i hate the damn overhead too.

i despised typescript for years until i tried it again recently. these days the developer tools are better.

prettier now formats it very well. eslint now lints it very well. tsx and ts-node now lets me run my ts files without compile step to js before i can run it with node. on frontend, vitejs has templates for react with typescript projects.

im a performance freak too, i currently use uwebsockets.js instead of express/fastify/hapi/koa. i wrote my own redis client instead of node-redis and ioredis. i fucking hate overhead too, haha.

i think my strongest preference on typescript stems from my frustration on very large projects. say thousands of commits every month, at that scale typescript really helps a lot in catching bugs before we even run our code.