News for hackers. Stuff that matters.
Re:Be wary of functions which take several parameters of the... by tomjakubowski on Thursday September 26, 2019 @09:59PM (#21087715)
De-structuring syntax isn't required, this is just as easily type-checked:

    interface CopyArgs {
        src: string;
        dst: string;
    }

    function copy(args: CopyArgs) {
        exec(["cp", args.src, args.dst])
    }
Re:Be wary of functions which take several parameters of the... by thelazydogsback on Friday September 27, 2019 @12:13AM (#21088342)
Sure, if you want to get all interfacy - but pretty soon it'll be Java :)
Re:Be wary of functions which take several parameters of the... by davedx on Friday September 27, 2019 @07:16AM (#21090613)
Hah I thought that initially, but TypeScript interfaces are simpler (and usually co-sited) compared to their OO cousins. I find them a pleasure to use.