Live data from Hacker News

Just Say No to JavaScript

infoworld.com

31–40 of 86 posts

Re: Just Say No to JavaScript

#31

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 love JS. Well, that's not true. I love it, and then I hate it, and then I love it again. And I am not sure how to respond. It has warts. I have seen a staggering amount of flavors / styles of JS. It is a really expressive language. But that is kind of a cope. You will figure out how to express your wildest ideas. But you will struggle to read others code. Multithreading is...weird to say the least. Are people spinn…

At this point my only hope is that they bake TS into the JS engines so that we could use type information at runtime. It's too entrenched to replace otherwise unless we jump into a new UI paradigm.

Re: Just Say No to JavaScript

#32

Earlier quoted context omitted.

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

My job is to produce more value than I cost. Otherwise you're going to get laid off anyways.

Atta boy

https://ih1.redbubble.net/image.4938275797.9978/fposter,medi...

Re: Just Say No to JavaScript

#33
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…

Types give you much more than just getting an error early when you call the wrong method on an object or pass a string where you needed a number.

Once you have written down the shape of the data flowing through your program in a way that a compiler can check you'll be able to reason about the whole program better and you might find issues much faster.

I think that types can directly help a lot with logic errors as well: one of the things people say most often when discussing typed programming language is that you can make illegal states unrepresentable, which means that you can encode logic into the type system itself.

Re: Just Say No to JavaScript

#34
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…

> My errors are never type related

Over the years I feel like I have read this comment at least ten times from different commenters (and the second time this month) and I cannot really fathom it. I consider myself a pretty good developer, and I have type errors many times a day. It is perhaps the most common error I encounter, and thankfully one of of easiest to fix with static typing.

By far the biggest recent productivity gain I have made using types is by generating the types along with client code for APIs via a swagger doc. I cannot overstate the value in seeing the types update when the backend devs have changed the API, and getting a compiler error when it doesn’t match with your code. By having the types the next developer after me is going to be spending far less time getting up to speed with the codebase.

I started programming with static types early in my career so perhaps I have become wired to lean heavily on the type system.

Re: Just Say No to JavaScript

#35
I'm a fan of TS, and have no issue with people's opinions on programming languages. But come on, the whole "built in a week" thing is pretty tired at this point. There have been many, many major iterations on Javascript since the 90s. There's nothing inherently wrong with vanilla JS these days. It has a few quirks like every language does, but overall generally does what you expect it to do.

Re: Just Say No to JavaScript

#36
How disappointing.

It is not at all "say no to JS". It's "use my preferred flavour of JS instead."

I want to return to the pre-JS internet and especially the pre-JS Web.

Say no to Javascript at all in any variant. Also say no to PHP. Nothing of lasting value to humanity would be lost if both of them went away completely, forever.

Re: Just Say No to JavaScript

#37
I don't get the "type checking is the solution for the problems of the world". A lot of good things were/are written without type checking. Most of the problems I see in production have nothing to do with the wrong type being used or some forgotten required parameter. Also, typescript is just javascript with a mustache. It's the same thing

Re: Just Say No to JavaScript

#38

I don't get the "type checking is the solution for the problems of the world". A lot of good things were/are written without type checking. Most of the problems I see in production have nothing to do with the wrong type being used or some forgotten required parameter. Also, typescript is just javascript with a mustache. It's the same thing

yes, but they could have been made robust quicker with types. You still have types in untyped code, they're just in your head and the runtime doesn't know about them. That means you have to be extra thorough to do the type checking manually yourself, and having to write even more tests to validate your types and all those implicit assumptions

Re: Just Say No to JavaScript

#39
I thought this was a parody of Guardian-style opinion columns at first. You know, "I have a strong opinion and here are Y meandering and mildly amusing/lighthearted reasons why" op-eds.

I like opinion columns and would love to see more about software development, but this one feels like it's going for the lowest of hanging fruit. Anyone who cares about JavaScript either way will already have an opinion and won't be won over by a humorous take.

I do like the author's style though, so don't interpret this as crapping on his work. Looking at the "More from this author", it seems this is his genuine style, and I found some of his other pieces to be good reads. More please.

Re: Just Say No to JavaScript

#40
post #4

The author seems to ignore the fact that type hints are a thing even with plain JS. Serious question: does the author "just say no to Python" as well? If lack of explicit typing is the issue, then his rant would apply to most scripting languages and to single out JS seems odd to me...

Python actually has a good typed ecosystem these days, and unlike JS -> TS you don't have to add a compilation step to benefit from it: you just have to enable type checking in your IDE.

JS is in a different spot where to benefit from type checking you have to add a build step or reconfigure your build tool, switch files to another extension, add some "type stubs" dependencies, and make significant changes to the codebase to benefit from type checking.

I think if Node and the browsers started allowing type hints in their parsers you'd see much less resistance to TypeScript.

Other scripting languages are probably not popular enough to matter as much as JS does.

Post reply on HN