Squeak coding style...

goran.krampe at bluefish.se goran.krampe at bluefish.se
Sat Feb 28 12:52:51 UTC 2004


Hi all!

I have been BFAVing quite a bit the latest week and one thing that has
annoyed me a bit :) is our lack of consistency in coding style. Sure, it
is not a BIG THING - but at the same time a consistent style improves
the impression.

Now - we all have different preferences here, but let me show you a
hypothetical example:

sillyFy: string
"take the argument and sillyfy it"
^ string, ' is silly'.


Ok, there are 6 things here that annoys me. :) Note though that I write
this with toungue in cheek! Some of these things are plain silly but I
confess - they still bug me. :) Here goes:

1. The comment starts with lower case and has no period. Just looks
sloppy IMHO. This one is actually one that I think we could agree on.
Right?

2. There is no empty line between the code and the comment. I like an
empty line there so that I can easily see where the code starts. If
there is no comment at all then I usually still have an empty line below
the signature before the code. Also hopefully a style convention we
could try to follow perhaps.

3. The code should be indented. Agree? :)

4. There is a space after ^. Sure, people do it differently. :)

5. The naming of the parameter "string" is not really in my taste. I
would have liked "aString" better. 

6. There is a period after the last statement. Not needed.


Anyway, the above was just to spark the thread. I know this topic is of
very low importance though so.... well. :)

regards, Göran

PS. Perhaps we could write a "styleifier"? Some of these things are both
easily detected and corrected.



More information about the Squeak-dev mailing list