read: 745
This data as json
rowid | url | title | description | image | date | hnurl | screenshot | domain | |
---|---|---|---|---|---|---|---|---|---|
745 | https://nitter.kavin.rocks/id_aa_carmack/status/1646634954703421441 | John Carmack (@ID_AA_Carmack): "Everyone knows that when you have similar code repeated several times that you should consolidate into a loop or function, but changing discrete variables into arrays and adding loops can have a small readability cost, so sometimes it can feel like a debatable choice for something small just repeated two or three times. Usually, optimizing for readability is positive, but a requirement to keep two separate things aligned through future changes is an “invisible constraint” that is quite likely to cause problems eventually. Many years ago, I would casually copy-paste-paste-paste-modify 4D vector statements, but now I almost never even do two related statements like that. The hazard is when you combine two things that are close, but not exactly the same, and the strain induces complexity." | nitter | Everyone knows that when you have similar code repeated several times that you should consolidate into a loop or function, but changing discrete variables into arrays and adding loops can have a small readability cost, so sometimes it can feel like a debatable choice for something small just repeated two or three times. Usually, optimizing for readability is positive, but a requirement to keep two separate things aligned through future changes is an “invisible constraint” that is quite likely to cause problems eventually. Many years ago, I would casually copy-paste-paste-paste-modify 4D vector statements, but now I almost never even do two related statements like that. The hazard is when you combine two things that are close, but not exactly the same, and the strain induces complexity. | 2023-04-13T23:35:59.918728827Z | 1681428936.png | 1681428946.pdf | nitter.kavin.rocks |