You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Jostein Chr. Andersen" <jo...@josander.net> on 2003/12/01 06:25:50 UTC

Re: svn commit: rev 7879 - trunk/doc/book/book

On Sunday 30 November 2003 23.31, Branko Čibej wrote:

> >Log:
> >* doc/book/book/ch05.xml (svn-ch-5-sect-3.4-ex-1):
> >  Do a decent attempt at making the sample Perl script for making
> >  incremental backups good quality Perl, use Subversion bracket
> > coding standard,
>
> Ouch. If we write Perl examples, I suggest using Perl's recommended
> conding standards. I think this is the first Perl script I've seen
> that uses the GNU brace indentation convention.

Then you should look here:
  packages/win32-innosetup/tools/*.pl  :-)

Blair are declaring variables, are using "use strict", using a strict 
syntax and have a clean style. This is good!

It's probably no such thing as "Perl's recommended coding standards" but 
many Perl programmers like the old Kernighan & Ritchie style:

    if ($foo = 0) {
        do something unredable;
    } elsif ($foo = 1) {
        do something nastier;
    } else {
        make gstein and others port it to python;
    }

The crap above combined with the lack of not declaring variables and 
other funny stuff have made many Perl scripts very hard to maintain and 
understand.
Many Perl scripts like this have made many experienced programmers to 
just turn around and "reinventing" programs. A well known example is 
ViewCVS wich was "inspired" of cvsweb - wich is probably done because 
the unclean and unmaintable (and somewhat typical) Perl code.

Jostein

-- 
http://www.josander.net/kontakt/ ||
http://www.josander.net/en/contact/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7879 - trunk/doc/book/book

Posted by "Jostein Chr. Andersen" <jo...@josander.net>.
On Monday 01 December 2003 18.23, brane@xbc.nu wrote:
> >     if ($foo = 0) {
> >         do something unredable;
> >     } elsif ($foo = 1) {
> >         do something nastier;
> >     } else {
> >         make gstein and others port it to python;
> >     }
>
> This, plus using perl -w and strict, is IIRC exactly the recommended
> Perl coding standard described in the Perl man pages.
>
> > The crap above combined with the lack of not declaring variables and
> > other funny stuff have made many Perl scripts very hard to maintain
> > and understand.
>
> Badly written programs are hard to understand. That has nothing to do
> with Perl.

100% agree :-)

Jostein


-- 
http://www.josander.net/kontakt/ ||
http://www.josander.net/en/contact/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7879 - trunk/doc/book/book

Posted by br...@xbc.nu.
Quoting "Jostein Chr. Andersen" <jo...@josander.net>:

> On Sunday 30 November 2003 23.31, Branko Čibej wrote:
> 
> > >Log:
> > >* doc/book/book/ch05.xml (svn-ch-5-sect-3.4-ex-1):
> > >  Do a decent attempt at making the sample Perl script for making
> > >  incremental backups good quality Perl, use Subversion bracket
> > > coding standard,
> >
> > Ouch. If we write Perl examples, I suggest using Perl's recommended
> > conding standards. I think this is the first Perl script I've seen
> > that uses the GNU brace indentation convention.
> 
> Then you should look here:
>   packages/win32-innosetup/tools/*.pl  :-)
> 
> Blair are declaring variables, are using "use strict", using a strict 
> syntax and have a clean style. This is good!
> 
> It's probably no such thing as "Perl's recommended coding standards" but
> 
> many Perl programmers like the old Kernighan & Ritchie style:
> 
>     if ($foo = 0) {
>         do something unredable;
>     } elsif ($foo = 1) {
>         do something nastier;
>     } else {
>         make gstein and others port it to python;
>     }

This, plus using perl -w and strict, is IIRC exactly the recommended Perl 
coding standard described in the Perl man pages.

> The crap above combined with the lack of not declaring variables and 
> other funny stuff have made many Perl scripts very hard to maintain and
> understand.

Badly written programs are hard to understand. That has nothing to do with Perl.


My point is that it makes as much sense to adher to the Perl recommended style 
as to the Java recommended style.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[OT] Re: svn commit: rev 7879 - trunk/doc/book/book

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Dec 01, 2003 at 07:25:50AM +0100, Jostein Chr. Andersen wrote:
>...
> It's probably no such thing as "Perl's recommended coding standards" but 
> many Perl programmers like the old Kernighan & Ritchie style:
> 
>     if ($foo = 0) {
>         do something unredable;
>     } elsif ($foo = 1) {
>         do something nastier;
>     } else {
>         make gstein and others port it to python;

ROFL

>     }
> 
> The crap above combined with the lack of not declaring variables and 
> other funny stuff have made many Perl scripts very hard to maintain and 
> understand.

Globals. Inconsistent patterns. Hash vs scalar vs ref vs ???. ...

> Many Perl scripts like this have made many experienced programmers to 
> just turn around and "reinventing" programs. A well known example is 
> ViewCVS wich was "inspired" of cvsweb - wich is probably done because 
> the unclean and unmaintable (and somewhat typical) Perl code.

No probably about it :-)  I wanted some extra features in cvsweb, but it
was *WAY* too painful to shoehorn the damned things in. I can edit Perl,
and do some lame-o writing of Perl scripts, but cvsweb was just *so*
horked that I actually *saved* time by taking a weekend and converting it
to Python. In the process, I threw out all but one global (which has since
been removed, too), and cleaned up a lot of the control and data flow
problems present in cvsweb.

My opinion is that Perl is great for small one-off scripts. Applications,
or scripts which deal with data structures... forget it. Perl is a bit
better than Python when acting as a "control" script, but I tend to go
"all the way back to shell script" or stick with Python rather than the
Perl midpoint for those cases.

Perl is a great language in the hands of experts. The real problem is that
there are way too many non-experts using it. Python is good in anybody's
hands, which is why I continue to recommend it.

One of the benefits of converting cvsweb [in Perl] over to ViewCVS [in
Python] is that I think it reactivated the community of web-based CVS
repository exploration. cvsweb was and is still pretty dead, while ViewCVS
has seen continued activity. Most recently, it has been managed extremely
well by two of our SVN committers: C. Mike Pilato, and Russell Yanofsky.


Well, back to your regularly scheduled programming...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org