[M3devel] whitespace rationale?

Jay jayk123 at hotmail.com
Fri Apr 18 18:32:02 CEST 2008


I like the function names at the first column to find definitions, but lots of folks don't do that and it is rare/nonexistant in cm3. :(
Granted, your way doesn't require a regexp search. Subtle, but also very useful, one of those things that most folks wouldn't think of -- not just style, but style with function. Of course, it's arbitrary which of the two ways, I think.
A parameter per line also eases diff/merge, but uses a lot of vertical space..

I still think it's worth coming up with a style and a rationale for new code. Not necessarily in this forum :). It's not all maintenance hopefully.
(And yeah I've heard of syntax tree editors that present the text in the user's preferred style.
Been an open research question for probably decades now. Plain text in regular file systems wins.)

 - Jay

________________________________
> CC: m3devel at elegosoft.com
> From: hosking at cs.purdue.edu
> To: jayk123 at hotmail.com
> Subject: Re: [M3devel] whitespace rationale?
> Date: Fri, 18 Apr 2008 12:02:04 -0400
> 
> Purely a matter of style.  I generally don't put the space for calls:
> 
> EVAL f();
> 
> but I do for declarations:
> 
> PROCEDURE f () = ...
> 
> just so that when I want to search for a local declaration I can easily do that with a text search for "f ()".  Just my 2 cents.
> 
> However, when editing code in any one style, I tend to preserve the style.
> 
> On Apr 18, 2008, at 11:01 AM, Jay wrote:
> Does anyone know of a reason to put a space between a function and the paren to start its call?
> Other than "When in Rome"?
> 
> I've long not put that in, but I see a fair amount of code that does, and a fair amount of code that I didn't write that doesn't (e.g. sysutils).
> Seems to be all over the place, but a lot of Modula-3 code puts it in (not that I have seen much Modula-3 code in the world...but...)
> 
> Similarly for array indexing array [index] vs. array[index].
> 
> (Not to mention if (expr) and not if ( expr ). Modula-3 (and Python!) doesn't require the parens so it comes up less often.)
> 
> I always like to know why..
> 
>  - Jay



More information about the M3devel mailing list