Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This would go against the ruby style of using predicates for this sort of thing (think `include?`, `empty?`, `nil?`).

I personally wouldn't be in favor of it.

Addition: Arguing that "Ruby isn't English" and then stating conformity to mathematical notation as a benefit seems hypocritical. Programming languages (besides APL, maybe) do not use strict mathematical notation, and we shouldn't want them to.



.include? isn't really a predicate, as predicates are typically unary. Rather, it's the 'member of' relational operator written in the wrong direction. Since we don't have '∈' in ascii, the author is proposing using the word 'in' instead.

I do disagree with the author on one point: 'not in' should also be a valid operator, representing '∉'.

But I don't use Ruby; I mostly use Python, which has these operators.


It's not a problem using non ASCII method names in Ruby: https://gist.github.com/bhaak/91428b9aee88ac50dd1d

I can't think of any modern programming language that isn't unicode aware even though for the standard library methods, there are very good reasons not to use them (I know, Perl 6 does but even in this case there are ASCII fallbacks).

You should also have very good reasons to put methods on the root class of your class hierarchy.


> It's not a problem using non ASCII method names in Ruby

Making it easy for people to type them, on the other hand...


> Making it easy for people to type them, on the other hand...

That's a problem of the code editors people are using. ;-)

I'm often surprised with how dysfunctional editors people are programming.

For example if all editors would show tabs and spaces (or whitespace in general) in a reasonable way, we wouldn't have had that much pointless discussion about the correct indentation whitespace character.


I don't think it 'goes against' anything... it's simply a more concise way of doing the .include? - it's syntactic sugar.

And as he points out, 'in' is already a keyword anyway - so if it makes a more readable way of doing things, then why not?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: