5 ms·
I don't see what Ruby's “beautiful philosophy” is. Here are some examples of philosophies I actually consider beautiful, regardless of the result they led to:
by catnaroek 10y ago
I don't see what Ruby's “beautiful philosophy” is. Here are some examples of philosophies I actually consider beautiful, regardless of the result they led to:
(0) Lisp, Scheme, Forth: “A small extensible core language beats a fixed large language.” (While Common Lisp is actually pretty large, there's a rather small subset of it from which the rest can be built.)
(1) ML, Haskell: “Let's see how much we can do using types as our primary abstraction enforcement mechanism.”
(2) C++, Rust: “Abstraction isn't at odds with efficiency and fine-grained control.” (Runtime enforcement is, though.)
What does Ruby have to offer? Matsumoto claims to prioritize “developer happiness”, but allowing arbitrary modifications to arbitrary parts of any program doesn't make everyone happy. And, even if it did, “developer happiness” isn't a technical criterion anyway.
- ZenoArrow 10y ago> "And, even if it did, “developer happiness” isn't a technical criterion anyway." It's a guiding principle, it doesn't have to be a technical one. For what it's worth, I'd say Elm also has this philosophy, possibly Elixir too (though I'm not as familiar with Elixir).
- rauljara 10y agoI'll bite. Ruby has a beautiful and consistent object / module system, a beautiful integration of functional and object oriented programming paradigms, and extreme powerful metaprogramming. All of those things are pretty wrapped up in its design philosophy which contains a whole bunch more than developer happiness. Yes, Ruby has warts. So do all the other languages you listed. It is helpful to be able to see both the good and bad in languages and not get hung up battling them against each other.
- catnaroek 10y ago> Ruby has a beautiful and consistent object / module system, I don't program much with objects, so I don't know what to expect from them, but after programming in a language that treats modules seriously (Standard ML), I can't accept anything less than the following from anything that calls itself a “module system”: (0) Implementor-side abstraction: Fine-grained control over which implementation details are exposed to different parts of a program. (1) Client-side abstraction: The ability to define a module as a function of another, yet to be supplied, module. Ruby's “module system” doesn't quite cut it. > a beautiful integration of functional and object oriented programming paradigms Functional programming in Ruby is possible, but a gigantic pain: (0) Partially applied functions are mildly inconvenient. (1) Higher-order functions that recursively pass themselves a modified version of their function argument(s) are not so mildly inconvenient. (2) Now imagine actually debugging such beasts when you make a mistake. Unit tests don't help because they overemphasize the concrete cases, when higher-order functions are all about abstracting as much as possible. At a more fundamental level, functional programming is value-oriented, and programming with compound values (not the same thing as compound objects) in Ruby isn't the path of least resistance, to put it mildly. > Yes, Ruby has warts. So do all the other languages you listed. I wasn't commenting on the languages themselves, but rather the philosophy of their designers. C++ has more than “warts” - the language as a whole is a monstrous abomination, but the philosophy of not accepting unneeded performance overheads is aesthetically pleasing IMO.
- MustardTiger 10y agoRuby essentially has no module system, and it only offers awkward tacked on support for small bits of functional programming. Hardly an integration of FP and OOP at all, much less a beautiful one.
- chriswarbo 10y agoI'm not a Ruby user, but its dynamic OO nature reminds me of the Smalltalk and Self tradition, and those languages certainly do stick to a "beautiful philosophy", something like 'it's method calls all the way down'. Other beautiful philosophies include: - Logic programming. Although Prolog strayed from the path in the name of efficiency, approaches like minikanren seem more "philosophically pure". - Term rewriting. I've only used it in the form of Maude, but Pure looks like a more practical implementation. - Proof assistants. The (tongue in cheek) philosophy is something like "once it compiles, we don't even need to run it". Agda is probably the most "pure" example which is still maintained. Less elegant examples are Coq, which uses imperative metaprogramming, and Idris which has no qualms with switching off checks in the name of pragmatism.
- catnaroek 10y agoAgreed about Prolog. I missed that one. I know neither Maude nor Pure, so I can't comment. Coq is ridiculously powerful, but hardly beautiful.
- im_down_w_otp 10y agoAre we not doing, "Phrasing." anymore? Guys? Guuuyyysss? .... Danger zone!
- chriswarbo 10y ago> Coq is ridiculously powerful, but hardly beautiful. I agree, hence my qualification that it relies on an imperative layer (Ltac) to do anything useful, like dependent pattern-matching. I've edited my potentially ambiguous phrasing.
- snaky 10y ago- Concatenative and tacit programming. Forth, APL, Joy, Unix pipes, Haskell's point-free style to name a few
- MustardTiger 10y agoThat is not the philosophy underlying ML or haskell. What you gave for lisp would be more appropriate for both SML and haskell than what you gave for ML/haskell.