Hacker News new | ask | show | jobs
by vvillena 2112 days ago
Rust has more syntax than other languages, but it's a cleverly designed language: every bit of syntax has one unique, clear meaning. Every bit of Rust syntax is intentional, and the official Rust documentation helps explain the reason behind it, with the reason usually being "the programmer is forced to make a choice that is usually implicit in other languages, and we want the code to explicitly show the choice the programmer made".
1 comments

I love the intention and the motivation behind the reasons they choose to define new syntax, but in what syntax regards, I tend to prefer less, not more. To me, things aren't clearer by adding more text or context.

"...perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away..." - Antoine de Saint Exupéry

You're overthinking it. Rust's syntax is not that complicated, even if it looks a bit scary before you read the book. For C programmers the real hard part is in semantics of references, which C programmers mistake for general-purpose pointers, and gloss over ownership.

Rust has an intentional well thought-out approach to what it makes explicit[1], which is useful in a language that is focused on control, correctness, and performance. It's not trying to make source code beautiful, it's trying to balance usability of the language with avoidance of surprises caused by implicit compiler magic.

[1]: https://boats.gitlab.io/blog/post/2017-12-27-things-explicit...