3 ms·
Yeah - the nurble method. It's really the Clojure that looks the worst. Taking just the boolean query to figure out whether the word is in the noun list, I'd p
by nevster 14y ago
Yeah - the nurble method. It's really the Clojure that looks the worst.
Taking just the boolean query to figure out whether the word is in the noun list, I'd place them in this order from simplest to understand through to most obfuscated
Python: if word not in NOUNS
Java: if (!nouns.contains(word))
PHP: if(!in_array($word, $nouns))
Ruby: if not @@nouns.include? word
Clojure: if (not (some (partial = word) nouns))
The Python is pretty much just english
The Java is almost english except for the !
PHP is starting to get more obtuse - ! and $ and you have to know the order of the parameters
Ruby (from the article) has @@ and ? but isn't too bad - might go above the php
Clojure is just weird - looking at the others, I reckon a person could easily modify and write a similar program without knowing much of the language. With Clojure I think it requires deeper understanding.
I haven't included your Ruby in that list because it's doing a different (much neater :) ) thing.