I use the extra spacing trick a lot too.

(fyi I work for intersystems) Cache checks the validity of literal format and 
conversion codes at compile time. That catches a lot of typos. Cache also 
displays an error message at runtime for bad variable codes. It doesn't log bad 
codes though. D3 seems to offer a lot of logging. So I'm surprised along with 
Tony that they don't log the invalid codes.

Cache also has a flag that explicitly turns off the VAR"anything" format, but I 
think too many people like the syntax to stop using it.

Out of curiosity, how many people avoid VAR"anything" ? I can imagine someone 
including that in their rules of style, along with no gotos.
And does anyone use the {} i-type syntax in unidata? It looks elegant.


On Jun 8, 2012, at 10:20 AM, Rutherford, Marc wrote:

> Ditto,  I have found using liberal white space has saved me a lot of trouble 
> over the years.   
> 
> Plus now that my eyes are 'of a certain age' I appreciate even more the habit 
> of an easy-read coding style.
> 
> Marc Rutherford
> Principal Programmer Analyst
> Advanced Bionics LLC
> 661) 362 1754
> 
> -----Original Message-----
> From: u2-users-boun...@listserver.u2ug.org 
> [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wols Lists
> Sent: Friday, June 08, 2012 4:20 AM
> To: u2-users@listserver.u2ug.org
> Subject: Re: [U2] Why did this compile??
> 
> On 07/06/12 21:24, Tony Gravagno wrote:
>> When I was working at Pick Systems I found that anything can be passed 
>> into format masks from BASIC, OCONV, or an F-correlative. If it 
>> doesn't blow up some code deep down in the parser then it's just 
>> ignored. I think the theory is that if someone knows enough to get 
>> down that far into the bowels of the system then they'll be able to 
>> diagnose errors resulting from faulty codes. It's sort of like not 
>> putting a "Be careful of falling trees" sign in a forest where 
>> lumberjacks work.
>> 
>> The compiler doesn't know that "~" is an invalid mask, since that's a 
>> runtime feature. So VAR"anything" will compile, which is unfortunate 
>> because it's probably safe to say that ALL of us have tripped on this 
>> exact same issue at some point, maybe every few months for some of us.
>> 
>> I guess the only thing that amazes me is that none of the MVDBMS 
>> providers (to my knowledge) have ever added an optional runtime trap 
>> or log option when an invalid mask is detected at runtime - seems like 
>> they're all just missing a Case 1 or Case True fall-through condition.
>> 
> Which is why I always use what some people might consider "excessive"
> whitespace ...
> 
> TEST.STRING = TRIM(LINE<1>) : "~" : TRIM(LINE<3>) "~" : TRIM(LINE<4>)
> 
> The missing colon is a bit more obvious here ...
> 
> And again, Primeisms, but Primos packed whitespace fairly well. If you told 
> the OS that something was a text file, a string of spaces of any length only 
> took two bytes - DC1,n - where n was the number of spaces.
> So I tend to be pretty free with whitespace. I find the Unix way of using 
> tabs quite a pain ...
> 
> Cheers,
> Wol
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to