WTF Bites
-
@Medinoc Whatever is in the
module.exports
property the imported module sets. It could be an object, a function, a string, whatever.
-
And how can a
const
ant be computed (when?) from its return?The
const
keyword only means the variable cannot be re-assigned later, but otherwise it is like any other variable that is computed when the code is executed. JavaScript is a dynamic language and does not have a compilation step with restricted evaluation capabilities where constants would be set.
-
@Bulb So more like
final
in java?
-
@Bulb So more like
final
in java?Oddly enough, I haven't had the object is mutable but I marked it final conversation for a while.
-
@Zecc Ah thanks, it makes some twisted kind of sense now.
-
@DogsB Yeah,
final
(on a non-scalar) just means that specific variable cannot be pointed to a different object. It doesn't mean the pointed object cannot be mutated.
-
@Zecc Ah thanks, it makes some twisted kind of sense now.
Now, this is only one way of including code in nodejs, and it's being phased out. Nowdays we have ESM (ECMAScript modules) which also work in the browser. The difference is that
require()
performs synchronous read and can be called from wherever you like, whileimport
runs async, possibly in parallel, before the rest of the code is executed. Simple enough. Now, due to very late introduction of ESM, most libraries have dependencies that require transpilation of CommonJS to ESM or vice versa, and typescript requires different magic configs for compatibility with both. Makes sense, right?
-
@Bulb So more like
final
in java?It's not like C++'s
const
actually worked differently. You still can have arbitrary code in the initializer of aconst
variable, and at function scope it will be executed in sequence in the function.Well, there is one important difference. In C++ it is a property of the type while in Java and JavaScript it is property of the variable.
@DogsB Yeah,
final
(on a non-scalar) just means that specific variable cannot be pointed to a different object. It doesn't mean the pointed object cannot be mutated.Which is true of JavaScript as well. To make
const
transitive, it would have to be a property of the type, but JavaScript does not have declared types.
-
@Bulb But while I can do
const pi = 4 * atan(1);
in javascript, I cannot do that in C.
-
@PleegWat At function scope … you can do it C and C++. And while in C you can't do it at file scope, in C++ you can. But top-level JavaScript should be considered a function scope of main anyway.
-
@Zecc Ah thanks, it makes some twisted kind of sense now.
Until you realise that there are now 3 initialisers for variables in JavaScript:
const: figure out what this is, and don’t let anything change it after (this also works for async functions to async get the result, assign it and then it becomes immutable)
let: declare the variable as mutable
var: declare the variable as mutable, the old wayIm not actually sure what the difference between let and var is. I don’t write enough JS to care, but I think it’s scope such that let is bound to a given scope while var isn’t. Or some such.
All I know is that now we have 3 and var still works from ye olden times and that’s mostly good enough for me.
-
but I think it’s scope such that let is bound to a given scope while var isn’t.
You are basically correct.
let
is scoped from the point it appears to the end of block whilevar
is scoped for the whole function, even before the point it appears—which leads to some weird behaviors and thus introduction of the less surprisinglet
.
-
@Bulb Inb4 constexpr, constinit and consteval. Also if constexpr vs if consteval vs if( std::is_constant_evaluated() ), but not if constexpr( std::is_constant_evaluated() ).
I like C++, but some things are getting a bit ridiculous. And I'm not even sure we're done with all the different types of const-ness yet.
-
@Arantor There's also assignment without declaration if you don't care about being strict.
-
@Bulb Inb4 constexpr, constinit and consteval. Also if constexpr vs if consteval vs if( std::is_constant_evaluated() ), but not if constexpr( std::is_constant_evaluated() ).
I like C++, but some things are getting a bit ridiculous. And I'm not even sure we're done with all the different types of const-ness yet.
These kids and their newfangled
constexpr
s .constexpr
does not really bring new semantics, just restrictions that allow the expressions to be calculated at compile time. JavaScript has no compile time, so it does not need that distinction.
-
@Arantor There's also assignment without declaration if you don't care about being strict.
Modern JS is a bit more pissy about that sort of thing. Especially if you’re using any of the compiler/minifier/uglifier/bullshit tool chains.
-
@Zecc I feel like it need extra eightStrings definitions, such as huit, acht, oito, and most importantly of all, wyth.
Don't forget οκτώ, 八, and ثمانية.
-
@HardwareGeek said in WTF Bites:
@Zecc I feel like it need extra eightStrings definitions, such as huit, acht, oito, and most importantly of all, wyth.
Don't forget οκτώ, 八, and ثمانية.
The most important thing though: there should be eight of them... and that fact should be not used anywhere other than the tests.
-
@HardwareGeek said in WTF Bites:
@Zecc I feel like it need extra eightStrings definitions, such as huit, acht, oito, and most importantly of all, wyth.
Don't forget οκτώ, 八, and ثمانية.
The most important thing though: there should be eight of them... and that fact should be not used anywhere other than the tests.
Exactly, it has 4, I suggested another 4 for the round 8.
-
-
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
-
@Benjamin-Hall said in WTF Bites:
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
I'd say it's more cube.
-
@Benjamin-Hall said in WTF Bites:
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
I'd say it's more cube.
Why must you be so rational?
-
@Benjamin-Hall said in WTF Bites:
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
I'd say it's more cube.
Now, normal people, when they think of a cube, think of 6 faces, not 8 vertices. You want an octaeder.
People who think of 12 edges are just weird.
-
@PleegWat You've made me think, just to be contrarian, of a square pyramid.
-
@Benjamin-Hall said in WTF Bites:
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
I'd say it's more cube.
Now, normal people
Found your bad assumption
-
normal people
Try not to me overwhelmed by my amazing sculpting skills.
-
@Zecc Shouldn't they be standing on the faces? Vertices don't have normals, surfaces do.
-
@Bulb
no-neck figures don't follow your rules
-
Vertices don't have normals
Computer graphics disagrees with you.
Besides, those are perfectly cromulent normals if you try to approximate a sphere with a cube.
-
@Zecc Shouldn't they be standing on the faces? Vertices don't have normals, surfaces do.
Vertices can have normals. They are the average of the normals of the faces surrounding them if you want smooth shading. If you don't want smooth shading they can even have more than one normal!
Besides, there are micro-faces in there since the edges are beveled.
Anyway, the point was to have eight humans in there (although one is hidden behind the cube).
-
@Benjamin-Hall said in WTF Bites:
@HardwareGeek said in WTF Bites:
the round 8
As opposed to the square 8?
Shouldn't that be the octagonal 8?
I'd say it's more cube.
Now, normal people, when they think of a cube, think of 6 faces, not 8 vertices. You want an octagon.
People who think of 12 edges are just weird.
Also also, at some point, you'll come around two my point of view.
-
People who think of 12 edges are just weird.
the first one from Microsoft is bad enough, I shudder to imagine multiple, let alone that many.
-
@Arantor Too late. My Edge is already 10 times that, at version 122.
-
@Arantor Too late. My Edge is already 10 times that, at version 122.
But presumably you only have the one of them at a time? It’s not that you have Edge 12 (or Edge 122, though Edge 12 was the first version), but that you have 12 of them installed…
-
@Arantor I was thinking if I could have 12 installed across all my Edge-compatible devices, but I don't think I got that many (unless I cheat with VMs).
-
@Arantor I was thinking if I could have 12 installed across all my Edge-compatible devices, but I don't think I got that many (unless I cheat with VMs).
Yes but why would you do that to yourself?
-
@Arantor Masochistic tendencies.
-
Try not to me overwhelmed by my amazing sculpting skills.
As opposed to your typing ones...
-
@dcon :|
On a more positive note, at least I typed "overwhelmed" correctly before posting.
-
-
@HardwareGeek said in WTF Bites:
-
-
@Watson it doesn't seem to be too hard
-
-
I also love how Stuart Semple - another artist - is sufficiently pissed over Vantablack being licensed exclusively to Kapoor that a) he went out of his way to invent new blacks, such as Black 3.0 and Black 4.0, and as per https://culturehustle.com/ refuses to let Kapoor buy them, or even let anyone buy his products for Kapoor.
Even the cookie banners refer to this pissing match. That’s some level of grudge right there.
-
I also love how Stuart Semple - another artist - is sufficiently pissed over Vantablack being licensed exclusively to Kapoor that a) he went out of his way to invent new blacks, such as Black 3.0 and Black 4.0, and as per https://culturehustle.com/ refuses to let Kapoor buy them, or even let anyone buy his products for Kapoor.
Even the cookie banners refer to this pissing match. That’s some level of grudge right there.
I wonder if the potions are drinkable.
they're non-toxic but say do not drink.
-
@Arantor The most evil:
Rather than hoard these amazing creations to use all for himself, so that he and he alone could wield the power of the colouriest colours, Stuart Semple made culturehustle.com to share these potent concoctions of his with all artists (except one - his arch nemesis Kapoor the colour hoarder).
-
@Atazhaia yup, Kapoor has exclusive artistic licence to use Vantablack.
-
I also love how Stuart Semple - another artist - is sufficiently pissed over Vantablack being licensed exclusively to Kapoor that a) he went out of his way to invent new blacks, such as Black 3.0 and Black 4.0, and as per https://culturehustle.com/ refuses to let Kapoor buy them, or even let anyone buy his products for Kapoor.
Even the cookie banners refer to this pissing match. That’s some level of grudge right there.
They missed an opportunity to make this rotating number 4 look more like a middle finger from another perspective.