coding standards

stella's picture

SQL coding standards and whitespace

I was just wondering if we have, or if we should have, any SQL coding standards regarding whitespace usage. For example, should we be using a space between column names in IN where clauses or have spaces on either side of comparison operators, etc.

Here are some examples to illustrate what I mean:

SELECT a,b,c FROM {table} WHERE a IN (1,2,3) AND b=4;
vs
SELECT a, b, c FROM {table} WHERE a IN (1, 2, 3) AND b = 4;

and

INSERT INTO {table} (a,b,c) VALUES(1,2,3);
vs
INSERT INTO {table} (a, b, c) VALUES (1, 2, 3);

6 comments · Read more
stella's picture

"elseif" vs "else if"

In the latest code review done by chx and Morbus at http://www.drupaltoughlove.com, one of the items commented on was the usage of "else if" instead of "elseif". There's nothing in the Coding Standards doc that specifically states that one should be used over the other, however it is "implied" from the first example on indentation that "elseif" should be used. Can the Coding Standards doc be updated so that it states one way or the other? Personally I don't mind which, but I would prefer if there was consistency. Core itself has a mixture, but with a higher number of "elseif".

4 comments · Read more
flobruit's picture

Tests in core: What's next?

We now have a testing framework in Drupal core. What we need to move forward is some structure that makes writing tests easy and efficient so that we can go towards our 100% code coverage goal without wasting development resources.

5 comments · Read more
mpare's picture

Lesson #2 Screencast -- Coding Standards, Keeping code clean

Drupal-Dojo Lesson #2 Screen/SkypeCast

Folks, It is really big! The skype audio is not so hot at times, and there is about a minutes audio cut out, from when I got careless, but if you want it, your welcome to it. Go to http://www.parete.fatcow.com/session2.mov[dead link] to download the video. The file is huge! (~240 MB. 1hr 43min 1024 x 782 ) VNC screen did not do very well with how often the windows were switched. I think that this video is usable until the original recording can be made available.

8 comments · Read more
Syndicate content