Re: [Bashburn-info] Question on Language files
Brought to you by:
bashburn
|
From: Markus K. <mar...@on...> - 2008-09-01 19:29:17
|
Steven W. Orr wrote: > On Sunday, Aug 31st 2008 at 14:39 -0000, quoth Nick Warne: > > =>I just noticed a lot of the English Lang files text is wrapped in > =>singles quotes ' whereas most other languages use double quotes " > => > =>Why is this? Does it matter? Should there be a convention anyway if > =>either work (as they seem to do)? > => > =>I can clean up if desired tomorrow (pub time now ;-) ) > => > =>Nick > > There's nothing wrong with how things are written. using any of the > working quoting systems. I personally use a style that I developed called > The Steven Orr System of Minimal Shell Quoting. (patent pending) :-( > > Anyhoo, it looks like this: > > foo=Hello # Case 1 > bar='Woops. I slipped.' # Cabe B > baz="I like to say $foo when I meet peopls." # Case iii > > so what you have here is three distinct situations: > > In case 1, the value in question is a s single word. There is no need to > quote anything. You are allowed to use both single or double quotes, but > but not using anything, the reader of the code immediately sees that there > is a value that is composed of just one word. > > Case 2 is obviously a multi-word value with no variable expansion. No > double quotes needed. Yes, "s are legal, but I can look at a long string > and see right away that there is no variable expansion going on. > > Case 3 tells me right away that there are variables afoot. > > So you asked about a convention? There it is. > > Do you hate it? Do you love it? > > Steven, yes I personally like your system too - but with one exception that I prefer to write "case 1" like: foo='Hello' or: foo="Hello" This may not be better in technically terms. But it keeps a routine to quote strings and one can see with one quick look that it is a string. (Ok, maybe I have a little touch of lisp programming language, where normally strings are quoted, otherwise it is seen as a symbol). ;-) |