Re: OO vs functional programming: what's a suitable newsgroup?

Discussion in 'C++' started by Melzzzzz, Mar 14, 2013.

  1. Melzzzzz

    Melzzzzz Guest

    On Thu, 14 Mar 2013 11:19:25 +0000, Andy Champ wrote:

    > I came across this in a job advert: "Experience of both functional and
    > Object Oriented design and engineering is essential as the product is
    > evolving from following a functional to an OO design discipline". I was
    > a bit surprised at this - I know little of functional programming (in
    > the Erlang/Haskell etc sense, which I assume is what they mean) but I'd
    > thought it was a newer paradigm.
    >
    > This as a discussion doesn't really belong here - can anyone suggest a
    > suitable newsgroup? I did look at comp.programming, but it doesn't look
    > healthy.
    >
    > Andy


    You want to discuss what?
    about OO : comp.object or about functional programming:
    comp.lang.functional?
     
    Melzzzzz, Mar 14, 2013
    #1
    1. Advertising

  2. On 3/14/2013 4:32 PM, Andy Champ wrote:
    > On 14/03/2013 11:33, Melzzzzz wrote:
    >> On Thu, 14 Mar 2013 11:19:25 +0000, Andy Champ wrote:
    >>
    >>> I came across this in a job advert: "Experience of both functional and
    >>> Object Oriented design and engineering is essential as the product is
    >>> evolving from following a functional to an OO design discipline". I was
    >>> a bit surprised at this - I know little of functional programming (in
    >>> the Erlang/Haskell etc sense, which I assume is what they mean) but I'd
    >>> thought it was a newer paradigm.
    >>>
    >>> This as a discussion doesn't really belong here - can anyone suggest a
    >>> suitable newsgroup? I did look at comp.programming, but it doesn't look
    >>> healthy.
    >>>
    >>> Andy

    >>
    >> You want to discuss what?
    >> about OO : comp.object or about functional programming:
    >> comp.lang.functional?
    >>

    >
    > I want a beginner's guide to compare and contrast the two ways of
    > working. I have a funny feeling that if I post to those two groups I'll
    > start a flame war, so I'll pass. I take it there is no general SW
    > engineering group anywhere.


    Really?
    You probably know better, so I'll take your word for it, but if it were
    I looking, I'd try comp.programming or comp.software-eng.

    > That said I've had some useful comments back from various people. I've
    > never touched Lisp, and hadn't realised it was a functional language -
    > my background is purely commercial, not academic.


    Yet, your interest in comparing "the two ways of working" is most likely
    purely academic, no? What profit can there be in comparing the two?
    Once you've done one for some time, you're *unlikely* to be able to
    switch to the other. I bet that from within each community "the other
    side" always looks like the "dark side"... <chuckle>

    V
    --
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Mar 14, 2013
    #2
    1. Advertising

  3. Melzzzzz

    Rui Maciel Guest

    Rui Maciel, Mar 17, 2013
    #3
  4. Melzzzzz

    Rui Maciel Guest

    Chris Vine wrote:

    > So you assert


    I don't assert anything. I've only pointed out that your argument is a
    textbook case of a "no true scotsman" falacy.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #4
  5. Melzzzzz

    Öö Tiib Guest

    On Sunday, 17 March 2013 14:50:41 UTC+2, Chris Vine wrote:
    > The only reasonable inference from your reference to the "no true
    > Scotsman" fallacy was that you were putting yourself forward as the
    > highly competent C++ programmer who provides the counter case.


    It is difficult disagree with you that competent software developer has
    to be savvy with several languages. Lets just count:

    1) He needs to be able to prepare build environment, code repository
    etc. Either with scripts or with tools integrated into IDE (involving
    scripting IDE). Incompetent does such things manually.

    2) Build and deployment systems are typically made with different sort
    of scripts. Incompetent lets IDE to generate it and then whines when
    strange things happen or some odd bogo-tool of his does not
    integrate or deploy.

    3) Various helpers that integrate programs or prepare data for those
    or test them are often written as third sort of scripts. These things are
    again sometimes done manually or not done at all by incompetent.

    4) The compiled language itself in what the program is written is
    usually entirely different from the ones above. Here incompetent tries
    often to fix the shortcomings of his other tooling with various
    unneeded bloat.

    5) Modern times web browser is too usual target for UI, so there
    comes another programming language Javascript (plus several markup
    languages).

    So it can't be said that one who does not know 5 languages is likely
    kicking puppies too ... just that he can't likely deliver on his own and
    needs help of others. I do not know English ... is it jackeroo or prentice
    or how to name such guy.
     
    Öö Tiib, Mar 17, 2013
    #5
  6. Melzzzzz

    Rui Maciel Guest

    Chris Vine wrote:

    > "Most" is the kind of quibble that can come in handy!
    >
    > Really though, if you are highly competent at C++ I am surprised you
    > do not know any functional language to some degree. You cannot do
    > template metaprogramming without coming across things like recursion.


    No one is forced to learn an entirely different programming language to
    learn how to use a language feature which was already inherited from C.
    Perhaps you are referring to the functional programming paradigm instead of
    functional programming languages.


    > As a side note, testing a programmer on recursion is a useful way of
    > gauging his/her ability more generally in my experience. Also, those
    > who struggle with recursion also seem to struggle with programming with
    > threads. Possibly this is because both require you to hold more than
    > one context in your mind at the same time.


    In C++, and even in other languages such as C, recursion is frowned upon
    because, contrary to functional languages, tail call elimination isn't
    mandated. As a consequence, blindly using recursion with these programming
    languages carries a danger of bursting the call stack, which tends to be
    frowned upon.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #6
  7. Melzzzzz

    Rui Maciel Guest

    Chris Vine wrote:

    > No, I've only pointed out that it was certainly not.
    >
    > What perhaps you were trying to assert was that my proposition was so
    > broad as, although logically falsifiable, in practice incapable of
    > being so and therefore worthless. Or perhaps you were trying to assert
    > that my proposition was so patently false as to amount to hand-waving.
    > However, neither of those gives rise to the "no true Scotsman" fallacy.


    I didn't asserted anything. Please stop claiming I did.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #7
  8. Melzzzzz

    Stefan Ram Guest

    Rui Maciel <> writes:
    >Perhaps you are referring to the functional programming paradigm instead of
    >functional programming languages.


    A competent C++ programmer needs to know one language: C++.

    Insofar as functional programming is possible with C++,
    he can learn it with C++. Insofar as it is not possible
    with C++ he does not need to learn it.

    Knowing another language can even mislead the programmer to
    try to use idioms of that other language in C++, which might
    not be idiomatic in C++. Some even claim that certain
    perfect pieces of C++ code were written in bad style, because
    it is deemed wrong or to be bad style in another language.
     
    Stefan Ram, Mar 17, 2013
    #8
  9. Melzzzzz

    Rui Maciel Guest

    Paavo Helde wrote:

    > One should not use anything in C++ blindly, the language is so full of
    > undefined behavior that any such attempt will ultimately fail and
    > hopefully rather sooner than later.
    >
    > However, for example if there appears to be a nice recursive function for
    > navigating an hierarchical data structure and I know the depth of the data
    > structure is limited in practice to some sane values, there is no reason
    > why I should rewrite my function by hand and create a convoluted non-
    > recursive version of it. Of course, the worst-case depth ought to be
    > covered by unit tests for all needed target platforms.


    You are absolutely right.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #9
  10. Melzzzzz

    Rui Maciel Guest

    Stefan Ram wrote:

    > A competent C++ programmer needs to know one language: C++.
    >
    > Insofar as functional programming is possible with C++,
    > he can learn it with C++. Insofar as it is not possible
    > with C++ he does not need to learn it.
    >
    > Knowing another language can even mislead the programmer to
    > try to use idioms of that other language in C++, which might
    > not be idiomatic in C++. Some even claim that certain
    > perfect pieces of C++ code were written in bad style, because
    > it is deemed wrong or to be bad style in another language.


    Very true.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #10
  11. Melzzzzz

    Rui Maciel Guest

    Chris Vine wrote:

    > You seem to pile one inconsequentiality on another. Not all recursion
    > is tail recursion which can be optimised out of the call stack.


    When you wrote that «testing a programmer on recursion is a useful way of
    gauging his/her ability more generally in my experience», were you referring
    to recursion in general or only to the bits you now find convenient for
    pedantry's sake?


    > Not
    > all functional languages require tail calls to be optimised (scheme
    > does, common lisp does not, some MLs do, some don't, I don't know about
    > haskell).


    Taken from Guy Steele's "Common Lisp", 2nd edition, page 686:

    «The compiler may assume that, within a named function, a recursive call to
    a function of the same name refers to the same function, unless that
    function has been declared notinline. (This permits tail-recursive calls of
    a cuntion to itself to be compiled as jumps, for example, thereby turning
    certain recursive schemas into efficient loops.)»

    If we put our pedantry hat on, this may not count as a language
    specification mandating this behavior. But in order to ignore this you need
    to cram the pedantry hat right down to the chin.


    > And although g++-4.7 onwards will


    <snip/>

    Read what I wrote in the previous post.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #11
  12. Melzzzzz

    Rui Maciel Guest

    Chris Vine wrote:

    >> I didn't asserted anything. Please stop claiming I did.

    >
    > Would you mind saying what your point was then?


    Read the thread. I've already answered that.


    Rui Maciel
     
    Rui Maciel, Mar 17, 2013
    #12
  13. Melzzzzz

    Melzzzzz Guest

    On Sun, 17 Mar 2013 18:37:49 +0000
    Chris Vine <> wrote:

    Not
    > all functional languages require tail calls to be optimised (scheme
    > does, common lisp does not, some MLs do, some don't, I don't know
    > about haskell).

    "
    In Haskell, the function call model is a little different, function
    calls might not use a new stack frame, so making a function
    tail-recursive typically isn't as big a deal—being productive, via
    guarded recursion, is more usually a concern.
    "
    http://www.haskell.org/haskellwiki/Tail_recursion
     
    Melzzzzz, Mar 17, 2013
    #13
  14. Melzzzzz

    Melzzzzz Guest

    On 17 Mar 2013 18:37:02 GMT
    -berlin.de (Stefan Ram) wrote:

    > Rui Maciel <> writes:
    > >Perhaps you are referring to the functional programming paradigm
    > >instead of functional programming languages.

    >
    > A competent C++ programmer needs to know one language: C++.


    Well, knowledge of assembler always helps ;), but I agree.

    >
    > Insofar as functional programming is possible with C++,
    > he can learn it with C++. Insofar as it is not possible
    > with C++ he does not need to learn it.


    Problem with functional programming is that most
    of algorithms are meant for imperative languages,
    so lot of algorithms are pain to express in functional
    style, and even when one express certain algorithm ,
    result is highly inefficient code.
    Then functional programmer writes algo in imperative
    style in functional language which is pain (Haskell).
    I guess in hybrid languages writing imperative style
    is easier.
    I found that efficiently programming in functional
    style is very difficult, and requires much deeper knowledge
    than writing in imperative style.

    >
    > Knowing another language can even mislead the programmer to
    > try to use idioms of that other language in C++, which might
    > not be idiomatic in C++. Some even claim that certain
    > perfect pieces of C++ code were written in bad style, because
    > it is deemed wrong or to be bad style in another language.


    Exactly.

    >
     
    Melzzzzz, Mar 17, 2013
    #14
  15. Melzzzzz

    Melzzzzz Guest

    On Sun, 17 Mar 2013 19:43:59 +0000
    Chris Vine <> wrote:

    > On 17 Mar 2013 18:37:02 GMT
    > -berlin.de (Stefan Ram) wrote:
    > > Rui Maciel <> writes:
    > > >Perhaps you are referring to the functional programming paradigm
    > > >instead of functional programming languages.

    > >
    > > A competent C++ programmer needs to know one language: C++.
    > >
    > > Insofar as functional programming is possible with C++,
    > > he can learn it with C++. Insofar as it is not possible
    > > with C++ he does not need to learn it.
    > >
    > > Knowing another language can even mislead the programmer to
    > > try to use idioms of that other language in C++, which might
    > > not be idiomatic in C++. Some even claim that certain
    > > perfect pieces of C++ code were written in bad style, because
    > > it is deemed wrong or to be bad style in another language.

    >
    > Not all agree. "First of all, nobody should call themselves a
    > professional if they only know one language":
    >
    > http://www.youtube.com/watch?v=NvWTnIoQZj4
    >
    > However, this is not an appeal to authority on my part. My views are
    > just based on my observations.
    >
    > Chris


    Note, that functional language/paradigm is not mentioned here.
     
    Melzzzzz, Mar 17, 2013
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 88888 Dihedral
    Replies:
    14
    Views:
    350
    Alain Ketterlin
    Mar 16, 2013
  2. Öö Tiib
    Replies:
    7
    Views:
    221
    Nick Keighley
    Mar 17, 2013
  3. Stefan Ram
    Replies:
    0
    Views:
    228
    Stefan Ram
    Mar 14, 2013
  4. Bart van Ingen Schenau
    Replies:
    9
    Views:
    232
    Stefan Ram
    Mar 18, 2013
  5. Nick Keighley
    Replies:
    1
    Views:
    246
    Nobody
    Mar 16, 2013
Loading...

Share This Page