If you are just learning how to code, or are a seasoned developer, there are some important habits that will serve you well during your WordPress development career. Beyond the high-level approach of Stephen Covey’s “7 Habits of Highly Effective People”, this presentation will walk you through 7 practical things you can do to become a better and more effective WordPress developer. The concepts presented will be accompanied with action steps and follow up resources so you can start becoming a better developer right away.
Presentation given at WordCamp Atlanta 2014: http://2014.atlanta.wordcamp.org/session/7-habits-of-highly-effective-wordpress-developers/
1. Excellent items from you, man. I have take note
your stuff prior to and you are just extremely
magnificent. I really like what you've acquired
here, certainly like what you are stating and the
best way in which you say it. You are making it
entertaining and you still take care of to keep it
wise. I can't wait to learn far more from you.
- A flattering spam bot
2. 7 Habits of Highly Effective7 Habits of Highly Effective
WordPress DevelopersWordPress Developers
Micah Wood - @wpscholar - http://micahwood.me
3. Habit 1: Constantly LearningHabit 1: Constantly Learning
Learn – to gain or acquire knowledge of
or skill in (something) by:
1) study,
2) experience, or
3) being taught
4. Make a Plan
● Determine your specialty
● Identify your shortcomings
● Consider your options
● Prioritize your approach
● Schedule your studies
5. Habit 2: Being ConsistentHabit 2: Being Consistent
The average developer spends 90%
of their time reading code. If your
code isn't readable, you are just
wasting your own time.
7. Habit 3: Using Debugging ToolsHabit 3: Using Debugging Tools
“Everyone knows that debugging is
twice as hard as writing a program in
the first place. So if you are as clever
as you can be when you write it, how
will you ever debug it?”
– Brian Kernighan
8. Debugging in PHPDebugging in PHP
● var_dump();
● WP_DEBUG – enables reporting of all errors
● WP_DEBUG_DISPLAY – display errors on
screen
● WP_DEBUG_LOG – log errors to file
● Xdebug
9. Debugging in JavaScriptDebugging in JavaScript
● console.log();
● SCRIPT_DEBUG
● JS Hint
● Chrome Developer Tools, Firebug
● JetBrains Chrome Extension
(for PHPStorm)
10. Habit 4: Creating and Running TestsHabit 4: Creating and Running Tests
A programmer’s wife tells him: “Go to
the store. Pick up a loaf of bread. If
they have eggs, get a dozen.” The
programmer returns with 12 loaves of
bread.
11. Types of TestingTypes of Testing
● Unit Testing
● Integration Testing
● Regression Testing
● Usability Testing
13. Habit 6: Automating TasksHabit 6: Automating Tasks
“The first rule of any technology used in
a business is that automation applied to
an efficient operation will magnify the
efficiency. The second is that
automation applied to an inefficient
operation will magnify the inefficiency.”
– Bill Gates
Studying - you must know what to study
Experience - you must challenge yourself
Others - you must find a mentor
Determine your specialty - What do I do best? How can I set myself apart?
Identify your shortcomings - As a specialist, where are my skills and knowledge lacking?
Consider your options - What tools, experiences or mentors could help me fill the void?
Prioritize your approach - What will help me be most effective?
Schedule your studies - When can I schedule a regular, uninterrupted time to work through my study plan?
Naming
Always prefix classes, functions, custom hooks, post type names, etc.
Names should be descriptive and meaningful
Names should be pronounceable
Names should be searchable
Names should provide context
Classes and objects should have noun or noun phrase names
Methods should have verb or verb phrase names
Single Responsibility Principle
Functions and classes should only do one thing and do it well.
There should be no side effects
Don't lie to your users, or yourself!
Sublime Text 2http://www.sublimetext.com/
NetBeanshttps://netbeans.org/
PHPStormhttp://www.jetbrains.com/phpstorm/
SCRIPT_DEBUG Loads uncompressed versions of scripts and stylesheets
You should check for SCRIPT_DEBUG when loading minified resources in your themes and plugins.
PHPUnit
QUnit
Unit Testing - Specify and test one point of the contract of a single function or method of a class.
Integration Testing - Builds on unit tests by combining the units of code and testing that the resulting combination functions correctly.
Regression Testing - Writing tests when a bug is fixed to ensure it will not occur again.
Usability Testing - Letting actual users test your software to make sure it makes sense and is easy to use.
Theme Checkhttp://wordpress.org/plugins/theme-check/
Referencing – Canonical source
Submodules / Sub-repositories
Composer (dependency management)
Forking – Local copies
Akin to copy / paste