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.

share

migrated from meta.stackoverflow.com Jan 6 '13 at 5:59

This question came from our discussion, support, and feature requests site for professional and enthusiast programmers.

    
Edit two questions ans you'll get the rep... then ask on Meta.Wordpress –  Dynamic Jan 6 '13 at 4:36
9  
Did you read the comments on your question? wordpress.stackexchange.com/questions/78282/… explains the reasoning for the closure very clearly. –  Tim Yi Jiang Jan 6 '13 at 4:37
    
You don't need more rep to ask on Meta.Wordpress, unless there's something I'm missing. –  simchona Jan 6 '13 at 4:43
3  
@simchona - You need at least 5 reputation to post on a per-site meta. However, this question was already answered in the comments on AKTed's post. –  jmort253 Jan 6 '13 at 4:45
    
@tim - did you read mine? If I'm mistaken in my assertions, please elaborate. As stated in this question, how is my question not folling faq? –  akTed Jan 6 '13 at 4:47
3  
@AKTed You're asking about a style of coding. This coding style is not specific to WordPress. It's not even specific to PHP, the language WordPress is written in. WordPress.SE is only for questions about WordPress, and as such, your question falls outside its scope. Stack Overflow, which is for general programming questions, has a question on this: stackoverflow.com/q/5854317/313758 –  Tim Yi Jiang Jan 6 '13 at 4:49
    
@simchona, if you don't plan on answering this question, why comment? All I am asking is for 1 person to explain how my question is not relevant to WordPress! It is listed as a best practice in their own Codex, for Pete's sake. How is something in the WP Codex off-topic in a freakin WP Q&A site? –  akTed Jan 6 '13 at 4:59
    
@TimYiJiang, as I'd mentioned in the original question, I had searched but did not find an answer. While I consider myself to be fairly good with search engines in finding solutions to my problems, I didn't know what to search for in this case. Believe me, I tried. And I understand (now) that it is not a WP-specific type of coding, but it is the proscribed way to code in WP, per WP Codex. That makes it a valid question in a WP-specific forum, wherever that forum may be (stackexchange/wp support/where ever). –  akTed Jan 6 '13 at 5:06
    
Sorry you got hosed there, glad I don't have to deal with WordPress and individuals there who can't understand the basic logic that you've presented. They sure couldn't counter your argument. –  Lance Roberts Jan 6 '13 at 5:41
    
@animsuon et. al., what is off-topic about this question? How is it contrary to faq? Geez, this is starting to feel very Inception-like. Buncha wannabe little dictators, pushing buttons because they can. @ Lance, thanks. –  akTed Jan 6 '13 at 5:54
1  
@AKTed Like you said, this belongs on Meta.WordPress. As it is not about (from the FAQ) "Stack Overflow, Stack Exchange, Stack Overflow Careers, Promotions & Advertising, Support, feature requests, or bug reports for the core Stack Exchange engine that powers all Stack Exchange websites" then it is off topic. –  simchona Jan 6 '13 at 5:57
2  
Don't be offensive if you can help it, AKTed. This question was closed as off-topic because it's off-topic on this site. Your original question was closed because it was considered off-topic on WordPress. You should have asked it on their Meta. You couldn't because you don't yet have five points of reputation there, fair enough. Still off-topic here. –  Michael Petrotta Jan 6 '13 at 5:59
1  
This question clearly states "please...tell me how a specific part of the faq applies to my question." Comments in both questions are basically saying that since not only WP uses this style of coding, it's off-topic. It's like if I asked a question on monkey.stackexchange about why monkeys peel their bananas from the bottom up, and it gets closed because other primates peel them bottom up as well, even though only the head monkey forces all of the other monkeys to peel them that way and other primates do it by choice. –  akTed Jan 6 '13 at 6:17
2  
Well, you got some turbulence while entering this air space. For me the best illustration of the Way of the Stack in your Q&A is the first comment by toscho: answering as a comment: when one believes the Question should be closed but wants to provide helpful information. And it was spot on, great article he linked! And as you saw, with civilized discussion among your peers, mis-interpreted concepts can be cleared and a Question can be re-opened. When comments are done in a Q, research upon them and update the Q itself. The battle here is improving Q and A's, win-win! –  brasofilo Jan 7 '13 at 17:11
2  
Funny, but I consider an answer-as-comment to be explicitly contrary to SE mechanics. If a question is inherently interesting/useful enough to answer, has an answer, and that answer is useful, then that answer should be posted as an answer, even if the question itself is off-topic for the given site. With proper moderation, an inherently interesting/useful question will get migrated to the correct site, and will take the already posted answer with it. Everybody wins. –  Chip Bennett Jan 9 '13 at 0:03

