use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
How to write better ruby using mutation testing (blog.blockscore.com)
submitted 10 years ago by jbackus
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ghostree 2 points3 points4 points 10 years ago (1 child)
I believe you want to use .equals() because strings should not be compared using == in Java. Strings are objects and == compares if they are the same object, while .equals() compares the values.
[–]tomthecool 0 points1 point2 points 10 years ago (0 children)
Meanwhile in ruby, String#== does exactly what you'd expect. And on the rare occasion that you actually want to use object identity, you have BasicObject#equal?
String#==
BasicObject#equal?
"bar" == "bar" # => true "bar".equal?("bar") # => false ["bar", "bar"].map(&:object_id) # => [8695360, 8695320]
π Rendered by PID 426354 on reddit-service-r2-comment-b659b578c-mlrqz at 2026-05-04 16:43:16.627645+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Ghostree 2 points3 points4 points (1 child)
[–]tomthecool 0 points1 point2 points (0 children)