|
List Info
Thread: Re: The Problems of Perl: The Future of Bugzilla
|
|
| Re: The Problems of Perl: The Future of
Bugzilla |
  United Kingdom |
2007-05-13 12:23:11 |
At 2007-05-13 15:24:35+0000, "Aaron Trevena"
writes:
> On 13/05/07, Nick Barnes <Nick.Barnes pobox.com> wrote:
> > At 2007-05-12 10:08:02+0000, "Aaron
Trevena" writes:
> >
> > > IME that isn't true. Mitigating for Python's
poor error reporting,
> > > Ruby's poor performance and or reinventing
wheels in Ruby are costly.
> >
> > A number of people have mentioned the quality of
error reporting as a
> > strike against Python. Can any of these people
provide a concrete
> > example of what they are talking about? With
source code, and a
> > misleading or confusing error message?
>
> ...because I keep a file of such things to hand.. not
;)
>
> from memory :
> >>
> syntax error at Line XXX
> common.something
> <<
OK, that's from your memory. Now this is from Python
itself:
$
$ python bugzilla.py
File "bugzilla.py", line 46
def init(self, db, $config):
^
SyntaxError: invalid syntax
$
What's unclear about that? Note the handy caret, indicating
the
offending character at which Python's lexer (understandably)
barfs. I
can't parse your " common.something" line. Is that
supposed to
resemble part of a Python error message?
> Except in Perl I'll get a whole lot more, such as
'expected foo' or
> 'unexpected foo' or 'undeclared bar' or 'runaway quote
at line xxx',
Are these syntax errors? ('runaway quote' is, of course).
Python, of
course, has gloriously simple syntax, so syntax errors are
fairly
unusual in the first place, and are almost always trivial to
fix.
Other errors (e.g. runtime exceptions) are reported
comprehensively in
Python.
Python certainly has many faults (for instance, I think that
the
indentation syntax is a mistake; also it doesn't have strong
static
typing, simple syntax for higher-order functions, or a
type-safe
module language). But error reporting really isn't one of
them. And
if we start discussing syntax errors in this thread, we are
bound to
end up in a discussion of syntax itself, and Perl fans might
prefer to
avoid that line of argument. Perl, by design, puts complex
functionality into the syntax. Python, by design, keeps the
syntax
simple and consistent and puts functionality into library
modules.
> as for debugging.. did you ever bother to are tee eff
em?
Please try to be less offensive. Of course I've read the
manual. Of
course I've used perl -d. In fact I end up using this
rather cranky
tool every single time I write any code for Bugzilla,
because getting
the twisty Perl syntax correct, even for something trivial,
takes me
four or five attempts. My debugging print statements always
break the
parser on the first attempt, tell me that my variable is a
HASH on the
second attempt, reveal how many entries it contains on the
third
attempt, break the parser on the fourth attempt, and finally
tell me
the value that I'm after on the fifth or sixth attempt.
That's if I
get the funky string quotation/expression anti-quotation
rules
straight.
Nick B
-
To view or change your list settings, click here:
<http:
//bugzilla.org/cgi-bin/mj_wwwusr?user=bond yahoo.com>
|
|
| Re: The Problems of Perl: The Future of
Bugzilla |

|
2007-05-13 12:48:59 |
On 13/05/07, Nick Barnes <Nick.Barnes pobox.com> wrote:
> At 2007-05-13 15:24:35+0000, "Aaron Trevena"
writes:
> >
> > from memory :
> > >>
> > syntax error at Line XXX
> > common.something
> > <<
>
> OK, that's from your memory. Now this is from Python
itself:
>
> $
> $ python bugzilla.py
> File "bugzilla.py", line 46
> def init(self, db, $config):
> ^
> SyntaxError: invalid syntax
> $
>
> What's unclear about that? Note the handy caret,
indicating the
> offending character at which Python's lexer
(understandably) barfs. I
> can't parse your " common.something"
line. Is that supposed to
> resemble part of a Python error message?
common.threads is where this particular python
application barfed. I
didn't see anything obvious, otherwise I might have looked
at it a bit
more instead of finding something that didn't require
upgrading or
debugging to work.
"Syntax Error : invalid syntax".. priceless *LOL*
... as opposed to
valid syntax causing a syntax error? ;)
> > Except in Perl I'll get a whole lot more, such as
'expected foo' or
> > 'unexpected foo' or 'undeclared bar' or 'runaway
quote at line xxx',
>
> Are these syntax errors? ('runaway quote' is, of
course). Python, of
> course, has gloriously simple syntax, so syntax errors
are fairly
> unusual in the first place, and are almost always
trivial to fix.
That's incredibly subjective. I find Python opaque, you find
Perl not
too difficult and not to your taste.
> Other errors (e.g. runtime exceptions) are reported
comprehensively in
> Python.
That's helpful, as compilation doesn't catch undeclared
variables or whatever.
> Python certainly has many faults (for instance, I think
that the
> indentation syntax is a mistake; also it doesn't have
strong static
> typing, simple syntax for higher-order functions, or a
type-safe
> module language). But error reporting really isn't one
of them. And
> if we start discussing syntax errors in this thread, we
are bound to
> end up in a discussion of syntax itself, and Perl fans
might prefer to
> avoid that line of argument. Perl, by design, puts
complex
> functionality into the syntax. Python, by design,
keeps the syntax
> simple and consistent and puts functionality into
library modules.
Again. Subjective.
Perl is concise, flexible and powerful. I'm no smarter than
the
average guy, but I never found any problems with Perl's
syntax and
haven't found it confusing.
I lilke Perl's syntax, you hate it - don't pretend this is
technical
when it's not.
> > as for debugging.. did you ever bother to are tee
eff em?
>
> Please try to be less offensive. Of course I've read
the manual.
Well you said you didn't know how to debug.
Of
> course I've used perl -d. In fact I end up using this
rather cranky
> tool every single time I write any code for Bugzilla,
because getting
> the twisty Perl syntax correct, even for something
trivial, takes me
> four or five attempts.
Then try and learn the language properly - you can go to
classes -
really, it's quite simple to learn. Your problem sounds more
like mine
- I find Python so opaque and contrary to what I'm familar
with from C
based languages that I just don't bother - on the plus side
I don't
whine about it and slag it off on python project lists, and
certainly
don't reccomend people not to use it just because of my
personal
feelings towards how it does things.
A.
--
http://www.aarontrevena
.co.uk
LAMP System Integration, Development and Hosting
-
To view or change your list settings, click here:
<http:
//bugzilla.org/cgi-bin/mj_wwwusr?user=bond yahoo.com>
|
|
[1-2]
|
|