3 ms·
I've got this way with e.g. Typescript and Rust syntax. They're similar in a lot of ways and I write a lot of typescript in my day job and at times my hobby pro
by Macha 6y ago
I've got this way with e.g. Typescript and Rust syntax. They're similar in a lot of ways and I write a lot of typescript in my day job and at times my hobby projects are primarily Rust. Typescript uses semicolons at the end of each field definition in an interface, while Rust uses comma seperators between each field in a struct, and each time I switch from one to the other it takes a while for my brain to remember what language I'm writing (similarly for -> vs : for return type specification). Java, which is the other language I use a lot in work is sufficiently different that I don't seem to run into this.
- matt_kantor 6y ago> Typescript uses semicolons at the end of each field definition in an interface You can use semicolons, commas, or newlines: https://tsplay.dev/wXR7om https://tsplay.dev/wXR7om