3 ms·
I liked this line: "Though Ruby/Rails would likely have been fine too, there’s something about it that I just found unnatural. If I had a dog, the dog would ba
by avdempsey 16y ago
I liked this line: "Though Ruby/Rails would likely have been fine too, there’s something about it that I just found unnatural. If I had a dog, the dog would bark at the Ruby code."
That's how I felt when I started learning Ruby after years and years of Python. Ruby has method names with question marks in them...my dog would bark at that.
- ScottBurson 16y agoYour dog obviously doesn't know Lisp :) Lisp allows any characters in a name (although some characters need to be escaped). So for example, I have a class called "2-relation" (because I thought "binary-relation" was too long). The use of dashes in names is routine in Lisp; names beginning with digits are not so common, but are perfectly legal. And yes, though it's not the traditional style, some Lispers (including me) end the names of predicates (boolean-valued functions) with question marks.
- paradoja 16y agoThe «?» ending is common in (at least some implementations/variants of) Scheme. In Common Lisp and other Lisps, on the other hand you'll usually see «-p» instead of the «?».
- seiji 16y agoI prefer free form function names when when parenthesis aren't required after the function name. Hyphens in function names are great too. (member? 'a some_list) member?('a', some_list) <-- ugly member? :a, some_list (check-user-credentials session user) (is-user-authorized? page user)
- avdempsey 16y agoTrue, not having parens on the end of the function call makes this look better (and those parens are optional in Ruby). Extra kudos to lisp flavors because you could argue they have even "purer" syntax than Python. Mostly, I'm just tickled by the idea of "would my dog bark at it?" as a mental test.
- draegtun 16y agoHyphens in function names are great too Totally agree and there are good reasons why they are useful: http://news.ycombinator.com/item?id=1842575 http://news.ycombinator.com/item?id=1842575 BTW, While perl6 added hyphen usage to variable names :) unfortunately I don't think it added question mark :(
- jamesbritt 16y agoI'd get rid of the dog. :)