News for hackers. Stuff that matters.
Re:Ask HN: Depressed, need to leave web development, what ca... by clouddrover on Monday August 15, 2022 @05:37AM (#32467606)
> but its usually some typescript challenge or something like that - which i refused to learn, since i already know javascript. once static type checking became a requirement in front end is like the intersection for when i became a dinosaur

Why? Static type checking is a good thing to reduce errors.

Re:Ask HN: Depressed, need to leave web development, what ca... by wruza on Monday August 15, 2022 @06:08AM (#32467829)
Also good to increase time to market and make you think more about types, less about business logic. It has both pros and cons depending on what you are doing.

I have learned and can read and write typescript, but it doesn’t click when it comes to “we’ll need it tomorrow to check our ideas fast”, the usual mode of startup operation. These stories about night and day difference also do not match my reality. All my code paths are either hot or tested. How many type-related bugs have I encountered last year? Maybe a few, but can’t remember even a single one. Maybe I’ll gradually type it after we go into maintenance mode, maybe leave it as an exercise to a maintainer if they see fit. My last few projects were successful and brought solid revenue without any type-related issues.

Re:Ask HN: Depressed, need to leave web development, what ca... by clouddrover on Monday August 15, 2022 @07:12AM (#32468215)
> Also good to increase time to market and make you think more about types, less about business logic.

Show me some actual measurements that TypeScript increases time to market. I don't believe you have any.

Re:Ask HN: Depressed, need to leave web development, what ca... by sanitycheck on Monday August 15, 2022 @12:20PM (#32471634)
I've seen it add days of pull request code golfing whenever someone makes some new types, but those people would find other ways to waste time on pure JS projects.
Re:Ask HN: Depressed, need to leave web development, what ca... by sli on Monday August 15, 2022 @06:08AM (#32467826)
TypeScript is a Microsoft band-aid on problems far better solved by other languages. The level to which people praise it feels like Stockholm Syndrome, and criticizing it frequently gets the stereotypical toxic programmer forum replies like "well you just don't know how to use types." It's impossible to speak critically about TypeScript unless you write long blog posts.
Re:Ask HN: Depressed, need to leave web development, what ca... by clouddrover on Monday August 15, 2022 @07:19AM (#32468261)
> It's impossible to speak critically about TypeScript unless you write long blog posts.

If it takes a long blog post to find something to criticize about TypeScript then I'd say that's a sign that TypeScript is doing something right.

Re:Ask HN: Depressed, need to leave web development, what ca... by sanitycheck on Monday August 15, 2022 @07:07AM (#32468178)
It totally is, but it does largely work as intended.

For people who've been dealing with JS for years it's a big improvement which I guess is why it gets so much praise. (The love for React, OTOH, must be Stockholm Syndrome!)

Other languages are better, but transpiling from them to JS has (arguably?) bigger downsides than using TS. WASM is the big hope for some people, of course, but it's only really good for heavy lifting at the moment.

Re:Ask HN: Depressed, need to leave web development, what ca... by cutler on Monday August 15, 2022 @06:36AM (#32467995)
Static typing zealots have butchered perfectly good dynamic languages like Python and Ruby in recent years after M$ took over Javascript like Russians invading Ukraine. Even Ruby ffsake. Soon Clojure will be the only refuge for us devs who value dynamic languages.
Re:Ask HN: Depressed, need to leave web development, what ca... by CapsAdmin on Monday August 15, 2022 @06:25AM (#32467908)
I can't speak for the OP, but I've met people who "don't get it" for various reasons (me included at some point). I'm pretty sure the OP has heard this argument before.

Telling someone to use language A because it's much better than language B that the person is comfortable with is not a very good approach. You can get into the objective reasons as to why but for some it might be difficult to really understand.

I struggled with this when I was introduced to types as the entire concept was completely new to me. I had other ways I could think of to reduce errors (tests, more robust code, etc) and I wasn't sure how typescript could help me reduce errors any further or if it was worth learning a new (seemingly difficult) concept to deal with something I already felt I could deal with.

Re:Ask HN: Depressed, need to leave web development, what ca... by clouddrover on Monday August 15, 2022 @07:11AM (#32468209)
> I had other ways I could think of to reduce errors (tests, more robust code, etc)

You can still do that with TypeScript and also get type checks, null checks, and just typos found for you by the compiler. Why wouldn't you want the compiler to do that for you? I don't want to do it, I want the tools to do it.