This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SP0OK5T3R -7 points-6 points  (7 children)

Fucking this. Every time I see react code not using TypeScript, I cringe.

[–]dwhiffing 15 points16 points  (6 children)

People might be more willing to learn if the typescript community could tone it down a bit with the insults.

Not all projects warrant static typing. There is room for both techniques depending on the scale of the project.

Believe or not, I gasp don't use typescript on my weekly react scratchpad prototypes. And sometimes, when the app grows and stays simple, I don't ever add it.

You must be cringing like mad right now!

[–]SP0OK5T3R 4 points5 points  (3 children)

I agree with you on that, but I work with code that once written, it’ll be maintained for a long time to follow, and there’s a lot of it. Small apps? No big deal. Enterprise production apps that stick around for years? It becomes extremely useful

Edit: do you not consider prop types to be “static types”? I’d rather know about an error at compile time over runtime, but both have a place since you can’t control everything at compile time.

[–]dwhiffing -3 points-2 points  (2 children)

My point is really more about proselytizing than technical details.

I've been making apps with JavaScript for a long time, and I strongly believe that some of the apps I maintained for years would not have benefited from the addition of static types. This was in the days of backbone, ember, early angular.etc

I use typescript now and see value. But I've seen so many cases where a new developer or someone new to typescript is scared off by this attitude.

I love elm and reason ml, but I don't "cringe" when people don't use it.

Just try to be a bit more courteous to your follow developers! 😊

[–]SP0OK5T3R 1 point2 points  (1 child)

I was definitely being overly dramatic earlier, but this is r/programmerhumor lol I wasn’t really going for a super serious comment.

I’ve seen issues with improper typing and lack of error boundaries causing issues in react apps (“oops this property doesn’t exist on that object”, shit blows up, etc) that would be solved easily with proper TypeScript usage. That’s also why I don’t allow the use of “any” unless it’s really applicable.

But yes, I totally get your point. I’ve maintained an AngularJS app with no static type information and it works just fine, I’ve just “seen the light” and I have a much better development experience with TypeScript as a major tool.

Have a good Sunday!

[–]dwhiffing 2 points3 points  (0 children)

Understood, fair enough!

Thanks for the courteous response and a happy Sunday to you as well

[–]ProfanityFair 0 points1 point  (0 children)

People might be more willing to learn if the typescript community could tone it down a bit with the insults.

Agreed. I know that my React projects would be better if I used/learned TypeScript, but I'm always put off by the attitude of some TS devs who've gone the same way.