I am curious if anyone can explain how my question can be considered off-topic? Please also read the comments below it. Also, please don't just copy/paste from the faq, tell me how a specific part of the faq applies to my question.
Since Yoda Conditions are used throughout WordPress, but only documented as a requirement on an external site about coding standards, the answer to the OP's question is important for understanding why WordPress is built the way it's built.
Could the question have been more clear? Possibly (and I've edited the question to make it more specific to WordPress development).
Remember, our FAQ allows questions that are:
WordPress - Stack Exchange is for
WordPress developers and administratorsto ask questions about:
- theme and plugin development
- development and management best practices
A question about WordPress coding standards is absolutely on-topic for this site because it helps explain core to new developers.
WordPress Stack Exchange is for questions directly relating to WordPress. Your question is not specific to WordPress, even if it is somewhat related. WordPress, as a behemoth community-driven piece of software, must lay down certain standards in order to keep code consistent and clean. Yoda conditions have nothing whatsoever to do with WordPress itself. If you modify your core files or write plugins without using Yoda conditions, it will not affect how WordPress behaves.
I don't really see why you are persisting with this: you have your answer, in both the comments here and on your original question. Do you want to restore your honor by having it re-opened? Contribute to the site, and earn enough reputation to cast close votes. You can also delete your question, as it received no answers before closure.
Here is another question that relates to the Codex but has been closed. It too, is not a good fit for this site. However, the owner has read the feedback, graciously accepted the reason, and got on with his life.
In case you are interested, there is a very good WordPress support forum that would be perfect for discussing something such as this. And, when you earn enough reputation, you can join us in meta and chat for similar off-topic questions, discussions and debates.
I use WordPress, why did the chicken cross the road?
FAQ is very explicit that WordPress context by itself does not make question on topic for our stack.
You have posted your question on a premise that it might be WordPress-specific technique. Which (specific) it is not - as it was immediately and helpfully pointed out by multiple people with information and links on topic.
Yes, it is part of WordPress coding standards. As bunch of other rules, all of which are simply reused from long existing programming practices.
No, it is not something unique to or invented by WordPress. It is programming technique, not WordPress one.
Yes, your question is considered off topic. By people that use the site for far longer than whole two days you do. Who were here when FAQ was discussed and written. Consider that they might have pretty good grasp on what it means and that you are not the instant expert on it.
No, making a fuss and insulting everyone around you is not getting you anything. You disagree with explanations you have been given - noted and not changing.
When a someone repeats a question it's not because he is annoying but rather because the answer is not sufficient, even though the answerer thinks it might be.
The question should have been.
Why does WordPress recommend Yoda conditionals ?
Since WordPress does specifically recommends using Yoda conditionals on the Coding standards page.
So like why?
The reasoning is that it prevents logical errors if you make a typo.
For example typing
'true = $the_force' will correctly throw an error as opposed to
$the_force = true. This was explained in the comment link above ( https://stackoverflow.com/questions/5854317/what-is-the-difference-between-these-bcondition-null-and-null-bcondition )
Is this specific to WordPress ?
No, the suggestion as noted above was just picking up what other languages do.
Does it matter ?
No it doesn't matter, make your code readable and typos usually break things, but ultimately do whatever you feel is a better fit for you.
Does the question belong on WPSE
No, because this is a general coding idea, it is not specific to WordPress, even though it's recommended by WordPress. In the same vein that WordPress has password security recommendations here, but the topic has nothing to really do with WordPress specifically.