4 ms·
"Scheme has a lot of parenthesis that makes it look very old fashion." Might I argue that this is a huge advantage? No one knows scheme, and it's very obscure,
by calinet6 14y ago
"Scheme has a lot of parenthesis that makes it look very old fashion."
Might I argue that this is a huge advantage? No one knows scheme, and it's very obscure, and looks nothing like other programming languages. This means that you can teach concepts using it and pre-judgements about the language don't get in the way.
Then, I suppose the same could be said of CAML and its obscurity.
- webreac 14y agoWhich one is obscure ? define factorial (lambda (n) (if (= n 0) 1 (* n (factorial (- n 1)))))) let rec fact = function | 0 -> 1 | n -> n * fact (n - 1);; There is a little more syntax to learn in caml, but the suppression of 90% of the parenthesis makes the code far easier to read.
- gnosis 14y agoWith syntax hilighting and proper indenting, the Scheme code is pretty easy to read: http://img1.imagilive.com/0413/scheme-fact.png http://img1.imagilive.com/0413/scheme-fact.png You could even simplify it a little by getting rid of the lambda: http://img1.imagilive.com/0413/scheme-fact2.png http://img1.imagilive.com/0413/scheme-fact2.png In any case, I find toy examples like this less than convincing. In real-world programs, issues of style, design, and documentation usually trump most anything else, as far as clarity is concerned. Also, I personally find the penchant for one-letter variable names in the OCaml/SML/Haskell world to be very confusing and obfuscating. The Scheme way is to be more verbose and explicit. For me, that results in much greater clarity -- especially when looking at unfamiliar code or code that you've stepped away from for a few months. Of course, there also such a thing as being too verbose and explicit. But for me, Scheme is in the sweet spot between verbosity and terseness.
- davexunit 14y agoI find the lisp easier to read.
- eru 14y agoE.g. Haskell has enough syntactic sugar for some an even simpler version factorial n = product [1..n]