Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The Universal Standard Library.
PHP = strtoupper($str)
Ruby = "Hello".upcase
Since Ruby is a method on the string object and PHP takes the string as an argument. To make them the same you would need to do either
PHP = upcase($str)
In which case you lose context in PHP or
Ruby = "Hello".strtoupper
In which case you are repeating yourself in ruby.
There are no comments on this comment yet.
PHP = strtoupper($str)
Ruby = "Hello".upcase
Since Ruby is a method on the string object and PHP takes the string as an argument. To make them the same you would need to do either
PHP = upcase($str)
Ruby = "Hello".upcase
In which case you lose context in PHP or
PHP = strtoupper($str)
Ruby = "Hello".strtoupper
In which case you are repeating yourself in ruby.