Live data from Hacker News

Just Say No to JavaScript

infoworld.com

61–70 of 86 posts

Re: Just Say No to JavaScript

#61
post #53

Earlier quoted context omitted.

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

That's why I test the code and solve the logical issues? The joke was that the language would be smart enough to catch the less obvious stupid mistakes instead of obvious to solve type bugs.

someone once said something to me that stuck: computers are stupid. they do exactly and only what you tell them

Re: Just Say No to JavaScript

#62
JavaScript is a very capable language. It has better functional programming support than Java and Python. It has fewer footguns that C++. You can start with a scrappy prototype then gradually add type-checking later. Of the mainstream languages, it's actually one of the better ones!

Re: Just Say No to JavaScript

#63

This kind of rant, culminating in a hackneyed "created in a week" insult, usually comes from backend developers who jumped into frontend work thinking it was a silly little thing that could be mastered in under an hour, discovered that it was a whole separate field, and still failed to adjust their priors. This time it comes from a "former Delphi product manager" turned clickbait writer. I just hope that my visit wit…

I think you're dismissing his points too quickly. Even if he could be biased and his points could be presented better, I still think that, as a rule of thumb, anything past 1000 lines of code should be statically typed. If you don't have static typing, you have to keep track of the types yourself. It works for small scripts, but IMO it scales quite badly.

Re: Just Say No to JavaScript

#64

Earlier quoted context omitted.

he suggests using typescript, how do you know he didn't use typescript to generate the JavaScript that was used?

not relevant to the inconsistency

It definitely is. His first example is Assembly. That's like saying someone saying 'don't program in assembly' is being hypocritical because everything they program ends up in assembly.

Re: Just Say No to JavaScript

#65
I think the flexibility of JS forces you to be intentional with your code composition in order for it to not be a huge mess, which makes better programmers. With that being said, many programmers don’t want to think that hard so they rely on railroaded overly opinionated languages or write bad JS

Re: Just Say No to JavaScript

#66
"Typing everything allows you to clearly and succinctly declare intentions with your code as well as enforce those intentions throughout your code base. For an application with many developers, being able to clearly and definitively express what code does is a huge advantage over code that requires a fellow developer to spend cognitive energy to figure that out."

Types are definitely useful in the fight to 'make invalid states impossible', but this rather overstates the case. They go only a very little way in documenting intent.

Re: Just Say No to JavaScript

#67

JavaScript is a very capable language. It has better functional programming support than Java and Python. It has fewer footguns that C++. You can start with a scrappy prototype then gradually add type-checking later. Of the mainstream languages, it's actually one of the better ones!

>It has better functional programming support than Java and Python.

Sources - or just an opinion stated as fact?

Re: Just Say No to JavaScript

#68
post #25

I was disappointed to read this is just a "Use TypeScript" instead. Look, you can hot glue and tape all the types you want, but it is still JavaScript. No amount of compiler-enforced comments is changing that.

> it is still JavaScript Yes, it's still one of the most performant languages around, so that's a good thing right?

[deleted]

Re: Just Say No to JavaScript

#70
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 needs a compilation step, and I don't want that

That's such a weird requirement, maybe because I'm used to writing Go code in my day job. I work on some React webapps on the side and there's no way I would miss on TS, typing is just the only way to write code that you can actually refactor. Granted you get some of TypeScript safety for free thanks to `// @ts-check` and friends, but it's the bare minimum.

Post reply on HN