in reply to Re (9): Perl6 headaches?
in thread Perl6 headaches?

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Re: Re (9): Perl6 headaches?
by japhy (Canon) on Nov 05, 2001 at 00:05 UTC
    Why would I rather use dots? Because I came to Perl from C++ (believe it or not) where the "->" is used to access members and methods of a pointer to an object; the "." is used when you have the object itself. So when I came to Perl, and eventually used references, the arrow notation sort of made sense, since references are kinda like pointers. And the same goes for objects... but, wait... objects are references, so does that make them like pointers or objects?

    I understand why Perl had to use something other than "." since it differentiated between string addition and numeric addition. However, every other language found some way to use "." for objects. Why not Perl? And it has. I like this new approach, because it is consistent with the approach taken by many other languages. And I like that idea. That is why I am in favor of it.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

      I find the arrow perfectly consistent with its use in C and C++. You use an arrow when you access things through a reference. A dot when you access things directly. But in Perl you never really have an object, you have a reference to it and access it through that reference, which matches the notation.

      For instance if you make a copy of an object, and adjust that copy, the original changes. If you make a copy of an object and rebless it, the original is now in a different class. Those internal details show that any and all accesses to the object are taking place through a level of dereferencing. If the data was immediate then modifying a copy wouldn't change the other copies. But it isn't immediate and so changes are shared among all references to that object.

      That said, Perl 6 is doing a lot to reduce how much the programmer needs to think about explicitly dereferencing data structures. Therefore it makes sense to me to have the arrow change to a dot to indicate the fact that we are supposed to stop thinking so much about dereferencing...

Re: Re: Re (9): Perl6 headaches?
by premchai21 (Curate) on Nov 05, 2001 at 00:07 UTC
    Why do you persist in talking for Larry Wall?

    I'm going to let japhy speak (or not) for himself here.

    I thought the point of a discussion was not to blindly tow the line, but to engage in a dialogue?

    This is correct, and known.

    Tell me why you would rather use dots fo methods and underscores for concatenation. What benefit will you derive from it? How will it beneficially improve your code?

    I feel that this is a selfish viewpoint. One must also think of what benefit others may derive from one's actions, as well as oneself. In this case, the others are the people migrating to/from Perl. In general this change (the method-call dot) will make it easier for them. Then of course the concatenation operator has to become something else.

    If someone coming from another language cannot put in the 30s it takes to read that dots are for concatenation and arrows for method calls, is there really any point in tailoring the language to their needs?

    In this case, yes, I think there is a point in that. Part of what makes a good programming language, IMHO, is intuitivity. Most people are already tuned for dots, so to speak. What about switching between Perl and another language, rapidly? Perhaps one is developing in both simultaneously.

    And where do you get this idea that perl is so difficult? I haven't met anyone who's found it hard.

    I don't believe anyone said that Perl was difficult.

    In fact, the only people I've heard complaining are people with their own agenda (i.e., this is why the programming language I know so well is better than perl).

    A lot of people happen to like Perl. Some, however, do not. There really isn't a clear way of saying that one language is "better" than another. Mostly such things are determined by general consensus AFAIK. I would suggest you be slightly more tolerant of other's preferences, especially when they do not directly affect you.

    Note also, if you do not like the change: IIRC one will be able to specify syntax using pragmas, so you can reverse it, at least in your code, at will...

    $thread += 0.02 * $$
      My point was that if you want to convince someone of your argument, you need to spell out exactly what the argument is. The statement that many other languages use dots does not present a valid reason why the use of dots should prevail. In my opinion, Perl got it right, and it is the other languages that should be looking to Perl's example. Now, since the current syntax is on my side, if you don't agree that Perl got it right, then elucidate your argument as to why not. And if you make a good argument, I'll listen. If not, then you're just towing the line.

      Also, speaking of hypotheticals and "would-be Perl users somewhere down the line" is meaningless, as I tried to point out somewhere in this jumble of a thread. I can just as easily talk about the theoretical end of OO and death of dot syntax in that case. Consequently, I would rather hear concrete reasons for or against, which one can normally only derive from personal experience.

      matt

        I have yet to come across another language with a following quite so pervasive as Perl's, so this fear of Perl falling out of favour doesn't hold water. -- mattg

        Also, speaking of hypotheticals and "would-be Perl users somewhere down the line" is meaningless, as I tried to point out somewhere in this jumble of a thread. -- mattg

        I think I can safely bet that there will be more users of Perl in the near future, especially around the advent of Perl 6. I would not bet any money on the death of object-oriented programming, and in a related issue, the death of the period for object-to-method interaction1.

        I think the "hypothetical" issue of Perl users from other languages is not hypothetical at all. It happens all the time, and there's no reason to expect it to not happen later.

        I've already said that I don't think Perl is right in using the arrow -- there are arguments why it is good (such as "it shows the object going to the method") -- but there is a bigger argument as to why Perl never used the dot instead. Now Perl is changing so that it can be used. Why is this happening? It certainly isn't Larry having an alcohol-induced vision of grandeur; it is Larry realizing that Perl is being different, and only because it had to be, and that by making a change here and there, we can offer something that many programmers are already familiar with. Instead of "switching gears" entirely when using Perl, they can just solve the problem differently, or solve a different problem.

        I think Perl is making a good change, for reasons I've stated many times. If you don't feel my conclusion is valid, then that is your perogative. I feel I've shown enough evidence (non-hypothetical evidence from experience, even) to validate my opinion. My opinion.


        1 Object-oriented programming caught on because it represented a whole new paradigm of doing things in programs. Code began to be life-like. You had objects (people) with associated methods (actions). You had hierarchies (managers and underlings) and inheritance (sub-projects). So long as programmers remember Real Life, this method of programming will remain popular. It changed code from lifeless subroutines to dynamic actions. Programming is dynamic. On a related note, the dot syntax will probably linger due to its following... not unlike Perl.

        _____________________________________________________
        Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
        s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

        A reply falls below the community's threshold of quality. You may see it by logging in.