Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I hope the following question is acceptable here.

I rely entirely on copy/paste for most WP functions, however I guess WP veterans don't. Is it important to know by heart the common WP syntax, and if it is, do people actually make an effort to memorize them just like we memorize a piece of poetry or a quote?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Not everyone will follow convention, so you can be assured if you are copy-pasting then you are getting a mix-and-match approach from people who do it "right" and do it "wrong" and sometimes the difference between right and wrong is a matter of opinion, lets not forget.

Also this applies to NOT only Syntax Style but also Best Practice methods for using proper WP Core functions over less preferred hack-jobs or unconventional functions to perform certain tasks.

Here are two links that can help you understand what WordPress thinks is acceptable coding standards syntactically, most of which you will find is common practice elsewhere amongst PHP developers;

Work with anything long enough and you will begin to memorize good convention, you'll also graduate from copy-pasting, more so to writing your own logic and with that you will adopt convention, standards and best practices because ultimately we want others to be able to read our junk code just the same as you'd expect from others.

share|improve this answer

You don’t have to remember very much. Any decent IDE will help you with auto-complete and an overview of the parsed PHPDoc.

Example from Eclipse:

enter image description here

After typing add_ you get a list of matching function names and constants, a description and an explanation of the parameters … if there is a useful PHPDoc block.

enter image description here

And when you create a new object you get the public methods offered too.

See also this answer for a useful setup.

What you should learn is the order of the main actions:

  • muplugins_loaded
  • plugins_loaded
  • after_setup_theme
  • init
  • wp_loaded
  • … and so on.

But that’s really easy. :)

share|improve this answer
    
I code in Notepad++, do you think I'm wasting a fair amount of time writing everything manually and I should switch to an IDE like Eclypse ? –  drake035 Mar 23 '13 at 16:14
1  
@drake035 Yes, absolutely. Notepad++ is fine languages with a fixed list of names (.htaccess or CSS). For PHP with its extendable set of names (custom functions and variables) it is not very useful. Plus, Eclipse can mark deprecated functions with line-through – an important feature for WordPress developers. :) –  toscho Mar 23 '13 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.