|
|
|
|
|
by goku12
352 days ago
|
|
> I think I only started to really hate it when I had to deal with some Python code where people decided to nest them and made a really hard to read mess where they should have used just a normal if-else chain. Oof! I can see how that can get really messy really fast. Though I wonder how much of it is the language's fault as it is the programmer's. I used to tell my students to avoid trying to be too clever with the source code. Source is meant for humans to read. Leave the cleverness to the interpreter. > On a more basic level, I just don't see any good reason to put the condition in the middle. Thinking about it again, I think I understand why the language designers chose that order. They were trying to make it make it more readable by following the structure of the English language. "<Buy a steak> if <the butchers are open>. Otherwise <get some salmon>". The problem here is that programmers are more accustomed to the natural and somewhat obvious order that every other programming language follows. They also wouldn't have expected some people to abuse it by nesting it. |
|