Thomas Wittek wrote:
Moritz Lenz schrieb:
What makes Perl hard to read is the excessive use of special characters
(/\W/).

I disagree: The make it look ugly, but not hard to read.

Even if it's "only" ugly: To what advantage? I don't think ugliness is a good characteristic of a programming language.

Global variables with cryptic names, that no beginner can make any sense
of by reading it. And after not working with "$<" for some months I
can't remember it either, although I've got quite some Perl experience.

Well, most of them are gone or renamed to more readable ones in p6.

I hope so. I could only find the counterparts for __PACKAGE__ etc. in S02. I didn't find the one for e.g. $<.

Additionally I'm not a friend of sigils:

Then you shouldn't program in perl. Really.

Reason? I still haven't seen a good justification for sigils.
To allow arrays and scalars and subs to have the same name (besides the sigil) although they have different content? No good idea I think. I also can't remember that I ever named a variable like a "reserved word" or operator. And even if I could, I'd consider it to be bad style.

No one mentioned that if it wasn't for sigils, many strings would be increased, length-wise, to do operator concatentation. If it wasn't for that then simple string insertions couldn't be used.

Plus sigils are a defacto form of representing variables in other languages, like Unix scripting and PHP. I'd rather read a data item [scalar, { associative, 1-D } array, list, class object ] and have a good idea of what the target data type is. References is the only data type ones that introduces some sort of mystery to this mix, IMO.

I would also like semicolons to be optional.

Most people don't ;-).

Oh, really? Source? :)
I think they were invented to allow easier parsing and not easier coding.
E.g. in JavaScript, Python, Ruby and Groovy they are optional or even don't exist. As I said, there are much more cases where you wouldn't need them but have to write them than vice versa. Optional semicolons save keystrokes, eye pain and stupid syntactic errors. And if you still like them, you could just use them, which is the definition of "optional".

Almost all mainstream languages do it though, and it serves as nice visual breaks in source. I honestly hate lack of semi-colons, with the exception of shell scripts, all of which I produce that are less than 150 lines long.

Then again I don't do more than 2 sets of statements in a given line for shell scripts either, and I don't so the same with Perl.

<rant>

The only thing I hate about Perl with required formatting is the silly braces. If it's one line and separated by visible whitespace, why is the only option available to me the

        statement_1 if(statement_2);

or

        statement_1 unless(statement_2);

syntax? Seems less readable than:

        if(statement_2)
                statement_1

or

        unless(statement_2)
                statement_1

The only legitimacy for the first set of formats would be if in fact you were reading off the logic statement in a left-to-right language. But then again many languages don't follow that convention (Japanese, Korean, etc etc for instance).

The same opinion goes for all loops, except the

        do { statement } ( { while, until } );

variety.

</rant>

I really like the Python way of doing it: Set the variables type on the
assignment and remember it. The (fewer) operators now work according to
the type of the operands. No implicit (and error prone) type casting.
That way seems to be the best compromise of easiness and type safety.

Well, if you like the python way, feel free to code in python.

Oh, if I didn't like Perl, why should I care about posting my ideas here?
Perl has stolen the largest part of the language from other languages.
Why not do so again by adopting good ideas.

Don't get me wrong, there's nothing bad in writing some critics, but
yours is impossible to realize in Perl 6

Admittedly I'm much too late and I didn't expect applause for my critics -- but at least I hoped to get a discussion based on arguments.

 > and therefore are it's hard to call it constructive.

Unfortunately I already thought this. Even if everyone agreed that sigils (or forced semicolons, or tons of operators, ...) are more bad than good (and this seems like persuading the pope to allow homosexual muslims to marry with priests) the design process is probably too far to introduce such dramatic changes.
Sadly.

Yes, probably about as likely as Neo-Nazi's getting married to Haccidic Jewish people with Satanic priests presiding.

-Garrett

Reply via email to