Framework Convenience Trap

The idea is “x” framework provides a level of convenience that can make developers sloppy.

This often happens because frameworks tend to make developing easier. So easy we forget to take a step back and figure out how all the pieces come together.

If the framework is modeled on the model view controller (MVC) pattern. The convenience trap for developers is adding unnecessary amounts of logic into controllers or models. It’s easy to do and get the work “done” and out of the way if no testing is involved. Generally the problem with putting unnecessary amounts of logic in controllers or models is hard to test which subsequently causes the application to be brittle.

For example:
Oh looky here something database related this needs to go in a model or hey this interacts with the user’s input this probably goes in the controller.

The framework should not be the application, but a portion that compliments the development.

Note: The above generally applies to larger apps and not small apps that may have a short lifecycle.

How to mitigate the framework convenience trap?

  1. Write tests for the application. If tests are written chances are the structure of the app is designed better.
  2. Learn software best practices.
  3. Don’t code in a silo. Talk to other developers.
  4. Realize no one has perfect code and let someone critique your code. DON’T TAKE IT PERSONAL.

Understanding AJAX In WordPress Plugins

For me it’s difficult to retain and grasp the programming concept, especially if it’s new, if I don’t understand the why behind the concept. I didn’t  understand how to properly use AJAX in WordPress. I started searching google and found many article explaining how to use it. The problem was it didn’t go into enough detail for me to understand why. The articles said do it this way, but didn’t explain.

The following article from Smashing Magazine goes into great detail on how to use AJAX in WordPress.
http://wp.smashingmagazine.com/2011/10/18/how-to-use-ajax-in-wordpress/

Send me an email [email protected] if you have questions.