Greg on Nostr: One pattern I find in my #rust code, or at least a subconscious behavior I have, is ...
One pattern I find in my #rust code, or at least a subconscious behavior I have, is not using lifetime annotations much. I'm not sure if that is good or bad. I have written lots of C and C++, so maybe I have a habit of moving/borrowing memory, and keeping a mental model of a lifetime already, without annotations. I wonder if my code could be better, though, if I leaned more on explicit lifetimes, and if better means any of "more efficient" or "more readable." #softwaredevelopment
Published at
2024-01-16 20:08:13Event JSON
{
"id": "b4abf7788a43cb4396d4ca348e8cee14321d9faca708b5c8c10640620327b117",
"pubkey": "52ad7b2c879736c5b966aa5b175d2d14563ab6a167078a7c9d35f421083f8e44",
"created_at": 1705435693,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"t",
"softwaredevelopment"
],
[
"proxy",
"https://hachyderm.io/users/gregdavis/statuses/111767433599823639",
"activitypub"
]
],
"content": "One pattern I find in my #rust code, or at least a subconscious behavior I have, is not using lifetime annotations much. I'm not sure if that is good or bad. I have written lots of C and C++, so maybe I have a habit of moving/borrowing memory, and keeping a mental model of a lifetime already, without annotations. I wonder if my code could be better, though, if I leaned more on explicit lifetimes, and if better means any of \"more efficient\" or \"more readable.\" #softwaredevelopment",
"sig": "d23eff8a0ac8b0016df04d64cb6365aaecd0f599451cb3f9cc9557cc67f1a9474c721a2fc4b18ea2de10d000d18a188986617eac67247e481cc89885afc121c1"
}