Squeak coding style...

Trygve Reenskaug trygver at ifi.uio.no
Sat Feb 28 19:49:45 UTC 2004


A question to anybody writing code in any language:
     Do you intend the code to be read, or is it write-only?
A word of comfort:
     If you don't reveal your name: Don't worry, we understand.

--Trygve

At 28.02.2004 13:52, you wrote:
>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.


-- 

Trygve Reenskaug      mailto: trygver at ifi.uio.no
Morgedalsvn. 5A       http://heim.ifi.uio.no/~trygver
N-0378 Oslo           Tel: (+47) 22 49 57 27
Norway





More information about the Squeak-dev mailing list