Should I do functional programming in Ruby?

Discussion in 'Ruby' started by Yu-Hsuan Lai, Nov 25, 2010.

  1. Yu-Hsuan Lai

    Yu-Hsuan Lai Guest

    [Note: parts of this message were removed to make it a legal post.]

    I'm a high school student and beginner of ruby.
    I know that ruby is a functional-hybrid language which has many elegant
    features such as first-class function, closure and implicit return.

    But I also have heard the slogan "least astonishment".
    I only used to learn C and C++. In my country, majority of students (school
    or university) study C/C++/Java and self-study C#/VB/PHP/ASP. We seldom use
    lisp or haskell.
    I think that for most people, functional programming can cause much
    astonishment.
    Of course readability is important. So, should I write ruby in C-like
    paradigm in order to decrease astonishment?

    --
    Lai, Yu-Hsuan
     
    Yu-Hsuan Lai, Nov 25, 2010
    #1
    1. Advertising

  2. Yu-Hsuan Lai

    Stu Guest

    Only you can answer that question.

    If your interested in programming in like C procedural you may feel
    that it feels more like shell scripting than C. though you can and
    there are helper objects which may make you feel at home for your data
    structures (i.e. push pop) and there is also an implementation of
    printf and sprintf.

    Understand though that Ruby is as far as you can get from the whole
    "showing the implementation" as you may be used to in C. Ruby is
    object oriented to the extreme. Everything is a sender and a receiver.
    Your return statements as well as parens are optional and implied.
    Also case statements actually work and are not "broken" like they are
    in c/c++/java.

    The concept of "least astonishment" refers to programmers who migrate
    from other languages may feel comfortable programming in ruby with
    minor learning curve( if any).

    I believe looking at what is unique ruby is what you may want to
    investigate. Ruby has the ability to manipulate itself and evolve
    through it's own meta-structures and introspection. I would imagine
    functional programming though closures may play a role in this as
    well. Though I also know it's optional. Just like everything else in
    ruby the choice is yours.

    ~


    On Thu, Nov 25, 2010 at 2:26 PM, Yu-Hsuan Lai <> wrote:
    > I'm a high school student and beginner of ruby.
    > I know that ruby is a functional-hybrid language which has many elegant
    > features such as first-class function, closure and implicit return.
    >
    > But I also have heard the slogan "least astonishment".
    > I only used to learn C and C++. In my country, majority of students (school
    > or university) study C/C++/Java and self-study C#/VB/PHP/ASP. We seldom use
    > lisp or haskell.
    > I think that for most people, functional programming can cause much
    > astonishment.
    > Of course readability is important. So, should I write ruby in C-like
    > paradigm in order to decrease astonishment?
    >
    > --
    > Lai, Yu-Hsuan
    >
     
    Stu, Nov 25, 2010
    #2
    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. Casey Hawthorne
    Replies:
    4
    Views:
    1,042
    Jarek Zgoda
    Aug 4, 2006
  2. Joe Mayo
    Replies:
    168
    Views:
    3,443
    David Thompson
    Oct 22, 2007
  3. Brian Candler

    Functional programming in Ruby

    Brian Candler, Feb 28, 2007, in forum: Ruby
    Replies:
    9
    Views:
    164
    James Edward Gray II
    Mar 1, 2007
  4. Jesse Merriman

    Backus, Functional Programming, and Ruby

    Jesse Merriman, Mar 25, 2007, in forum: Ruby
    Replies:
    10
    Views:
    258
    Giles Bowkett
    Mar 26, 2007
  5. Philip Rhoades
    Replies:
    4
    Views:
    117
    James Britt
    Jun 29, 2008
Loading...

Share This Page