▲ 342 ▼ What are your programming hot takes? (lemmy.ml) submitted 3 years ago by 257m@lemmy.ml to c/programming@programming.dev 894 comments fedilink hide all child comments
[–] 9point6@lemmy.world 1 point 3 years ago (1 child) The world where the convention is i permalink fedilink source parent hideshow 2 child comments replies: [–] hellishharlot@programming.dev 1 point 3 years ago (1 child) What's incoherent about the first one? Why is index bad beyond standards permalink fedilink source parent hideshow 2 child comments replies: [–] 9point6@lemmy.world 1 point 3 years ago It's not incoherent, it just takes a tiny bit more effort to mentally parse as it's not a stereotypical for loop. Maybe it's just me, but let me try and explain With the i example if you're familiar enough with a language, your brain will gloss over the unimportant syntax, you go straight to the comparison and then whether it's incrementing or decrementing. With the other example, the first my brain did was notice it's not following convention, which then pushes me to read the line carefully as there is probably a reason it doesn't. I'm not saying it's a huge difference or anything, but following code conventions like this makes things like code reviews much easier cumulatively. permalink fedilink source parent
[–] hellishharlot@programming.dev 1 point 3 years ago (1 child) What's incoherent about the first one? Why is index bad beyond standards permalink fedilink source parent hideshow 2 child comments replies: [–] 9point6@lemmy.world 1 point 3 years ago It's not incoherent, it just takes a tiny bit more effort to mentally parse as it's not a stereotypical for loop. Maybe it's just me, but let me try and explain With the i example if you're familiar enough with a language, your brain will gloss over the unimportant syntax, you go straight to the comparison and then whether it's incrementing or decrementing. With the other example, the first my brain did was notice it's not following convention, which then pushes me to read the line carefully as there is probably a reason it doesn't. I'm not saying it's a huge difference or anything, but following code conventions like this makes things like code reviews much easier cumulatively. permalink fedilink source parent
[–] 9point6@lemmy.world 1 point 3 years ago It's not incoherent, it just takes a tiny bit more effort to mentally parse as it's not a stereotypical for loop. Maybe it's just me, but let me try and explain With the i example if you're familiar enough with a language, your brain will gloss over the unimportant syntax, you go straight to the comparison and then whether it's incrementing or decrementing. With the other example, the first my brain did was notice it's not following convention, which then pushes me to read the line carefully as there is probably a reason it doesn't. I'm not saying it's a huge difference or anything, but following code conventions like this makes things like code reviews much easier cumulatively. permalink fedilink source parent