Is Ruby a functional language?

前端 未结 12 1654
谎友^
谎友^ 2021-01-30 04:09

Wikipedia says Ruby is a functional language, but I\'m not convinced. Why or why not?

12条回答
  •  Happy的楠姐
    2021-01-30 04:35

    Ruby isn't really much of a multi-paradigm language either, I think. Multi-paradigm tends to be used by people wanting to label their favorite language as something which is useful in many different areas.

    I'd describe Ruby is an object-oriented scripting language. Yes, functions are first-class objects (sort of), but that doesn't really make it a functional language. IMO, I might add.

提交回复
热议问题