by mreiland · 10y ago · 0 comments
It's a "reading micro-optimization" in the same way that not littering your code with comments is a "reading micro-optimization".
It makes you pause and interrupts your flow of thought as you contemplate something not directly related to what you were modeling in your head 2 seconds ago.
Littering your code with comments IS a huge readability problem. You are forced to filter them out to find the real code, since they are mostly garbage, but you can never be sure you aren't skipping some vital bit of information. Likewise, boilerplate and needless ceremony obscure the intent of the code, so they are obstacles to be reduced in good, clean code.
Contrast this with writing Yoda conditions. They are no big deal. They interrupt your flow of thought exactly once: the first time you encounter them. If your train of thought is interrupted every time you encounter them, you are way too novice a programmer. So I think this is a really minor issue in the sea of software complexity; so minor, in fact, that it seems bizarre to me to mention it.
I think whether to use Yoda conditions, much like the placement of braces or the number of whitespaces for indentation, are the stuff of flamewars and endless argument because they are the kind of things we programmers love to obsess about, but they are really not very important.
You're unimaginative.
This conversation is finished.
either ban me or leave me alone until I do something that's actually ban worthy please.
And to be clear, so there is no confusion here.
Your guidelines state the following:
> When disagreeing, please reply to the argument instead of calling names. E.g. "That is idiotic; 1 + 1 is 2, not 3" can be shortened to "1 + 1 is 2, not 3."
According to your guidelines, his comment:
> If your train of thought is interrupted every time you encounter them, you are way too novice a programmer.
Should have been something such as:
> If your train of thought is interrupted every time you encounter them you probably don't see yoda conditionals very often.
Please, do me favor, go warn him as well.
consistency and fairness.
Or just ban me since we both know that's what you want to do.