[Haskell-cafe] Object Oriented programming for Functional Programmers

Mike Meyer mwm at mired.org
Mon Dec 31 15:33:09 CET 2012


On Mon, Dec 31, 2012 at 7:46 AM, Strake <strake888 at gmail.com> wrote:
> Disclaimer: My own experience with OO is limited.

Mine isn't quite so much...

> On 30/12/2012, Daniel Díaz Casanueva <dhelta.diaz at gmail.com> wrote:
>> My programming life (which has started about 3-4 years ago) has always been
>> in the functional paradigm. Eventually, I had to program in Pascal and
>> Prolog for my University (where I learned Haskell). I also did some PHP,
>> SQL and HTML while building some web sites, languages that I taught to
>> myself. I have never had any contact with JavaScript though.
>>
>> ...
>>
>> I thought it could be good to me (as a programmer) to learn C/C++.
>> It looks like I have to learn imperative programming (with side effects all over around) in some point of my programming life.
>> So my questions for you all are:
>>
>> * Is it really worthwhile for me to learn OO-programming?
> Likely. Some code is most readily written in objective style.

Learning a new paradigm is almost always a good idea. It gives you a
new set of tools for approaching programming problems. Of course, the
single worst thing you can do is try and force a paradigm onto a
language that isn't meant for it.

>> * If so, where should I start? There are plenty of "functional programming
>> for OO programmers" but I have never seen "OO programming for functional
>> programmers".
> Smalltalk.

That's a good functional start. Personally, I'd go with Eiffel,
because it means you can use Meyer's (no relation) Object Oriented
Software Construction as a text. Unfortunately, you'll have to buy a
dead trees copy of that text. It not only covers OO programming, but
explains why things are the way they are, why the way C++ is is wrong,
and provides an introduction to design-by-contract as well.

    <mike



More information about the Haskell-Cafe mailing list