in reply to Mutator chaining considered harmful
Chained mutators can
- Save typing
- Create symmetry
- Result in clearer code.
Want to see another channel? Call anatrace again.my $s= Scope->new('probe' => $netlist) ->anatrace('in', 'System input', 'active', 1) ->anatrace('out_1', 'Lpf bank1', 'active', 1) ->anatrace('out_2', 'Lpf bank2', 'active', 1024) ->anatrace('out', 'System output', 'active', 1) ->anatrace('bank2', 'Switch pos', 'active', 1) ->generate();
I don't think that features with potential downsides should be 'considered harmful'.
It is possible to create a 'little language' out of chained method calls. I avoid creating little languages because I have seen a few of them grow into voracious blood-sucking monsters. I can enjoy chaining method calls without fear of triggering a science-related memetic disorder.
It should work perfectly the first time! - toma
In Section
Meditations