This has perhaps been aired here already, if so, apologies.
Someone did not like Ruby; I find it refreshing to read these takes as well since the actually bring up some (fairly) valid points, this one moreso than usual.
ES wrote: > This has perhaps been aired here already, if so, apologies.
> Someone did not like Ruby; I find it refreshing to read > these takes as well since the actually bring up some > (fairly) valid points, this one moreso than usual.
First, an OT question: Is there a Firefox extension that lets me *quickly* disable/enable page colors? I know I can do this via the Web dev tool bar stuff, but it's too many clicks, and sites with white text on a dark background (hip as that may be) are so painful to look at I get retina burn before I can finish all that clicking.
About the log entry. I have a rule of thumb. If someone is using the words "shit" or "fuck" three or four times on page, they quickly lose all credibility. (Certain words should be treated like global variables: saved for special cases and for specific effect.)
I like reading critiques (or criticism, even) of Ruby, but most of what was mentioned there were straw man arguments. Certainly POLS is a known subjective aspect and an easy target. I expect everyone reading ruby-talk could assemble a list of cases where Ruby violates their own sense of POLS.
> First, an OT question: Is there a Firefox extension that lets me > *quickly* disable/enable page colors? I know I can do this via the Web > dev tool bar stuff, but it's too many clicks, and sites with white text > on a dark background (hip as that may be) are so painful to look at I > get retina burn before I can finish all that clicking.
I use a bookmarklet in my bookmarks toolbar for this.
> Someone did not like Ruby; I find it refreshing to read > these takes as well since the actually bring up some > (fairly) valid points, this one moreso than usual.
Some valid points ? I think this guy does not know what he's talking about, or simply did not read the documentation correctly, or is simply blinded by something he should unlearn first, or simply likes making straw man arguments for the sake of it, or simply likes to rant (that I can understand, I like it too :) ).
And calling the language creator(s) "fucktard(s)" really doesn't help making a point, really.
> > Someone did not like Ruby; I find it refreshing to read > > these takes as well since the actually bring up some > > (fairly) valid points, this one moreso than usual.
> Some valid points ? I think this guy does not know what he's talking > about, or simply did not read the documentation correctly, or is > simply blinded by something he should unlearn first, or simply likes > making straw man arguments for the sake of it, or simply likes to > rant (that I can understand, I like it too :) ).
> And calling the language creator(s) "fucktard(s)" really doesn't help > making a point, really.
> I use a bookmarklet in my bookmarks toolbar for this.
for *just a second* I've been thinking you used a toolbar to collect places where ruby-talk shows that POLS relates to Matz' least surprise. How lovely.
> This has perhaps been aired here already, if so, apologies.
> Someone did not like Ruby; I find it refreshing to read > these takes as well since the actually bring up some > (fairly) valid points, this one moreso than usual.
Despite the fucking swearing, he did come up with a list of almost everything that has confused or annoyed me since I started using ruby.
What he neglected to mention is that Ruby is without doubt the closest attempt yet at a perfect scripting language. Sure, it has some wrinkles, but I have high hopes of those being sorted in the next iteration, whether by Matz or by somebody else standing on his (and other giants) shoulders.
Despite the colourful language, an insightful critique and worth a quick browse.
Andrew Walrond
PS The lack of documentation regarding method thrown exceptions is perhaps my favourite criticism. Not at all core, but frustrating as hell when writing OO /exception driven programs.
>> Someone did not like Ruby; I find it refreshing to read >> these takes as well since the actually bring up some >> (fairly) valid points, this one moreso than usual.
> Some valid points ? I think this guy does not know what he's talking > about, or simply did not read the documentation correctly, or is simply > blinded by something he should unlearn first, or simply likes making > straw man arguments for the sake of it, or simply likes to rant (that I > can understand, I like it too :) ).
I think this is a bad written rant, but I agree that I'd like implicit namespace creation a-la python and that it's refreshing to see some ruby critiques.
> This has perhaps been aired here already, if so, apologies.
> Someone did not like Ruby; I find it refreshing to read > these takes as well since the actually bring up some > (fairly) valid points, this one moreso than usual.
> "It's 5.abs for absolute value, but Math.sqrt(5) for square root."
> Good point. That bugs me too. abs is a *function*, not logically a > method.
Why not 5.sqrt instead. Better to ask the object to do something, that to do something with the object. That allows to use duck typing and special casing to be done in the "special cased" object. I prefer "string".length a lot over length(string)
> > "It's 5.abs for absolute value, but Math.sqrt(5) for square root."
> > Good point. That bugs me too. abs is a *function*, not logically a > > method.
> Why not 5.sqrt instead. Better to ask the object to do something, that > to do something with the object.
I would also agree. This did make me ponder when I initially found it. If they have to be in a module, wouldn't it make sense to have it be default includeable?
> "It's 5.abs for absolute value, but Math.sqrt(5) for square root."
> Good point. That bugs me too. abs is a *function*, not logically a > method.
My take is that there are a few methods that apply to floats and ints and bignums. These (like floor, ceil, abs) are commonly known, accepted and used functions and it makes sense to make them methods.
However, my f(x) is likely to be different than your f(x). In fact, there are an infinite number f(x)'s in the world and an infinite number of function names. If Ruby included them into numeric, then I would feel like I was in Java swing. :)
Also, since 9/4 = 2, I'm not so sure that 5.sqrt wouldn't be 2 or 0, depending upon how you slice it.
> A few other good points, too. Shame about the presentation.
Nothing that hasn't been said before, but in a much more acceptable way that promotes good discussion and real action.
Nothing new here people... move along, move along.
-- Jim Freeze Ruby: I can explain it to ya but I can't understand it fer ya.
In message "Re: A different perspective on Ruby." on Thu, 26 May 2005 21:35:19 +0900, "gsincl...@gmail.com" <gsincl...@gmail.com> writes:
|"It's 5.abs for absolute value, but Math.sqrt(5) for square root." | |Good point. That bugs me too. abs is a *function*, not logically a |method.
The definition of abs is not questionable; it returns self, negated when self is negative, for all numeric value. On the other hand, natural sqrt() may return float or integer, or something else. That's the reason for sqrt() being a function in Math module. Note that the name "Math" means math.h (collection of float value functions) in Unix, not mathematics in general.
Besides that, he doesn't understand what POLS means. Since someone will surprise for any arbitrary choice, it is impossible to satisfy "least surprise" in his sense. The truth is two folds: a) when there are two or more choices in the language design decision, I take the one that makes _me_ surprise least. b) as a result, you will have less surprise in Ruby than other languages, once you have accustomed to it.
But I'm tired of explaining POLS again and again. I haven't even used it first. I hope no one will use the term "POLS" any more to sell Ruby. It's free after all.
In article <1117115503.104127.21363.nullmai...@x31.priv.netlab.jp>, m...@ruby-lang.org says...
> Besides that, he doesn't understand what POLS means. Since someone > will surprise for any arbitrary choice, it is impossible to satisfy > "least surprise" in his sense. The truth is two folds: a) when there > are two or more choices in the language design decision, I take the > one that makes _me_ surprise least. b) as a result, you will have > less surprise in Ruby than other languages, once you have accustomed > to it.
Nicely put. I suggest we start referring to the POMLS - Principle of Matz's Least Surprise. That way, if anyone ever debates it, you can pop in and say "I wasn't surprised at all," thus authoritatively refuting the argument!
-- Jay Levitt | Wellesley, MA | I feel calm. I feel ready. I can only Faster: jay at jay dot fm | conclude that's because I don't have a http://www.jay.fm | full grasp of the situation. - Mark Adler
>ES wrote: >> This has perhaps been aired here already, if so, apologies.
>> Someone did not like Ruby; I find it refreshing to read >> these takes as well since the actually bring up some >> (fairly) valid points, this one moreso than usual.
>First, an OT question: Is there a Firefox extension that lets me >*quickly* disable/enable page colors? I know I can do this via the Web >dev tool bar stuff, but it's too many clicks, and sites with white text >on a dark background (hip as that may be) are so painful to look at I >get retina burn before I can finish all that clicking.
>About the log entry. I have a rule of thumb. If someone is using the >words "shit" or "fuck" three or four times on page, they quickly lose >all credibility. (Certain words should be treated like global >variables: saved for special cases and for specific effect.)
Ah, yes. I forgot to append a disclaimer about the language.
>I like reading critiques (or criticism, even) of Ruby, but most of what >was mentioned there were straw man arguments. Certainly POLS is a known >subjective aspect and an easy target. I expect everyone reading >ruby-talk could assemble a list of cases where Ruby violates their own >sense of POLS.
Sometimes it is good to know what the other people think is surprising; not because it violates some imaginary principle but because it might actually be a good idea to re-evaluate a given aspect to make it more obvious.
* Jay Levitt <jay+n...@jay.fm> [2005-05-26 23:35:18 +0900]:
> > Besides that, he doesn't understand what POLS means. Since someone
> Nicely put. I suggest we start referring to the POMLS - Principle of > Matz's Least Surprise. That way, if anyone ever debates it, you can pop > in and say "I wasn't surprised at all," thus authoritatively refuting > the argument!
I think if you read Matz' post carefully, you will see that he is not the originator of POLS. So, I don't think he wants any POLS attached to himself, even POMLS. This would be a repeat of what happed with POLS.
Besides, if we drop the POLS thing, then we can spare the poor misguided, uninformed (slack jawed, lazy eyed) individuals who write long articles trying to sound intelligent and authoritate on a subject that they know nothing about from making fools of themselves.
-- Jim Freeze Ruby: I can explain it to ya but I can't understand it fer ya. It is best to keep your mouth shut and let others think you an idiot than to open it and remove all doubt.
>>"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
>>Good point. That bugs me too. abs is a *function*, not logically a >>method.
> Why not 5.sqrt instead.
Hmmm, prefix, postfix, or infix? Functional or object-oriented? These are bottomless questions.
One justification for sqrt(5) would be that "sqrt", works on more than one class of objects (Fixnum, Bignum, Rational, etc). So does "abs" for that matter, and I'm not crazy about 5.abs. As a method, sqrt would have to be defined in every applicable class, either with new code or as an included module. This spreads the definition out, which complicates maintainence.
Another reason is that the prefix style, sqrt(5), is somewhat closer to the typical mathematical notation. I can't think of any unary mathematical operations that are naturally postfix, unless you count C++'s post-decrement and post-increment.
This is all just criticism of library design, which is very much a matter of style and taste. The "standard" library could stand some attention to smooth out these style bumps, possibly by allowing either prefix or postfix styles whenever possible. Then questions of style would be forwarded to the programmer.
> >>"It's 5.abs for absolute value, but Math.sqrt(5) for square root."
> >>Good point. That bugs me too. abs is a *function*, not logically a > >>method.
> > Why not 5.sqrt instead.
> Hmmm, prefix, postfix, or infix? Functional or object-oriented? > These are bottomless questions.
> One justification for sqrt(5) would be that "sqrt", works on more than > one class of objects (Fixnum, Bignum, Rational, etc). So does "abs" for > that matter, and I'm not crazy about 5.abs. As a method, sqrt would > have to be defined in every applicable class, either with new code or as > an included module. This spreads the definition out, which complicates > maintainence.
> Another reason is that the prefix style, sqrt(5), is somewhat closer to > the typical mathematical notation. I can't think of any unary > mathematical operations that are naturally postfix, unless you count > C++'s post-decrement and post-increment.
> This is all just criticism of library design, which is very much a > matter of style and taste. The "standard" library could stand some > attention to smooth out these style bumps, possibly by allowing either > prefix or postfix styles whenever possible. Then questions of style > would be forwarded to the programmer.
I think the guy's point was "omg, they said everything was an object! "hi".length == 2 and stuff! But not sqrt(5)! Like, omg you farking farktards are farking dumb! So much for POLS!!!1"
> I think the guy's point was "omg, they said everything was an > object! "hi".length == 2 and stuff! But not sqrt(5)! Like, > omg you farking farktards are farking dumb! So much for > POLS!!!1"
|"It's 5.abs for absolute value, but Math.sqrt(5) for square root." | |Good point. That bugs me too. abs is a *function*, not logically a |method.
> The definition of abs is not questionable; it returns self, negated > when self is negative, for all numeric value. On the other hand, > natural sqrt() may return float or integer, or something else. That's > the reason for sqrt() being a function in Math module.
I may be missing something, but why does it matter what the return type is?
What is wrong with always returning a float just like Math.sqrt does?
-alternatively, although I prefer the first option-
Why couldn't the implementation of sqrt "cast" the result to an instance of the current self's type? So, if you ask an integer to sqrt, you get an integer back?
Like I said, maybe I am missing something, but it seems that sqrt is a verb applied to numbers.
>|"It's 5.abs for absolute value, but Math.sqrt(5) for square root." >| >|Good point. That bugs me too. abs is a *function*, not logically a >|method.
>> The definition of abs is not questionable; it returns self, negated >> when self is negative, for all numeric value. On the other hand, >> natural sqrt() may return float or integer, or something else. That's >> the reason for sqrt() being a function in Math module.
>I may be missing something, but why does it matter what the return >type is?
>What is wrong with always returning a float just like Math.sqrt does?
>-alternatively, although I prefer the first option-
>Why couldn't the implementation of sqrt "cast" the result to an >instance >of the current self's type? So, if you ask an integer to sqrt, you get >an >integer back?
>Like I said, maybe I am missing something, but it seems that >sqrt is a verb applied to numbers.
Well, essentially this is all that is required:
irb(main):018:0> class Fixnum irb(main):019:1> def method_missing(sym, *args, &block) irb(main):020:2> return Math.send sym, self, *args, &block irb(main):021:2> end irb(main):022:1> end => nil irb(main):023:0> 100.sqrt => 10.0 irb(main):024:0>
It is obviously not very robust but it took about eight seconds to implement.