ChipTuner on Nostr: Minor coding convention #rant. Types should be in the declaration, not the ...
Minor coding convention #rant.
Types should be in the declaration, not the assignment. Inferred types are difficult to read and don't add that much more verbosity imo.
You aren't assigning a type to variable, you are declaring a variable of a type. The compiler MUST know the data type (and it size more specifically) to allocate registers or stack memory. I should be able to look down the left hand side of the file for the variable name and see it's data type.
Personally, I don't even like mixing declarations and assignments, I write in strict C89 standard for my own sanity. Deceleration resides as the first statements and assignment happens later. I wonder if this is leaking from the "immutability movement"
Published at
2024-10-27 17:47:22 GMTEvent JSON
{
"id": "d1d079cbbb005ee74d43e81af42370cd12e17a7dac80ab01785212485ab3e070",
"pubkey": "036533caa872376946d4e4fdea4c1a0441eda38ca2d9d9417bb36006cbaabf58",
"created_at": 1730051242,
"kind": 1,
"tags": [
[
"t",
"rant"
]
],
"content": "Minor coding convention #rant.\n\nTypes should be in the declaration, not the assignment. Inferred types are difficult to read and don't add that much more verbosity imo.\n\nYou aren't assigning a type to variable, you are declaring a variable of a type. The compiler MUST know the data type (and it size more specifically) to allocate registers or stack memory. I should be able to look down the left hand side of the file for the variable name and see it's data type. \n\nPersonally, I don't even like mixing declarations and assignments, I write in strict C89 standard for my own sanity. Deceleration resides as the first statements and assignment happens later. I wonder if this is leaking from the \"immutability movement\"\n",
"sig": "4624e93e5512e06ae3562dfb22142d9c36d19958ad2edf136dabf69d6a695ce10b11320ffce274390d6fe7fa67c9e0c60d1f3b1a00cf5728baf2f7b29068e56c"
}