Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: RFC: object-oriented two-dimensional ragged array tutorial

by paulymer (Novice)
on Sep 11, 2013 at 21:49 UTC ( #1053572=note: print w/ replies, xml ) Need Help??


in reply to Re: RFC: object-oriented two-dimensional ragged array tutorial
in thread RFC: object-oriented two-dimensional ragged array tutorial

Yes, you have given an example of a ragged array. And yes, perl is great for building and manipulating them as you have shown. The difference between the example you give here and the examples I give in my tutorial is a nice contrast between programming in traditional perl5 and OOP with Moose. If you are working with simple scalars such as numbers or strings as elements of your data structures, then Moose would definitely be overkill. I can see your point, that my examples could be considered overkill since I have simply wrapped a 'Cell' class around a scalar string. If that was all I really needed to do, then yes, I went way overboard. I merely used this simple 'Cell' class as an example. Create any complex class with multiple attributes, multiple methods, and add dependencies between those attributes and methods, then tack on inheritance by sub-classing this complex class, and you might begin to see where this tutorial could be useful.


Comment on Re^2: RFC: object-oriented two-dimensional ragged array tutorial
Re^3: RFC: object-oriented two-dimensional ragged array tutorial
by BrowserUk (Pope) on Sep 11, 2013 at 22:55 UTC

    Your argument is that you've used a simple, if ultimately unnecessary example, to demonstrate some of the more complex parts of OO; because you didn't want to detract from the techniques you were demonstrating with the detail of the classes you used to demonstrate them.

    That is a fine argument.

    However, without a convincing example of when it is necessary, (or beneficial in some tangible way), to use the techniques you are demonstrating, it leaves the demonstration looking like a solution looking for a problem.

    So, the challenge to you is: show a realistic example of using those techniques that cannot be trivially and beneficially replaced with simpler, non-OO code.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-12-17 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (31 votes), past polls