Coding standards

3 views
Skip to first unread message

Scott Z. Bressler

unread,
Oct 12, 2010, 3:19:06 AM10/12/10
to edit...@googlegroups.com

I’m sure there are many more things, but I’ll start with one I just noticed that we ought to standardize on: indentation. Spacing? (How many?) Tabs? WordPress standards dictate tabs. I use 4 spaces at work. We seem to have a mix of everything. Obviously I don’t mean for us to go through and change current indentation (unless an IDE makes it easy), but we should agree on something moving forward.

Cast your votes!

-Scott

Daniel Bachhuber

unread,
Oct 12, 2010, 10:36:24 AM10/12/10
to edit...@googlegroups.com
Good conversation to start. Personally, I think we should follow WordPress standards unless we have a specific reason not to. Speaking of, are those standards well documented anywhere?

Also, on a related note, I think we should follow the maxim of commit early, commit often. Every functional change should be a commit (instead of committing a number of changes in bulk). You don't need to push after every commit, but committing early and often increases clarity, it's easier to track the logic behind your changes for a specific problem, and makes it much easier to revert if you need to. Thoughts?

William P. Davis

unread,
Oct 12, 2010, 11:03:33 AM10/12/10
to edit...@googlegroups.com
They're pretty poorly documented at http://codex.wordpress.org/WordPress_Coding_Standards. Maybe one of the Andrews has a better link?

Sent from my BlackBerry® wireless device


From: Daniel Bachhuber <dan...@editflow.org>
Date: Tue, 12 Oct 2010 10:36:24 -0400
Subject: Re: Coding standards

Andrew Spittle

unread,
Oct 12, 2010, 11:51:27 AM10/12/10
to edit...@googlegroups.com
Nacin would know better than I. What Will linked to is what's public
for the WP.org coding standards as far as I know. I'll add my vote to
sticking to WP standards unless we have a really good reason not to.

--
Andrew Spittle | and...@gmail.com | http://andrewspittle.net/

Scott Z. Bressler

unread,
Oct 12, 2010, 11:53:58 AM10/12/10
to edit...@googlegroups.com

The commit-early/often and push sometimes is something very-Git that I’ll need to get used to. But makes sense. Just please describe your commits well with the commit-messages!

 

From: edit...@googlegroups.com [mailto:edit...@googlegroups.com] On Behalf Of Daniel Bachhuber
Sent: Tuesday, October 12, 2010 7:36 AM
To: edit...@googlegroups.com
Subject: Re: Coding standards

 

Good conversation to start. Personally, I think we should follow WordPress standards unless we have a specific reason not to. Speaking of, are those standards well documented anywhere?

Mohammad Jangda

unread,
Oct 12, 2010, 1:41:31 PM10/12/10
to edit...@googlegroups.com
Tabs rule!

I'd say follow the WordPress ones, and fallback to to the PHP guidelines if WP doesn't cover something: http://pear.php.net/manual/en/standards.php

As for source control, here are some guidelines/best practices I wrote up for my day job (which we seem to be pretty closely following):

  • Find awesome tips on git usage (everything from beginner to advanced level) here: http://gitready.com/
  • Clean commits: one functional change per commit. Only commit necessary files for that change.
  • Don't commit incomplete code. Use stash instead.
  • Commit or stash your changes before pulling. If using stash, remember to pop and fix conflicts after pulling.
  • Always pull before pushing (or git will throw a nasty error about fast-forwards). You don't want to get git angry (because it will).
  • Always pull before starting any new work (especially if returning to the project after a break)
  • Read the commit logs for your project every once in a while.
  • Verbally communicate any major changes to your team. Don't assume people go through the commit logs.
  • Commit messages should be useful. Add a bug # if applicable.
    • 
       Fixes issue with loading indicator not displaying properly. BUG-123 

Daniel Bachhuber

unread,
Oct 12, 2010, 10:58:23 PM10/12/10
to edit...@googlegroups.com

Scott Bressler

unread,
Oct 12, 2010, 11:29:57 PM10/12/10
to edit...@googlegroups.com
Sweet, thanks!
Reply all
Reply to author
Forward
0 new messages