Craig Hockenberry on Nostr: Pro Tip: Get in the habit of annotating your tuples. In six months, you're not going ...
Pro Tip: Get in the habit of annotating your tuples. In six months, you're not going to remember which string is which:
`func apiKeys() -> (String?, String?)`
You future self will be happier with:
`func apiKeys() -> (clientId: String?, clientSecret: String?)`
You can even annotate the return values if you have a lot of complex logic before the return:
`return (clientId: “CHOCK”, clientSecret: “NOUNDIES”)`
Published at
2024-05-28 17:33:33Event JSON
{
"id": "de3aa7b1e946b72e94061a33b9ec7c05d9dedb1494dc3586646cd617e1af1372",
"pubkey": "2930fa9beb86bc3b2bef6b3d5756e8ce4c67855194d25cde2697f1ea6efcb4d5",
"created_at": 1716917613,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@chockenberry/112519912702933625",
"web"
],
[
"proxy",
"https://mastodon.social/users/chockenberry/statuses/112519912702933625",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/chockenberry/statuses/112519912702933625",
"pink.momostr"
]
],
"content": "Pro Tip: Get in the habit of annotating your tuples. In six months, you're not going to remember which string is which:\n\n`func apiKeys() -\u003e (String?, String?)`\n\nYou future self will be happier with:\n\n`func apiKeys() -\u003e (clientId: String?, clientSecret: String?)`\n\nYou can even annotate the return values if you have a lot of complex logic before the return:\n\n`return (clientId: “CHOCK”, clientSecret: “NOUNDIES”)`",
"sig": "e20f3534857c75948330beeb4c8e082fedf8420431ed9cdb0d44f710dc6c3b2766c111954116238b86132874cb1b92d5d2a8855f40ab53512ef806a68ab5d4e0"
}