1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 22:36:03 +02:00
comprehensive-rust/src/user-defined-types
Martin Geisler 45bb2de220
Recommend newtypes over type aliases (#2476)
I don't know how controversial this is, but I would recommend against
using type aliases where a newtype can be used instead.

Personally, I don't like type aliases much since I feel they cause extra
indirection: I will inevitably have to go look up the alias the first
many times I encounter it. Nothing will tell me to apply the type alias
consistently, and I dislike having multiple names for the same thing.

But I'm sure some people love them, so now I'm just gently reminding
people that newtypes can be a better alternative.
2024-12-03 16:57:41 +01:00
..
2023-11-29 16:39:24 +01:00
2024-03-15 09:01:41 -04:00
2023-11-29 16:39:24 +01:00
2024-03-15 09:01:41 -04:00