News for hackers. Stuff that matters.
Re:Programming is hard, let's go scripting.. by jrockway on Wednesday April 04, 2012 @05:38PM (#3799986)
I 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.)

Re:Programming is hard, let's go scripting.. by stcredzero on Wednesday April 04, 2012 @06:11PM (#3800130)
As 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.
Re:Programming is hard, let's go scripting.. by jrockway on Wednesday April 04, 2012 @06:20PM (#3800162)
At 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.

Re:Programming is hard, let's go scripting.. by prodigal_erik on Thursday April 05, 2012 @01:47AM (#3801481)
Really? 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.