in reply to Programming using data structures
I have a number of ... nits ... with your Disadvantages section. (Of course, I might be missing something ...)
#### Define like: my %sort_by = ( ( map { $_ => sub { $a->{$_}{order} <=> $b->{$_}{order} } } qw(title subject author isbn)), }; #### Use like: my @titles = sort &{$sort_by{title}} @books;
There are so many things wrong with that statement I don't know where to begin. OO isn't a "layer". That is a procedural programmer talking who doesn't understand what OO is about. That would be like me, who doesn't do functional programming (and take that as you will), saying that I can just wrap a bunch of closures around my objects and it now got a "functional layer". You don't have re-use, you don't have decomposition, you don't have anything that makes OO programming ... OO.
Again, a procedural programmer's gripe about OO. You shouldn't be debugging more than one object at a time cause you shouldn't be working on more than one object at a time. If you make changes in too many places between tests, of course you're going to be clueless about where the bug is. If you make one change - test, one change - test ... you'll know with 75% certainty where the bug is because you just changed that piece of code. (The other 25% is if you fixed something that exposed another flaw somewhere else.)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Programming using data structures
by dash2 (Hermit) on Feb 20, 2003 at 17:35 UTC |