Live data from Hacker News

Deno Is Webby

blog.jim-nielsen.com

121–130 of 215 posts

Re: Deno Is Webby

#121

Earlier quoted context omitted.

> not promoted as some sort of better alternative to JavaScript, because it's really not. This leaves me skeptical if you have extensive experience with Typescript. It's way more than "oh this is a number not a string." It's "you forgot this property on an object's return type that you built from a response value" or "your Redux reducer doesn't handle all of the possible action types so it will crash at run time"

Deno attempts to provide a standalone tool for quickly scripting complex functionality. That's from Deno's home page. What I'm talking about isn't whether TypeScript is useful for some projects, as that has been proven beyond question. What I'm saying is that as a tool for "quickly scripting", as claimed by Deno, it is unnecessary and counter productive to JavaScript as a whole. My point is that the Deno project is a…

There is zero practical downside to using `const` whenever possible, and my (Fortune 100) team's backend has been using a NoSQL database for years which has saved us an absolute ton in hosting costs. Hardly a "debacle."

Our solution is the right way to do things... for ourselves. Sorry that it upsets you.

Re: Deno Is Webby

#122

Earlier quoted context omitted.

I think it's even worse than that, because by being "webby" here Deno has committed itself to alert(); multiple browser vendors (including Mozilla) have advocated removing alert() from the web platform. (They want to do that because alert() "stops the world" by blocking the main thread event loop, and because they make it easy for a site to post a message that appears to come from Chrome itself, or from another websi…

>beforeunload handlers ooh no, how will sites tell me that my free offer will expire if I navigate away? But on the serious side, this is useful for many antiquated apps (e.g. government stuff) that break tons of stuff if you attempt to re-submit a form, use the back button, etc, so I see that causing a ton of problems.

Yeah, especially after having had it for years, business leaders just do not understand why the browser would remove such a useful feature. And then you get questions like “So? Can we just stick with IE 10 then?”

I still haven’t found a way to consistently send a request while the tab/browser is closing.

Re: Deno Is Webby

#123
post #50

Earlier quoted context omitted.

> I have spent a fair amount of time over the last several years trying to make node act like the browser, or vice versa. And the right thing to resist doing either. It's to think about what "services" your program actually needs to be able to function and then to isolate those parts from the rest of your application by putting it behind a well-defined interface. In other words, the best way to fix the incompatibilit…

> In other words, the best way to fix the incompatibility problem caused by API mismatches is to never make the mistake of coding directly against the host platform's APIs to begin with. Trying to do it with compatibility shims to make one platform look like the other is a fool's errand. You end up running around trying to achieve parity with a mammoth API surface area (which might never have been especially well-des…

I'm referring to compatibility shims like the ones described: where you have two platforms, so you try to make one look like the other and then target that. I'm saying don't do that.

> Do you believe we should avoid coding directly against the host platform's APIs, or do believe we should avoid compatibility shims?

Avoid compatibility shims that lead to you writing your application's logic directly against platform APIs.

You recognize that you need to read a file, so you write your application logic against the simplest possible interface you can think of that would let you do that: `read`.* You don't try to emulate either platform's API. This sounds like a bad deal, because neither platform provides native support for this interface, and the other approach is tempting, because you already get one implementation of the API for "free" (on whatever platform where that API is native), and you'd "only" have to write the compatibility shim for the other one (or re-use somebody else's shim). This is a mistake. For one thing, people end up misjudging the cost/benefits of each, and for another, the compatibility shim doesn't make the program easier to understand. You end up with quirks of that API infecting increasingly more parts of the program.

* What you don't do is go off and design the best, elaborate, pluggable, most extensible abstraction layer that you can think of. You implement `read`.

Re: Deno Is Webby

#124

Earlier quoted context omitted.

> not promoted as some sort of better alternative to JavaScript, because it's really not. This leaves me skeptical if you have extensive experience with Typescript. It's way more than "oh this is a number not a string." It's "you forgot this property on an object's return type that you built from a response value" or "your Redux reducer doesn't handle all of the possible action types so it will crash at run time"

