Squeak coding style...

Andreas Raab andreas.raab at gmx.de
Sat Feb 28 17:45:27 UTC 2004


I agree with this. Removing formatting from code is really a "lossy
compression" and it looses lots of valuable information. And it's not just
that poorly formatted code is often a sign of inexperience or bugs - it's
also that (at least for me) the style and consistency of a method says a lot
about who has written it, how many people have been working on it and
similar things. In short, the way in which a method is formatted reveils a
lot of subtle information about the writer, its intent and its general
working style. I am not certain we want to loose that information.

Cheers,
   - Andreas

----- Original Message ----- 
From: "Chris Becker" <chbecker at neo.rr.com>
To: "'The general-purpose Squeak developers list'"
<squeak-dev at lists.squeakfoundation.org>
Sent: Saturday, February 28, 2004 6:12 PM
Subject: RE: Squeak coding style...


I think there is a great benefit to leaving code formatted exactly how the
author wrote it:

Poorly formatted code helps me quickly identify parts of a system that need
to be rewritten. You'll typically find more bugs in code that looks like
crap. It's like a giant neon sign on the road, "Lousy design ahead!"

So, after 25+ years of hashing and rehashing this issue in every language
I've developed in, I now say, "Viva la difference!"

:-D

Chris Becker



> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org [mailto:squeak-dev-
> bounces at lists.squeakfoundation.org] On Behalf Of goran.krampe at bluefish.se
> Sent: Saturday, February 28, 2004 7:53 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Squeak coding style...
>
> 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