in reply to Re: Re: Re: CGI::Application vs CGI::Builder
in thread CGI::Application vs CGI::Builder

I think the real problem is beginning with semicolons. Sure, you *can*, but it gives the (false) impression that a semicolon is a statement beginner when it's really a statement terminator. I'm sure it's just a minor stylistic quibble anyways, but I prefer my syntax elements to visually look like what they really do, which in this case is ending statements.
  • Comment on Re: Re: Re: Re: CGI::Application vs CGI::Builder

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: CGI::Application vs CGI::Builder
by DrHyde (Prior) on May 05, 2004 at 09:12 UTC
    Beginning with semi-colons is also evil because the semi-colon is used to denote the beginning of a comment in some environments. Certainly if I were to see something like:
    ; use strict ; use warnings ; use other_stuff
    I would think "why is he commenting all those out?"
Re: Re: Re: Re: Re: CGI::Application vs CGI::Builder
by Anonymous Monk on May 04, 2004 at 12:54 UTC

    I think the real problem is beginning with semicolons. Sure, you *can*, but it gives the (false) impression that a semicolon is a statement beginner when it's really a statement terminator.

    Well, since this is a well formed block made of 3 'statements':

    { A ; B ; C }

    I would say that perl uses semicolon to divide/split statements, more as a 'statement separator' than 'statement end' (i.e. neither to end nor to start statements).

    I agree that putting the semicolon at the end is the more popular convention, (and for this reason my style is unconventional), but these are exactly the same block, just splitted after or before the 'statement separator':

    { A ; B ; C } { A ; B ; C }

    the advantage of the latter is the vertical alignment, its disadvantage is that it is unconventional.

    Domizio Demichelis

      I would say that perl uses semicolon to divide/split statements, more as a 'statement separator' than 'statement end' (i.e. neither to end nor to start statements).
      I'd have to disagree here. You can still end that last statement with a semi-colon (I would consider it good practice to do so infact, much like commas in list assignments), but perl manages to guess where you have omitted the statement ender. I see the semicolon much like a period in english. If you looked at a improperly spaced sentence, you could come to the conclusion that a period starts a sentence, because "most of the sentences have a period in front". But of course, a period ends a sentence =].

      Since this is a matter of personal style, aka opinion, it's kind of pointless to try to change your mind or you change my mind, I just wanted to reply with my view point, which I'll reiterate to try to make myself clear: A semicolon *ends* a statement. It tells perl "this is the end of my statement". Therefor, it belongs at the end. =]