Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Plugin Thoughts Episode 8 – Create Clean Code

Posted on July 23, 2012 by Pippin in Podcasts 4 Comments
Home» Podcasts » Plugin Thoughts Episode 8 – Create Clean Code
Tweet
Love It - 0
This entry is part 8 of 9 in the Plugin Thoughts Series
← Plugin Thoughts Episode 7 – Remember Core CSSPlugin Thoughts Episode 9 – Write Better Code; Release Better Plugins →
  • Plugin Thoughts Episode 1: Making Your Plugins More Extensible
  • Plugin Thoughts Episode Two – Use Filters for Plugin Text
  • Plugin Thoughts Episode 3 – Don’t Forget About Core Functions
  • Plugin Thoughts Episode 4 – Learn How Core Does It
  • Plugin Thoughts Episode 5 – Take Responsibility for Your Products
  • Plugin Thoughts Episode 6 – Contribute to the WordPress Codex
  • Plugin Thoughts Episode 7 – Remember Core CSS
  • Plugin Thoughts Episode 8 – Create Clean Code
  • Plugin Thoughts Episode 9 – Write Better Code; Release Better Plugins

In Episode 8 of Plugin Thoughts, I discuss some of the benefits of creating clean, readable code, and some of the downsides to writing poorly formatted and unreadable code. Whether you build plugins or themes, CSS, HTML, Javascript, or PHP, this applies to you.

At times I am surprised by the poor quality of code that I see laying around in WordPress plugins and themes, and I don’t just mean poorly written (in terms of efficiency and functionality). In this case, I am specifically referring to the quality of code formatting.

You do not have to be a master developer to create clean code, you only need to know how to use the space bar, tab key, and the return key. It does not take more than a moment to properly format your code (including indention), but it will literally save you hours (on large projects) when you have to look back over your project.

Which do you think is easier? Finding a bug in code that is extremely poorly formatted, possibly including poor file / function names, or finding a bug in code that is clean, well laid out, and formatted properly? Unless you live in a very backwards world, you will of course find the second scenario easier to debug.

Have a listen to the episode below.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Tweet Follow @pippinsplugins

4 comments on “Plugin Thoughts Episode 8 – Create Clean Code”

  1. Brian says:
    July 24, 2012 at 8:06 am

    Great topic. I hope all coders learn the importance of meticulously — and consistently — formatted code early in their careers. This is what separates the hacks from the pros.

    Reply
    • Pippin says:
      July 24, 2012 at 9:03 am

      Thanks for stopping by Brian. I constantly find poorly formatted code, even from good developers, and there is just no good reason to NOT format it well.

  2. Geert says:
    August 9, 2012 at 1:05 am

    I completely agree! It’s hard to understand how you still can have fun when writing messy code. Unfortunately, I too am surprised by the amount of poorly formatted code in many WordPress plugins and themes. A consistent and clean coding style is lacking in most of the plugins I played around with. Moreover, they are often generating PHP notices for undefined indexes and stuff. Some kind of quality control for plugins hosted on the WordPress repository would be very welcome.

    Reply
  3. MonkeyMays says:
    August 21, 2012 at 10:13 am

    I’m guilty of writing sloppy code… a lot. I know it only takes extra seconds to make it all nice and pretty… I guess it’s a laziness thing…

    Indeed. i HATE looking through my own sloppy code…. It’s usually when I am going through it to fix something, that I take the time to format it a little better =D

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Test Your Plugins with RTL (0)

    Right-To-Left languages are those that...

  • Submitting Your First Pull Request to a WordPress Plugin on Github (5)

    Github is an extremely popular tool for managing WordPress plugins, and one...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

Enter your email to receive automated updates when new posts are published

Latest Tweets

  • @HipHopMakers should be back shorlty
    May 25, 2013
  • @mrpritchett good idea. Not in the plugin currently but I like the odea
    May 25, 2013
  • @mrpritchett what kind of short codes?
    May 25, 2013

Topics

hook meta box Rémi Corson featured shortcodes campaign monitor add_options_page register_setting Sugar Event Calendar attachments add_shortcode wp_enqueue_script the_content image forms short codes Related posts login do_action authors mail chimp attachment plugin recent posts comments post types bbpress apply_filters short code taxonomies custom post type Ajax images gallery Stripe jquery taxonomy users widgets add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2013 Pippin's Plugins