in reply to Re^2: What are the drawbacks of autobox?
in thread What are the drawbacks of autobox?
it's easier to read (and write) $ar->[$x][$y][$z]->push("element") than push @{$ar->[$x][$y][$z]}, "element"
The basic programming 'association' as you term it is: $name = value;
And I think there is clarity in the mirrors: push @array, value; and push @{ <arrayRef> }, $value;.
The flow is in one left-to-right direction and doesn't jump around, the association is much more evident.
The left to right association of an array reference pushed onto an element?
I don't know of any language where the car->get's into->the man or the queue->joins->the boy are valid. Syntactically or semantically.
this clear association ...
I do not see this association you speak of, let alone clearly.
make it much easier to parse (statically) and to design help systems in IDEs, interactively popping up the documentation for a method.
Hm. So you consider making the language easier for the computer to parse, at the expense of making it harder for the human being, a benefit?
method calls often allow cascading, like this enabling more expressive code.
I'd really like to see you find a real live working example that demonstrates the use of cascading method calls. Once you find an example, we can then argue about how "expressive" it is.
For me, one of the many things I like about Perl is the wonderful expressiveness of the carefully tuned syntax. Making every operator a method call, is like fitting a tiller and anchor to your Fireblade.
it's easier to introspect (dynamically)
I absolutely challenge the need for dynamic introspection. Beyond your, REPL-prompts-the-programmer example, do you have a good example of when you might make use of this?
Extending new methods which only work with special data-types (like adding ruby's each-behaviour to arrays)
Is defining each() for arrays so hard? Or do you even need to do it at all:
map{ ... } @array; ... for @array; sub each{ my $code = shift; $code->( $_ ) for @_; }
it gets easier to port JS or Ruby code to Perl,
That'd be a nice challenge. Pick a piece of published Ruby code, and you can port it with autobox and me without?
look at the arguments from the Perl6 designers ...
Only time will tell how well that works out in practice.
TIMTOWTDI =)
Actually, the underlying tenet of autobox is TIOOWTDI. Ie. The only operator allowed is ->.
JS, Ruby and even Smalltalk don't try and replace the normal math infix operators with a post-fix operator and verbose method names.
If you really want your 2009 cpu to run like a 1999 cpu, investigate:
use DB; sub DB::db{ sleep 1 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What are the drawbacks of autobox?
by punkish (Priest) on Mar 01, 2010 at 03:21 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 13:05 UTC | |
|
Re^4: What are the drawbacks of autobox?
by chromatic (Archbishop) on Mar 01, 2010 at 03:01 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 11:58 UTC | |
by chromatic (Archbishop) on Mar 01, 2010 at 18:17 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 18:34 UTC | |
by Anonymous Monk on Mar 01, 2010 at 03:22 UTC | |
|
Re^4: What are the drawbacks of autobox?
by LanX (Saint) on Mar 01, 2010 at 00:38 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 00:44 UTC | |
| |
|
Re^4: What are the drawbacks of autobox?
by dsheroh (Monsignor) on Mar 01, 2010 at 11:12 UTC |