5 ms·
Both Rust and Golang have optional parens and mandatory braces, so for the same number of keystrokes one would have something more like: if ptr { call_olds
by KMag 11y ago
Both Rust and Golang have optional parens and mandatory braces, so for the same number of keystrokes one would have something more like:
if ptr { call_oldschool_thingy(ptr) }
(Keystroke count isn't an important metric for me, but apparently very important to some people.)
- GolDDranks 11y agoI love this style. Braceless style always breaks when refactoring or adding/removing debug logging – so it makes sense to make the braces mandatory. And then, because you have a delimiting if and the starting brace, you don't need to have the parenthesis. Great! Now if only Rust supported the elision of ; ... (Yeah, I know that they have a reason to not do that, but I don't buy it.)