3 ms·
Object oriented, functional, declarative you say it Perl has it. Its amazingly flexible, easy to learn and extensible. My first programming job was in Perl bac
by stcredzero 15y ago
Object oriented, functional, declarative you say it Perl has it. Its amazingly flexible, easy to learn and extensible.
My first programming job was in Perl back in the late 90's. Loved it, but I have to say that the OO facilities left something to be desired. I found them fatiguing. It took Java, then Smalltalk for me to really get OO. Perl requires too much mastery of mechanism just to do objects, so it's not the best environment for learning OO.
- chromatic 15y agoMy history is the opposite. I failed to understand objects in C++, then learned Java, and then learned Perl. Playing with the mechanism helped me understand OO. (Exploring Smalltalk after that helped.) After learning Moose a couple of years ago, I don't miss the Perl 5 mechanism at all.
- jrockway 15y agoI agree with chromatic below; Java and C++ do not teach you OO. They teach you cut-n-paste without a text editor. (When Bar extends Foo, you're copying-and-pasting Foo's code into Bar, and then tweaking it. Or at least that's how class-based OO is used a good percentage of the time.) A better way to program is with interfaces and composition via delegation, something that Java and C++ support but have no syntax for making it easy. Perl's Moose object system, on the other hand, has easy support for composition via roles and delegation via ... well, delegation :) And, you have "extends"-style OO available if you think it's the right solution to a particular problem. So really, I think it's a fine way to learn OO. Doing things right is easier, if you decide to do them right. (We do Java OO right at Google, but it sure involves a lot of typing and @hacky-attributes. And I've never seen good Java OO anywhere else.)
- stcredzero 15y agoAs a Smalltalker with a decade of experience, I too find Java a bit lacking. That said, it was a better environment for OO than Perl at the time. I was able to get a feel for refactoring through Java, though. That primed me for Smalltalk and the joy of no primitive types.
- jrockway 15y agoAt the time, yes, absolutely. Now, Perl is pretty nice, and you get a lot of nice libraries. I have used Java and Python extensively now and I like Perl a lot more. All three are quite usable, however.
- prodigal_erik 15y agoReally? I see inheritance as a good antidote for cut'n'paste. If you don't physically duplicate code, you'll never have to read both copies just to make sure they're still the same. I agree most devs do it wrong, but I think it's because they're purely pragmatic and haven't read or thought philosophically about the open/closed principle, programming-by-difference, Liskov-substitutability… And I do want to remind readers that Moose is not the Perl object system, it's an object system added on top of the mess that a huge collection of legacy code presumes.
- elb0w 15y agohttps://metacpan.org/module/Moose https://metacpan.org/module/Moose not the 90's anymore