News for hackers. Stuff that matters.
Re:Crabtime: Zig's Comptime in Rust by Lerc on Sunday March 23, 2025 @05:44AM (#43451869)
A lot of that is what I had in mind. Things like for...of and let fix glaring problems by introducing new things instead of changing to maintain backwards compatibility.

A lot of the fixes are just removing the old broken way of doing things.

I'd still probably change 'for x of ...' to implicitly be 'const x' and require let if you are doing shenanigans with changing the values.

I am surprisingly ok with null and undefined. Null means not a thing, undefined means there is not even the notion of the thing.

I'm pretty sure there are more than three ways to declare a variable.

    x=5
    let x=5
    var x=5
    window.x=5
    window["x"]=5   //arguably the same as above.
    Object.defineProperty(window,"x",{value:5}) 
    Object.assign(window,{x:5})
at least
Re:Crabtime: Zig's Comptime in Rust by paulddraper on Sunday March 23, 2025 @04:00PM (#43455445)
Many of those are setting properties, not variables.

A variable reference can lookup properties on the global object, or other objects with ‘with’

Re:Crabtime: Zig's Comptime in Rust by int_19h on Monday March 24, 2025 @06:07PM (#43465915)
> Null means not a thing, undefined means there is not even the notion of the thing.

If only "undefined" was consistently the same as lack of variable / collection entry, it would be understandable. But as things are, {x: 1, y: undefined} is not the same as {x: 1} in many ways - indeed, so much so that TS distinguishes between these two cases in its type system.