Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Perl actually does have intellisense. It's just not supported by a big bloated IDE with dropdown boxes that helpfully guess what you could possibly mean as you type. Instead, Perl uses huffman coded operators like grep, map, split, $scalar = @array , interpolation and so on.

    > When your language is so verbose that it needs machine
    > assistance to be usable, you've got a crappy language.

    Yep. A good language has intellisense for both reading and writing code. Giving you a crutch to write volu

    • Perl actually does have intellisense. It's just not supported by a big bloated IDE with dropdown boxes that helpfully guess what you could possibly mean as you type. Instead, Perl uses huffman coded operators like grep, map, split, $scalar = @array , interpolation and so on.

      This is a little disingenuous, isn't it? The examples you're quoting are all built-ins, and I doubt that most people use intellisense for such items. IME it's really useful for keeping on top of libraries, particularly those you don't

      • This is a little disingenuous, isn't it?
        Not really.
        The examples you're quoting are all built-ins, and I doubt that most people use intellisense for such items.
        That's precisely my point. One of the reasons why Intellisense is almost a requirement for programming in C/C++/C# and Java is because of the type system, and the over complexity of the programming model. With Java, you have big class hierarchies, interfaces, and dozens of classes with dozens of methods. For example, if I want to iterate over a list, I need to construct an iterator and use methods like next and hasNext on that iterator. It's a lot of typing. In the degenerate case, I could be using a class that has a lot of methods named get_foo, get_bar and so on. And don't get me started on the syntactic complexity in creating a closure (er, an anonymous inner class).

        In Perl, there's a whole mess of stuff you can accomplish with the three basic datatypes. Most of those operations are monosyllabic builtin functions. A whole mess of operations like m// can be coerced to use $_, which eliminates the need to say what can be automatically inferred. Some of the common cases even use syntactic sugar to do what you mean (c.f. while (<>) {...}).

        In terms of objects, the general idiom is to bless hash references into objects. If you want to mess with instance data, you can peek and poke directly into the guts of an object: print $obj->{count}; $obj->{count}++. We can debate the merits of that design philosophy separately, but it certainly obviates the need to create ~two methods for each instance variable (and consequently reduces method signatures).

        IME it's really useful for keeping on top of libraries, particularly those you don't use very frequently.
        I didn't think of libraries, but you bring up a good point. I've avoided really nasty class hierarchies like those that are found with Java or any decent C++ framework. I find that in Perl, I don't need the wall charts of the inheritance tree, or a playbook of what's what before I can use a set of libraries. Core / CPAN modules tend to be easier to grasp and keep in my head. (This isn't an natural property of Perl per se, just a set of design principles many Perl module authors share.)
        Wouldn't it be great to have to remember if, for instance, the constructor for a DateTime object took a hash vs a hashref? Or, since good intellisense implementations in Java also include inline javadocs, whether DBI's bind_param is 0- or 1-based?
        In theory, it would. In practice, it'd be easier if Perl defined a convention (all array counts start at zero) and modules adhere to that convention.

        In theory, it would be nice to add all of these wizzy new features into a drop dead stunning Perl IDE. In practice, a simple text editor with a handful of powerful abstractions and common design principles is at least as good, if not better.