Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

This example from the article looks like an argument for immutability to me.

    interface A {
        x: number;
    }
    
    let a: A = {x: 3}
    let b: {x: number | string} = a; 
    b.x = "unsound";
    let x: number = a.x; // unsound
    
    a.x.toFixed(0); // WTF is it?


Kind of, you can't have your cake and eat it too.

When it comes to typing systems you have to pick 2: Depth, Mutability, Soundness




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: