3 ms·
Ah, I should've been more explicit that I was referring to programming language syntax. For example, this is unfortunately not the convention in Python, Rust, S
by agalunar 3y ago
Ah, I should've been more explicit that I was referring to programming language syntax. For example, this is unfortunately not the convention in Python, Rust, Swift, or TypeScript.
- dvt 3y agoAh gotcha, I actually 100% agree here. I think both the parser (and my brain) would probably be better served by space on both sides of a variable : type (or type : variable) declaration.
- chrisweekly 3y agoFor my part, while I have some mixed feelings about introducing whitespace signifigance, I sympathize w the OP and in TypeScript projects, have sometimes wished for more intuitive disambiguation. As for conventions, I might prefer key: value (trailing space for eg JS props), vs foo :type (leading space for types)
- EarthLaunch 3y agoI try to do this at home [eg 0] and it flabbergasted some coworkers when one such notation accidentally slipped into a day job PR last year. I didn't try to argue for it- but I like it personally, mainly for making control flow easier to skim. 0: https://github.com/Suncapped/babs/blob/prod/src/shared/SharedZone.ts https://github.com/Suncapped/babs/blob/prod/src/shared/Share...