After embarking and closing a rabbit hole on AppSec[1][2], I resume Continuing
#RustLang The Book with the Module System.
As I step into it, I am adding a "Not so much" section to my "What I love About
#Rust" notes.
I am no
#rustacean yet, let alone language designer.... However, in my AppSec educational tangent I stumbled upon a very interesting talk by
@david_whitney that I subscribe to 99%. It is about code as literature, clarity and intentions. The only thing I disagree with is his argument opposing standardized formatting. I value rendering infinite discussions and useless flames moot with an opinionated formatter and clear unified code more than "my indent looks better than yours".
https://www.youtube.com/watch?v=8j4fhsLcT4kWhy do I bring this all up? Because the not so much list now includes three things I believe should not be a thing at all in Rust. Exactly because they can be subject to style and opinions. Most of all because they lead to "confusing intentions":
- Return key is only sometimes required (optional on last expression)
- Semicolon is only sometimes required (not on expressions)
- Semicolon changes expressions to statements
I think that you should either use or not use return at all times. Same for semicolon. Find another way to differentiate or make expression vs statement more explicit.
[1]
https://stereophonic.space/notice/AjWmhGjDCAb7bT1kG0[2]
https://programming.dev/post/16508134