Deleted Comment
https://www.reddit.com/r/learnjavascript/comments/qdmzio/dif...
or anything that touches array ops (concatenating, map, etc…). I mean, better and more knowledgeable people than me have written thousands of articles about those footguns and many more.
I am not a webdev, I don't want to remember those things, but more often than I would wish, I have to interop with JS, and then I'd rather use a better behaved language that compiles down to JS (there are many very good ones, nowadays) than deal with JS directly, and pray for the best.
OTOH I think JS has great ergonomics especially wrt closures which a number of popular languages get wrong. Arrow functions provide a syntactically pleasant way to write lambdas, let/const having per iteration binding in loops to avoid nasty surprises when capturing variables, and a good number of standard methods that exploit them (eg map/filter on arrays). I also think, though a lot of people would disagree because of function coloring, that built-in async is a great boon for a scripting languages, you can do long operations like IO without having to worry about threading or locking up a thread, so you get to work with a single threaded mental model with a good few sharp edges removed.
Firefox is steadily losing market share, and any attempts to do something about it are met with negativity. The 2-4% of users who use it care about their privacy. But they are not being deprived of it; the AI tab is optional, and no one is removing the regular tab. (Of course, it would be better if they allowed the integration of local models or aggregators, such as Openrouter, Huggingface...)
Meanwhile, developers continue to ignore Firefox, testing only Chromium browsers. Large companies are also choosing the Chromium engine for their browsers.
Perhaps if they implement this functionality conveniently, more average users will use Firefox.
I guess you can attach a debugger for unit tests, but that's not very useful.
That is in fact incredibly useful
> You can use arithmetics to go branchless.
if (a[i] > 0) {
cnt++;
}
> Rewriting using arithmetic takes advantage of the fact that the expression a[i] > 0 has an arithmetic value 1 if true and 0 if false. So the whole expression can be rewritten as: cnt += a[i]The reason I first discovered "don't kill my app" is that my apps would close as soon as I switched to another one, in most cases. For example if I used maps and switched to a call / browser tab / Telegram chat, when I got back to the map the app would reload. My search would be gone, and I would have to set my destination again.
I hope you can agree that this is terrible user experience. If I wanted to save battery, I could have just closed my apps manually, I don't need my phone to take the initiative.
- no private properties (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...)
- no readonly properties: You can use a getter. Or define the property as non-writable, the syntax isn't nice but in my opinion it's still much nicer than what the article proposes.
Some of the points are just a matter of taste ("this" is awkward)
There's the implementation itself which forces you to use non-idiomatic code for no good reason or benefit (Class.init instead of new, just why? You can absolutely return a constructor function there while preserving everything else)
Doing what the article proposes also destroys the ability to do instanceof checks because the prototype of instances is not set (can be fixed), and inheritance is severely limited if you want to preserve any of the purported benefits. You might say that inheritance is actually not a good thing and so it's a feature, not a bug, but if that's your opinion why are you trying to mimic a class?
I played quite a few hours of the game, both alone and together with a couple of friends.
One day, after a couple of weeks or something, I learned about a crafting wiki that told you how to craft different items.
At the time, at least for me, it was not clear how you figure out what items you can craft and what items need to be combined in what patterns to craft those new items.
So for me, that crafting wiki became quite essential.
Maybe other people were figuring out how to craft things by trial and error? Or maybe there was something in the game that told them how to craft specific things?
> you still have guilty parties going free anyways since the wrong person is convicted
which is a non sequitur.