Live data from Hacker News

Just Say No to JavaScript

infoworld.com

11–20 of 86 posts

Re: Just Say No to JavaScript

#11
post #3

This is a plea to use TypeScript instead of JS. Why not. Strong typing is certainly great. But the reason I don't use TypeScript isn't any of those listed: it's because it needs a compilation step, and I don't want that.

> it's because it needs a compilation step, and I don't want that Why? The seconds it takes to compile even a large project are paid back a million fold everytime it catches a mistake you'd have missed or your IDE out you used the wrong type. It's probably not listed in the article because it's a nonsensical argument.

>catches a mistake you'd have missed or your IDE out you used the wrong type.

Do people really have this issue? My errors are never type related and when they are the console tells me immediately and the exactly line to fix.

What I need is a StupidScript to save me from the stupidity of my logic errors…

Like for example I’m working on a custom game engine for a web game I’m making, I’m having issues with the rewards unlock at the end of the match. The code is “correct” the right types go to the right place but there is a logic error somewhere that prevents certain rewards from unlocking.

Re: Just Say No to JavaScript

#13
post #11

Earlier quoted context omitted.

> it's because it needs a compilation step, and I don't want that Why? The seconds it takes to compile even a large project are paid back a million fold everytime it catches a mistake you'd have missed or your IDE out you used the wrong type. It's probably not listed in the article because it's a nonsensical argument.

>catches a mistake you'd have missed or your IDE out you used the wrong type. Do people really have this issue? My errors are never type related and when they are the console tells me immediately and the exactly line to fix. What I need is a StupidScript to save me from the stupidity of my logic errors… Like for example I’m working on a custom game engine for a web game I’m making, I’m having issues with the rewards…

At that point sir you would have no job. Your job is logic safety

Re: Just Say No to JavaScript

#16

The author never actually says what is so wrong with JavaScript. I think it is quite a good dynamically typed language, and it certainly has some very high-performance implementations. If you don't like it, just use something else? > Ultimately, JavaScript was the right thing at the right time. It ended up being folded, spindled, and mutilated to serve purposes that it isn’t well suited for Counterpoint: many quirks…

> The author never actually says what is so wrong with JavaScript

The lack of explicit typing. The author argues against untyped code, and for using typescript instead of javascript to get types.

Re: Just Say No to JavaScript

#17
post #3

This is a plea to use TypeScript instead of JS. Why not. Strong typing is certainly great. But the reason I don't use TypeScript isn't any of those listed: it's because it needs a compilation step, and I don't want that.

I think the not wanting a compilation step complaint is even worse than the it's too much typing complaint, and I say that as someone who does not much care for typescript despite using it almost exclusively for the last 5 years.

Re: Just Say No to JavaScript

#18
Translation: type less languages get messy when the project size grows. This is not only about javascript, it's also about python and whatever else is in fashion.

Still, the title is disappointing because switching to a type checked dialect of JS won't fix the bloat issues that are fundamental to the browser as a platform.

Re: Just Say No to JavaScript

#19
post #3

This is a plea to use TypeScript instead of JS. Why not. Strong typing is certainly great. But the reason I don't use TypeScript isn't any of those listed: it's because it needs a compilation step, and I don't want that.

> it's because it needs a compilation step, and I don't want that Why? The seconds it takes to compile even a large project are paid back a million fold everytime it catches a mistake you'd have missed or your IDE out you used the wrong type. It's probably not listed in the article because it's a nonsensical argument.

Normal application developers suffer less from it, but the reasons that made svelte move from TS to jsdoc apply to everyone.

https://news.ycombinator.com/item?id=35892250

Personally I like using typescript's namespaces that have no nice-enough jsdoc/js equivalent, but if tsc/tsserver had an option to mutate in-place typescript syntax to jsdoc notations where possible I would use it as much as possible.

Post reply on HN