
Brian Kernighan on the Elements of Programming Style [video] - extarial
https://dave.cheney.net/2018/09/15/internets-of-interest-1-brian-kernighan-on-the-elements-of-programming-style
======
yesenadam
youtube version
[https://www.youtube.com/watch?v=8SUkrR7ZfTA](https://www.youtube.com/watch?v=8SUkrR7ZfTA)

------
gugagore
For the first example, with the ternary operator, I think the original has an
advantage that it does not mention `Armed` twice, unlike the improved version.

The presenter mentions that there are a few extra characters, I know, but my
issue is not extra characters, but duplication.

~~~
solipsism
When we talk about duplication we are usually talking about doing some work
twice or defining something twice. Using a name twice is not the type of
duplication we try to avoid.

~~~
gugagore
I don't think you can simply assert that. People sometimes do try to avoid
naming something twice, especially if it has an unwieldy name.

For example, to cube a quantity, I don't like to write "x _x_ x". Imagine if x
had another name, like "player_position.x".

Sometimes people try to avoid naming something even once! Such as in an
anonymous function.

------
fao_
>
> [https://video.ias.edu/PiTP2009-Kernighan](https://video.ias.edu/PiTP2009-Kernighan)

For some reason this appears as a completely blank page to me.

~~~
userbinator
It's a rather large page with tons of JS, but whose only apparent purpose is
to embed YouTube video 8SUkrR7ZfTA which a sibling comment here has already
linked.

