Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MrJohz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
22 ms
·
301.
▲
by
MrJohz
1y ago
This is a philosophical point about what's considered solveable. For example, in the sudoku community, there's this idea of bifurcation, which is when you get to a point in a puzzle where there are two options to take, and you st
302.
▲
by
MrJohz
1y ago
A good sample needs to be random and representative of the population as a whole, otherwise you introduce sampling bias. Imagine trying to do a survey of what people's favourite fast food restaurants are, but doing it inside a McDonal
303.
▲
by
MrJohz
1y ago
I'm not suggesting a custom framework here, I'm suggesting no DI framework at all. No reflection, no extra configuration, no nothing, just composing classes manually using the normal structure of the language. At some point this
304.
▲
by
MrJohz
1y ago
I think the point is that you can already do all of that with hand-wired dependency injection. I wrote about an example of that a couple of years ago here: https://jonathan-frere.com/posts/how-i-do-dependency-injecti...
305.
▲
by
MrJohz
1y ago
Just to clarify because the grammar is a bit ambiguous in your comment: which case do you see as the common case? I suspect in most cases, people don't handle errors where they are thrown, but rather a couple of layers up from that poi
306.
▲
by
MrJohz
1y ago
There's a `catch` with effects as well, though, the effect handler. And it works very similarly to `catch` in that it's not local to the function, but happens somewhere in the calling code. So if you're looking at a function
307.
▲
by
MrJohz
1y ago
> And this cannot be done statically (i.e. your IDE can't jump to the definition), because my_function might be called from any number of places, each with a different handler. I believe this can be done statically (that's on
308.
▲
by
MrJohz
1y ago
Fwiw, most backend frameworks and libraries where this sort of functionality makes sense are already using a polyfilled Symbol.dispose that will transparently work with the real thing if you start using it in an environment that supports it
309.
▲
by
MrJohz
1y ago
Fwiw, I've been using `using` for the last year or so maybe, and I've found exactly one case where I've wanted to create a new explicit scope for the resource. In all other cases, having the resource live as long as the conta
310.
▲
by
MrJohz
1y ago
I wrote about this last year, it's one of my favourite bits of this spec: https://jonathan-frere.com/posts/disposables-in-javascript/#... TL;DR: the problem if you just pass the DisposableStack that you'
311.
▲
by
MrJohz
1y ago
That's also possible, and it's common when using this pattern, but the specific syntax in the original question was I believe property access, and not part of a property literal. I didn't bring that up because I thought my co
312.
▲
by
MrJohz
1y ago
In practice, a lot of stuff has already implemented this using forwards-compatible polyfills. Most of the backend NodeJS ecosystem, for example, already supports a lot of this, and you have been able to use this feature quite effectively fo
313.
▲
by
MrJohz
1y ago
Dynamic property access perhaps? The premise is that you can always access an object's properties using indexing syntax as well as the normal dot syntax. So `object.foo` is the equivalent of `object["foo"]` or `object["f
314.
▲
by
MrJohz
1y ago
On the other hand, as a Brit, I find German abbreviations oddly cutesy and childish — although I think that's just preferring what one grew up with! That said, I don't think you can discuss German jargon without talking about Beam
315.
▲
by
MrJohz
1y ago
Earlier today, it was producing an error that looked as if it couldn't render some elements. Unfortunately, I switched to a different branch where I tried to switch certain things over to Node, and now when I've switched back, th
316.
▲
by
MrJohz
1y ago
I think Deno has done a good job pushing the ecosystem forwards, but I think it has the problem that anything it can do, NodeJS can also implement. Since Deno, NodeJS now follows most browser standards, also allows running Typescript nativ
317.
▲
by
MrJohz
1y ago
The thing I ran into today was jsdom not seeming to work at all in Deno. My use case was trying to run Playwright to scrape a site, copy the resultant HTML into jsdom, then run Mozilla's `readability` module on that to get a summary of
318.
▲
by
MrJohz
1y ago
I don't really get the relation between your comment and mine, I'm sorry. You don't need an address to use the public transport in Germany, for example.
319.
▲
by
MrJohz
1y ago
Here in Germany it's fairly common for kids aged perhaps six or seven and up to take public transport by themselves. They might have a dumb phone or occasionally a smart watch, but I rarely see them with their own smart phones. One of
320.
▲
by
MrJohz
1y ago
In theory, you can completely statically render everything. In practice, every static site I've seen built with React also uses dynamic client-side components, either as a prerendering mechanism, or because there are dynamic toggles a
321.
▲
by
MrJohz
1y ago
I mostly use SolidJS. It's super lightweight - in many ways, it's just a wrapper around `document.createElement` and a signals library - so you've got a lot of flexibility to use it how you want. It works well for complex web
322.
▲
by
MrJohz
1y ago
Of course vanilla JS is superior to any framework in terms of performance. Anything you can do in a framework, you can do directly in vanilla JS. But performance isn't the only issue here, otherwise we'd all be writing a lot mor
323.
▲
by
MrJohz
1y ago
In theory it is completely an implementation detail, I agree. In practice, it's bloat. If every web component I use in my project might pull in a completely different framework behind the scenes (and worse: if those web components de
324.
▲
by
MrJohz
1y ago
The original comment was that "all HTML attrs must have string keys and values", which is completely true. The point of web components is that they create normal HTML elements. So it makes sense to consider what the value of them
325.
▲
by
MrJohz
1y ago
I showed earlier how it takes multiple lines and some fiddling with DOM to set a simple property with vanilla web components. Sure, if you're using a framework like lit, you have access to template binding, but at that point you might
326.
▲
by
MrJohz
1y ago
Sure, that's what we did in the good old days, and there's good reason that most of us, when building more complex components, switched to better state management systems. The main issue is that, typically, if you're storing
327.
▲
by
MrJohz
1y ago
Based on the JS Framework Benchmarks (so caveats apply), an app built with lit-html (i.e. just the HTML templating part, as I understand it) is about the same size as SolidJS, and an app built with lit (i.e. the full framework) is about the
328.
▲
by
MrJohz
1y ago
Yeah, I think the original question was a bit weirdly worded which made people focus on web workers rather than complex data in general. You can use properties (as opposed to attributes) as I demonstrated, and you can use methods like you s
329.
▲
by
MrJohz
1y ago
Could you explain what you mean by "storing it in a variable"? It's perfectly fine to store data in a variable (that's what most frameworks do in the end), but that state needs to be reactive in some way — updating that
330.
▲
by
MrJohz
1y ago
That's not web components, though that's lit-html. That's an additional library you need to pull in to manage your web components. Which kind of ruins a lot of the stated benefits of web components. If I need a framework t
More ›