Hacker News new | ask | show | jobs
by lovetocode 971 days ago
Is anyone just using vanilla React with no TypeScript or Framework of any kind? I’ve tried Remix and Next js and just find them so cumbersome. Typescript causes me more headaches
3 comments

Typescript is a real pain, I’m still trying to figure out why it’s so popular. The constant nagging and extra typing (no pun intended) when using it vs regular JavaScript makes it a pain. Then, there’s the extra parsing step to change it back to JavaScript. Idk I don’t see the value yet.

Edit: I say “parsing step “ because that’s what it is. There’s no “compiling” and “transpile” is just a ridiculous way of saying parse and output.

Just to add some color to this… values come in from the DOM as strings or numbers or booleans. They go out over HTTP as strings. (These are approximations, I’m going from memory.) The question then becomes: Should I inspect the values or just pass the values along? You can see how a simple form might just collect data and pass it along to a backend, maybe do a bit of cursory inspection of the values to make sure they’re in range. A sophisticated web app, on the other hand, might construct an in-browser-memory model from the data, and so needs to vigorously ensure that the data is correct. In the first case types can be a pain since you’re not telling the compiler anything that isn’t already well understood. In latter case they’re a necessity.
Are you against typescript or types in general?
I love types I just struggle with Typescript a lot because it seems to get in the way for me. I might like it more if I buckled down and really tried to figure it out. It’s probably the slowest language for me to grasp maybe outside of Objective C. When you try to enforce typing on a language that wasn’t designed ground up with types in mind it just rubs me the wrong way. Python type hinting strikes a good balance though.
Yes, I am, all the best devs I know are, and I honestly believe it's the 10x play right now.

Since 2016 I've seen reasonably large enterprise SaaS projects with similar scopes go from $5M builds to $50M builds without anyone else batting an eyelid. I have no idea what's going on in the industry at the moment.

React, Express, node-postgres. It worked 7 years ago. It works now. I can't even remember the last time I got stuck implementing any kind of business requirement with that very basic stack. Compare that to my day-to-day in 2023 where I'm spending hours every day fucking around with old stack overflow posts and shitty documentation trying to get TS/Next/Gatsby/NestJS or whatever else working.

After using TypeScript, I’m never going back to vanilla JavaScript if I can help it.
Yeah, even for my simplest projects, like single-file scripts directly modifying HTML, I'll use `tsc` to compile .ts into .js, just so that I can get better IntelliSense while I'm working
That’s great to hear! Did you find it hard to learn?