4 Answers 4

up vote 1 down vote accepted

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 administrators to 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.

share
    
It is also documented in the page he was originally referring to, codex.wordpress.org/WordPress_Coding_Standards#Yoda_Conditions –  Wyck Jan 7 '13 at 18:18
    
He didn't "originally refer" to that page. He editing his question after it was closed to include the link as a shortcut to providing an answer should anyone else visit the page. –  EAMann Jan 7 '13 at 18:53
    
Well I saw it in the comments, I guess I was late to the party. –  Wyck Jan 7 '13 at 19:25

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.

share
3  
+1 nothing to add to your answer. –  kaiser Jan 6 '13 at 7:04
    
Sorry I have to break this into multiple comments. Your example question that was closed had nothing to do with WordPress (the software), it had to do with meta.wordpress.org (pretend it exists). I can't fathom how my question re: what turns out to be a WordPress core coding standard can be equated to (paraphrased sarcastically) "Why is some text blue and some text red on codex.wordpress.org?" –  akTed Jan 6 '13 at 7:41
    
As to why I persist, partly because I ask a simple question (this one, not WP.se) and get smart-[censored] comments like "Did you read the comments on your question". It should be obvious to most that I did read them, since I made reference to them in this question. –  akTed Jan 6 '13 at 7:42
    
Also partly, if someone tells me I'm wrong and I disagree, I feel compelled to put forth my rebuttal. I would leave it at that, but then if I'm again told that I'm wrong - without rationale, just "you're wrong" - I must respond to that as well. If I shouldn't respond to what someone says directly to me, then maybe they shouldn't be able to say it to me in the first place? As to your assertion that "Yoda conditions have nothing whatsoever to do with WordPress itself" means this question does not belong here, see my monkey analogy above. –  akTed Jan 6 '13 at 7:43
    
Finally, if a question relating to WordPress core (in multiple senses of the word) coding standards and best practices does not apply here, what does? Rhetorical question, no answer necessary. We each have our opinions, some matter more than others, and that's just the way things are. –  akTed Jan 6 '13 at 7:43
1  
I would say that the WordPress Project's officially published Coding Standards very much fit the "development...best practices" criterion contained within the FAQ. I can't even begin to understand how someone could say that a question about why something is included in the official WordPress Coding Standard has "nothing at all" to do with WordPress. Also: I find the general treatment of @AKTed to be unnecessarily terse, to downright hostile - something quite contrary to the "Way of the Stack". –  Chip Bennett Jan 9 '13 at 0:11
1  
Further: your analogous "Codex" question is not analogous at all, because it has to do with MediaWiki link colors, and MediaWiki design. It is a question about the software that serves the Codex, while the question at issue asks about content in the Codex. That distinction is as critical as it is obvious. –  Chip Bennett Jan 9 '13 at 0:13

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.

share
2  
I use WordPress, why is the sky blue?. –  brasofilo Jan 6 '13 at 20:09

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 ( http://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.

share
    
Question: is it reasonable to surmise that a positive outcome of WPSE is educating/preparing more developers to contribute to WordPress core? Are questions about how to contribute to core development in scope or out of scope for WPSE? –  Chip Bennett Jan 9 '13 at 0:28
1  
I personally think so and also think questions about contribution should be on topic. Personally I have found submitting patches to trac pretty daunting, I have even thought about asking on wpse on the best approaches. –  Wyck Jan 9 '13 at 1:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .