I propose to have predefined constants of TrueClass and FalseClass - yes/no accordingly.
Benefits:
'truefalse'.size - 'yesno'.size = 4 (!)
much more understandable and reasonable words. Well known by everybody on this planet.
would be nice feature to introduce. Object#no? so we could use.
puts 'horay!' unless will_you_marry_me.no?
but it is very small thing, !will_you_marry_me behaves the same.. nevermind if it doesn't look useful
in further releases of ruby we could use them by default and keep true/false only for compatibility e.g.:
[2] pry(main)> true
=> yes
to discuss:
how to manage with true-false constants
do you like it?
P.S. I hope it is not crazy proposal for Ruby 4.9.3. I believe that ruby is agile enough. thoughts?
That wasn't offense at all. There was a hype on Twitter about your Borat-like sentences (which were treated positive and funny) so this was a little pinch to them.
Anyway, to say something on topic. I don't like the idea.
"much more understandable and reasonable words. Well known by everybody on this planet"
Programming language is for programmers and true/false are very well known among them. No need for new aliases IMO.
@sebastian Yes they are for programmers. And there were no need for C/C++/... because assembler commands were very well known among programmers. Is it fair enough?
PLs need to evolve. And move on with standards too.
I don't mind jokes on me but I didn't get that one, nevermind then.
It is good point but would you consider it like if/unless? they do same job but used in proper places.
p 1 if yes
p 2 unless no
Newbies learn rapidly. And 'yes/no' thing will be the first thing they will like in ruby(in the same time obscure 'true/false' is what other languages can suggest)
the issue seems even newbie-friendly and it is benefit too.
ps just, isn't this awesome?
user_authenticated = yes
@ujihisa hrm.. Are you trying to inject english grammar in the logic? And, What is wrong with
"Didn't you eat sushi?": "Yes I did" = false
There is an ambiguity if you only use x.didnt_you_do_y? instead of x.did_you_do_y? and that is a very rare case.
But, honestly, I see some ambiguous things. In those cases you should better use true/false if would like to. Anyway it is just a habit IMO
I really hate the names "true" and "false" for another reason:
their length should be equal. For the same reason, I also hate
yes/no, in/out, width/height, left/right, etc.
I want to see these BUGS were fixed in English 2.0.
I really hate the names "true" and "false" for another reason:
their length should be equal. For the same reason, I also hate
yes/no, in/out, width/height, left/right, etc.
Third party's issue. Report to the upstream.
You can use :true and false instead, in Ruby at least.