"your Redux reducer doesn't handle all of the possible action types so it will crash at run time" And what are all these dr. Strange multiverse possibilities you speak of? Any semi seasoned JS dev has spidey sense for watching out for null and undefined, and generally you should know the type of what you are returning. Is there that much variability in what you are dealing with? If it’s an array of objects, that’s no…

> Any semi seasoned JS dev has spidey sense for watching out for null and undefined

That comment reeks of the same biases that C/C++ developers make when they admit that a majority of C/C++ bugs are related to hard-to-detect pointer/memory safety issues, but claim that they're a good C/C++ developer because their own code doesn't have such bugs, despite the bugs by their very nature being hard-to-detect.

Re: Deno Is Webby

#125

Earlier quoted context omitted.

That does seem like it will break a common pattern in web app code that runs both in browsers and on a server (such as a React app with server-side rendering) to determine whether you’re on the browser or the server, which is to check if typeof window === “undefined”.

A lot of the time that pattern is written, it's because the APIs from the web and Node are different and will break if you call something that's not isomorphic. Perhaps Deno fixes that as well and the pattern isn't needed in the first place. Obviously not every case though.

In my experience, I've never seen that used just because the API is different. There are polyfills for fetch and other things, to align node and the browser. When I've seen that check, it's been entirely because the DOM API was needed. Or fetching was required on the client-side only.

Re: Deno Is Webby

#127

Earlier quoted context omitted.

"your Redux reducer doesn't handle all of the possible action types so it will crash at run time" And what are all these dr. Strange multiverse possibilities you speak of? Any semi seasoned JS dev has spidey sense for watching out for null and undefined, and generally you should know the type of what you are returning. Is there that much variability in what you are dealing with? If it’s an array of objects, that’s no…

> Any semi seasoned JS dev has spidey sense for watching out for null and undefined That comment reeks of the same biases that C/C++ developers make when they admit that a majority of C/C++ bugs are related to hard-to-detect pointer/memory safety issues, but claim that they're a good C/C++ developer because their own code doesn't have such bugs, despite the bugs by their very nature being hard-to-detect.

[deleted]

Re: Deno Is Webby

#128

Earlier quoted context omitted.

> not promoted as some sort of better alternative to JavaScript, because it's really not. This leaves me skeptical if you have extensive experience with Typescript. It's way more than "oh this is a number not a string." It's "you forgot this property on an object's return type that you built from a response value" or "your Redux reducer doesn't handle all of the possible action types so it will crash at run time"

Deno attempts to provide a standalone tool for quickly scripting complex functionality. That's from Deno's home page. What I'm talking about isn't whether TypeScript is useful for some projects, as that has been proven beyond question. What I'm saying is that as a tool for "quickly scripting", as claimed by Deno, it is unnecessary and counter productive to JavaScript as a whole. My point is that the Deno project is a…

How are NoSQL databases "bad" and should in general? The term "NoSQL" in itself is very inclusive and might include databases such as redis, elasticsearch or apache cassandra.a

It's important to choose the right tool for the job and SQL/ relational DBs fit many usecases but are not always the right choice. Especially when handling massive amounts of data, that can fit into structures such as wide-column stores, databases like scylla or columnar storage with clickhouse, can help massively.

Re: Deno Is Webby

#129

Earlier quoted context omitted.

"your Redux reducer doesn't handle all of the possible action types so it will crash at run time" And what are all these dr. Strange multiverse possibilities you speak of? Any semi seasoned JS dev has spidey sense for watching out for null and undefined, and generally you should know the type of what you are returning. Is there that much variability in what you are dealing with? If it’s an array of objects, that’s no…

I am not a web dev at all but having something for automatic verification (even if limited) sounds more reliable than the variability of any given dev's "spidey sense".

[deleted]

Re: Deno Is Webby

#130

Earlier quoted context omitted.

Not GP, but I really like [] being false in ruby and python because I often want to ask "is this variable that should hold a collection holding a collection of things, or is it empty/false?"

Luckily, most languages have a `.empty()` method! You should use that instead for readability purposes.

And in that vein, JS has some().
Post reply on HN