|
|
|
|
|
by alpaca128
1205 days ago
|
|
> It's just that the end result of a bunch of sensible design decisions is that initialising arrays of structs is clunky. Yes, though at least the language gives you tools to make it more convenient. In the previous examples that would be constructors, and macros can help too (`println`, `vec` etc. exist for that reason). I myself like to create tiny macros to shorten things like `UnicodeSegmentation::graphemes(s, true).count()` when I have to properly handle unicode. Sure I would prefer to have it be shorter from the start, though that wouldn't make it as obvious how expensive the operation is compared to just getting the size in bytes. |
|