Dusty Pomerleau on Nostr: I hear people saying that it’s good to use meaningful names for generics and ...
I hear people saying that it’s good to use meaningful names for generics and lifetimes in #RustLang, but I think that conditioning plays a role. If you are trained to immediately understand `’a’ and ’T’ as having certain meanings, then foreign codebases that follow such conventions feel familiar. When they use `’meaningful’ and `Meaningful` instead, it takes your brain some extra cycles to catch up. Since generics often have trait bounds, the bounds do a good job of communicating intent anyway.
Published at
2024-10-06 23:44:49Event JSON
{
"id": "0df0e58e49574f4a7cdb8471c34056ae5d98d050883354a5891cdbe44dcfc09d",
"pubkey": "5bdfe5c3188a24f76efd37648930d8ada3e458961d03b2e0d62596d4f76e4778",
"created_at": 1728258289,
"kind": 1,
"tags": [
[
"t",
"rustlang"
],
[
"proxy",
"https://fosstodon.org/users/dpom/statuses/113263135287534812",
"activitypub"
]
],
"content": "I hear people saying that it’s good to use meaningful names for generics and lifetimes in #RustLang, but I think that conditioning plays a role. If you are trained to immediately understand `’a’ and ’T’ as having certain meanings, then foreign codebases that follow such conventions feel familiar. When they use `’meaningful’ and `Meaningful` instead, it takes your brain some extra cycles to catch up. Since generics often have trait bounds, the bounds do a good job of communicating intent anyway.",
"sig": "d2f23ebd99138a55a621e35d47a60fed389d22e908f6d2fc0918e9a9cb5cb37760aaca52bb57d4bebd27f21a3e3cd46b63a52aaa3722e8056643922a440fe3ab"
}