Title: Improvement &#8211; Reformatting code
Last modified: August 21, 2016

---

# Improvement – Reformatting code

 *  Resolved [bosseal](https://wordpress.org/support/users/bosseal/)
 * (@bosseal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/improvement-reformatting-code/)
 * Hi Keith,
 * Thanks a lot for the plugin. It really helps to keep a clean WP install.
 * I had to browse the code for controling some stuff (the red herring comment form
   not showing on my install) and noticed a few formatting differences:
    - tabs mainly used for tabulation, but also spaces used sometimes
    - different formatting for conditional statements (spaces between logical opertors,
      sometimes not, etc.)
 * I’m aware it’s not a big deal and it doesn’t prevent the code to work perfectly.
   Plus code formatting is often a personal choice, the choice of the developper.
   But having a correct formatted code can help readability of the code, offers 
   best display in IDEs and also make the collaboration easier in case of several
   developpers work on the code (of course they have to apply the same formatting
   rules).
 * So, unless these formatting differences are kept for historical purposes (making
   diffs or patching easier), maybe it can be an improvement to reformat the code?
   IDEs (at least NetBeans and Eclipse, and I guess others) usually have a feature
   to do that automatically. Maybe going from a sub-release (4.3) to a major release(
   5.0) is also a good opportunity to apply such formatting ? What do you think ?
 * Anyway, the current code is in any case readable and understandable so no worry!
 * Best regards,
 * Alexandre 8)
 * [http://wordpress.org/plugins/stop-spammer-registrations-plugin/](http://wordpress.org/plugins/stop-spammer-registrations-plugin/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Keith P. Graham](https://wordpress.org/support/users/kpgraham/)
 * (@kpgraham)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/improvement-reformatting-code/#post-4333209)
 * It’s not like there is a team of coders here. It is just me and I only get to
   work on this a few hours each month. The code is cut and paste from other projects
   and sometimes I use notepad and sometimes notepad++ to code depending on where
   I am when I make changes.
 * Overall, the code is pretty clean and consistent in style. Spaces or tabs mean
   nothing to me. The indents seem to be mostly ok. I leave in lots of commented
   code and I am not real careful with spelling in comments.
 * I am the only one making changes, so it only has to be readable to me.
 * In my day job I use java and regularly use a code beautifier and I pay attention
   to what comments I make, because I get paid to code java and other people will
   see the code. This is not true in PHP. The PHP code is personal.
 * I am glad that you were able to find the places you need to make your changes.
   Every coder has his own approach. My own style involves breaking code out into
   separate functions as the program gets complicated, even when there is little
   need for it. It would be nice if no function were longer than a single screen,
   but some of my functions are run-on and need shortening. I think short functions
   help make the code a little more readable, even if you have to search around 
   to find the right function.
 * Keith
 *  Thread Starter [bosseal](https://wordpress.org/support/users/bosseal/)
 * (@bosseal)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/improvement-reformatting-code/#post-4333223)
 * Yes it makes sense, especially if you’re the only developer and code on the run
   on your free time.
 * Plus you’re right, the code is clean, organized and commented.
 * Once again it was not a criticism nor anything, I know that every coder has his
   own rules and approach, it was just a thought after browsing the code and an 
   idea in case the project was developed with several hands.
 * So forget about it, and my apologies if my message seemed a bit rough.
 * Best regards,
 * Alexandre 8)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Improvement – Reformatting code’ is closed to new replies.

 * ![](https://ps.w.org/stop-spammer-registrations-plugin/assets/icon-256x256.png?
   rev=3377746)
 * [Stop Spammers Classic](https://wordpress.org/plugins/stop-spammer-registrations-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stop-spammer-registrations-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stop-spammer-registrations-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/stop-spammer-registrations-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stop-spammer-registrations-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stop-spammer-registrations-plugin/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [formatting](https://wordpress.org/support/topic-tag/formatting/)
 * [IDE](https://wordpress.org/support/topic-tag/ide/)

 * 2 replies
 * 2 participants
 * Last reply from: [bosseal](https://wordpress.org/support/users/bosseal/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/improvement-reformatting-code/#post-4333223)
 * Status: resolved