Live data from Hacker News

Just Say No to JavaScript

infoworld.com

41–50 of 86 posts

Re: Just Say No to JavaScript

#41

Meanwhile in lisp world no one really cries about type errors. I wonder why

Because Common Lisp has a pretty strong type system. Also at least with SBCL you have some support for gradual typing. Plus REPL-driven development means you catch many errors early on anyway.

The issue with JS is weak typing. Also programmers mostly using batch style programming makes it more frustrating though the browser dev tools are decent.

Dynamic typing is not an issue. Gradual typing can be added later on to an language. JS just needs to add syntax support for type hints so you don't need to rely on JSDOC. The weak typing is a serious design flaw and can't be fixed in a backward compatible way. Maybe with an explicit opt in where you declare types strong is the beginning of your file but that would make JS engines more complicated as they would need to support both and I don't see it realistically happening but one can dream.

Re: Just Say No to JavaScript

#42
post #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.

Hi Liam,

What about dynamic websites? For example, a platform-independent chat app. Javascript has a place, although that place would be better filled by another language. PHP... yes, PHP can be completely replaced by other server side frameworks.

Re: Just Say No to JavaScript

#43

Post "Say no to JavaScript" on a website that heavily uses javascript... ironic

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

Re: Just Say No to JavaScript

#44
post #8

I'll happily use TypeScript for all my UI components, libraries and server code, most of the time with Bun thanks to its OOB support for TypeScript. But for Web UIs I'll drop down to a #NoBuild "Simple, Modern JavaScript" [1] i.e. using JS Modules + JSDoc Type Annotations to avoid needing any npm modules/build steps/etc. I still benefit from a library's TypeScript definitions/VS Code intelli-sense/static analysis/etc…

I use Bun too, and I found that in many cases `bun build` is a small enough sacrifice to be able to use Typescript... after a certain size maintaining pure Javascript code becomes too difficult for me

Re: Just Say No to JavaScript

#45

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…

> So writing off the criticism

The issue I take is that the criticism is vague and outdated. "It was built in a week" is the only direct piece of criticism, which is simply no longer valid. The JS that was built in a week is long dead.

In fact, the whole article is about how TS = good and JS = bad. Except that Javascript is valid Typescript. So every wart or issue that exists in JS also exists in TS, with the exception of a layer of type safety.

Re: Just Say No to JavaScript

#46
post #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.

Any system can get messy when the project size grows. Defect rates seem to be correlated with the addition of new features. Stable projects only including bug fixes with good test coverage become more stable over time. This is all regardless of language. There may be a case that typed languages ship with fewer initial defects in new features but I'm not entirely convinced it's always competitive with the return in de…

> the return in development speed

Solo project or very small team then? When everyone understands all code?

Of course it's faster to go type less then.

Add 4 more people and you'll end up debugging runtime errors because it was intuitive what you should send to $COLLEAGUE's functions but in reality they expect something else.

Or at best, $COLLEAGUE will document the type info in comments :)

Re: Just Say No to JavaScript

#48
post #11

Earlier quoted context omitted.

>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 we…

That might be interesting, I'll check for some examples.

Re: Just Say No to JavaScript

#49

Meanwhile in lisp world no one really cries about type errors. I wonder why

Because Common Lisp has a pretty strong type system. Also at least with SBCL you have some support for gradual typing. Plus REPL-driven development means you catch many errors early on anyway. The issue with JS is weak typing. Also programmers mostly using batch style programming makes it more frustrating though the browser dev tools are decent. Dynamic typing is not an issue. Gradual typing can be added later on to…

The difference in parenting styles to raising good programmers in extremes like Rust and Common Lisp seems to be one of spanking and being a friend

Re: Just Say No to JavaScript

#50
post #11

Earlier quoted context omitted.

>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 produ…

My first programming language was C/C++ and I learned dynamically typed languages after, I still prefer the dynamically type languages. I still do a lot of C/C++ code for micro controllers and the types are so annoying, either create a function for both ints and floats, templates or you cast the type. It's all so tedious, boring and uninteresting.

I have made a lot of code that works on a lot of third party APIs (The major LLMS, Image generators, E-commerce stuff) and yea it's all been easy breezy and never thought I wish I had types.

Different people just work in different ways.

Post reply on HN