• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [OT] Spaces inside parenthesis
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] Spaces inside parenthesis


  • Subject: Re: [OT] Spaces inside parenthesis
  • From: Ian Joyner <email@hidden>
  • Date: Thu, 5 Feb 2009 11:44:36 +1100

Ultimately, what introducing spaces inside parentheses is, is another style rule that's just not needed. It's best not to fight natural languages where they work. Although I agree that putting spaces around a dot operator is superfluous (and perverse) – so why put them on the wrong side of parentheses? That's because the dot operator is very different from a full stop, but the use of parentheses to group a subordinate clause is not.

There is a reason why the space has been mistakenly dropped between a method name and opening parenthesis – the #define in C. This was a primitive adoption of the Burroughs ALGOL 'define ... #' construct. The Burroughs construct allowed for white space in between the define name and parameter list. C did not. Seems people confused this with thinking that white space anywhere before a left parenthesis was dodgy. This seems to have left the door open for all sorts of perversions. All these perversions require some sort of explicit rule in the long run, which actually takes longer to enforce and implement.

Hopefully, such problems will become a thing of the past where everyone can tell all editors exactly how they like things laid out, and the editor just stores the tokens.

Modern programming languages should both be like natural language (easy to read) and have formalized grammars (BNF, denotational semantics, etc, etc). Alas most languages in use today fail on both grounds ;-)

Ian

On 04/02/2009, at 2:08 PM, Lachlan Deck wrote:

Ian, Ian ... it's these threads that await you ;-)

On 04/02/2009, at 12:42 PM, Ian Joyner wrote:

On 04/02/2009, at 2:01 AM, Miguel Arroz wrote:

object.method( argument );

This is the worst use of white space, as explained on this page on the correct use of typography (about 2/3rds down):


http://screenfont.ca/fonts/today/interim/Arial/

It's picky, I know.

Hmm. It's also assuming that the rules of grammar, syntax, and so forth apply across the board to all languages or indeed all dialogue contexts. This is where imho you're misgivings are mis-spaced (pun intended) :-)


Now, notice how in natural language you never say mis-spaced(pun intended) but mis-spaced (pun intended). The former is not considered readable for the written word but it is for programming languages as they're treated as a unit rather than separate entities. What I placed in brackets was not a property of 'spaced' but an additional or tangential point being made.

Language written down is about conveying context in the clearest possible manner. But what works for one language does not always convey the same meaning in another.

In natural language a full-stop denotes the end of a statement. A different point is made in the next sentence, again ending with a full stop.

To follow this rule in programming every function call would need to look like this:
naturalLanguage . isHardToForceOnEverything ();


I'd rather follow what the typographers say and have respect for that art and science.

Where relevant, sure.

Alas, this is becoming more widely used in natural language( it's not right )maybe

No. It seems to me that the equivalent would be 'language( it's not right ) maybe' and any text editor should show 'language(' as misspelled. But we're not writing a natural language sentence are we?


from programmers who are adopting this bad style more and more, because programs should not be natural language, right?

Exactly. They're not. They're a different language; different syntax rules apply right?


The natural place for a space is outside parentheses and brackets:

object.method (argument);

Point left unproved imo based on examples above :-)

with regards,
--

Lachlan Deck


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: [OT] Spaces inside parenthesis
      • From: Miguel Arroz <email@hidden>
References: 
 >[OT] Spaces inside parenthesis (From: Miguel Arroz <email@hidden>)
 >Re: [OT] Spaces inside parenthesis (From: Ian Joyner <email@hidden>)
 >Re: [OT] Spaces inside parenthesis (From: Lachlan Deck <email@hidden>)

  • Prev by Date: plain jar utility app, with wonder?
  • Next by Date: Re: [OT] Spaces inside parenthesis
  • Previous by thread: Re: [OT] Spaces inside parenthesis
  • Next by thread: Re: [OT] Spaces inside parenthesis
  • Index(es):
    • Date
    • Thread