On Sat, 2016-09-10 at 13:58 +0000, Pedro David Marco wrote: > Thanks Martin! > This is exactly the book i have right now but experts opinions are > always a good idea! :-) > IMO the Camel book should be part of every Perl programmer's library. If you don't write much Perl, I'm primarily a C and Java programmer BTW, it probably covers everything you'll need.
However, I don't think Perl is a wonderful language to learn about OO from, because it seems to implement OO by extending other language features so I may pay you to get comfortable with OO concepts by using another language - Java and Python are probably best here. I think that of the two Java shows the concepts most clearly since its impossible to write Java without declaring classes, but OTOH it has a dauntingly large standard class library. Python, like Perl, can be used both procedurally and for OO programming, but this may tend to leave OO concepts a bit less clear. Neither language has any particularly clear introductory texts, though O'Reilly's "Python in a Nutshell" is OK. > Abstracting calculations in a method would mean one call from each > other method right? I would prefer to have done just once (maybe in > the constrcutor?) but... > Procedural abstraction is common in all modern programming languages from the Algols and C onwards. As you say, abstraction is the concept of writing a commonly used piece of code only once and calling it whenever its needed. This has nothing to do with a class's constructor(s): their only function is to initialise the class when it is first instantiated. Conversely, it is quite normal for some of a class's methods to be called by one or more of its constructors. Martin