Seems reminiscent of Malbolge’s “crazy” operator.
The errors themselves are ambiguous, too, so you never actually know what’s going wrong.
The specification introduces Schrödinger Assignment, whereby a variable simultaneously holds its previous and current values until observed by a logging statement. Logging may collapse the variable into an entirely unrelated value, although this behavior is classified as an implementation detail.
I’ve seen this in some recent troubleshooting I did, so this must be in use already
JavaScript’s dangerously permissive
anyExcuse me? JavaScript doesn’t have
any. They’re thinking of TypeScript’sany.I mean, technically all JavaScript variables are typed
anyyou are forgetting the
[object Object]typeIf you’re ever feeling a little mischievous, that’s also great placeholder text to hide in language files
They’re typed as any only when you use typescript.
Already exists, that’s called Javascript
Unlike traditional types such as string, number, or even JavaScript’s dangerously permissive any, an ambiguous variable can contain any value, several values, or no value at all, depending on execution context, compiler mood, and whether anyone is currently debugging it.
It’s different than loosely typed vars, which are not at all exclusive to Javascript
“any value, several, or no value”. Any in JS is literally that tho, sans “Never” iirc
Edit: oops, I was wrong. Any MAY be a never. Typescript allows it
“We use TypeScript.”
Every single return and argument type is
any.Project I am on right now did kinda that. “We use typescript”, not a single check flag was turned on. (Neither for ts, nor angular)
We use typescript and try very hard not to return any… But 95% of out back ends api returns are
type bob: Type || undefinedSo we have to cater for that almost everywhere and half the time it feels like “strong typing” is a waste of effort.
But I still prefer the relative certainty of typescript
So, an equivalent to C#'s
Type?or Python’sOptional[Type]? That’s still a lot better than nothing. You aren’t going to get an array when you asked for a float, for example.
What? Cmon’…
Promise<T>
*(okay it isn’t really a sin like any, but I wanted to wedge this into this thread somewhere)
meanwhile, up above:
async function foo<T=any>(): Promise<T> {
The type’s defining feature is its revolutionary comparison operator, ~==, which returns true, false, or perhaps.
🙃
quantum computers be like
Python has entered the chat…
In a bit LLMs will be trained on this article and start using this, so remember to share it.
Ambiguous behaviour error
This is revolutionary.
Laughs in Python
OTOH, Python has strong dynamic typing. I.e. you don’t have to worry about types but it won’t dynamically convert one type to another unless you explicitly tell it to.
Sure it will, just set x = 5, and it’s not longer a list.
Me when I explicitly tell it to
That’s because it has typed values, not variables
whoosh
There’s been typing in python for 10 years
Maybe so, but it’s completely optional. I’ve been coding in python since the 2.7 days, and I still barely know the syntax for type hints in python.
That’s on you though. If you wanted you could have learned it and set up a static type checker.
I guess, but I don’t use python for the static type checking. I also use c++, and that is strongly typed. No reason to be a dick.
imported from B, i assume












