T
Thomas 'PointedEars' Lahn
Peter said:It fails to pass my judgment as an appropriate language/library design
for how to raise one number to the power of another number. This is a
subjective discussion.
It is rather pointless rambling on your part.
No. I don't want to send a message to the object 2. I don't want to
send messages to anything. I just want the value of the power and I
want to do that by a function call.
Then you should use a programming language that is either procedural or
functional, but not also object-oriented. Sending messages to objects is a
core principle of the object-oriented paradigm.
In fact, it is rather debatable whether there should be such a thing like
primitive values as opposed to object values in an object-oriented
programming language. FWIW, Brendan Eich agrees with that in his blog.
Non sequitur. Messages do not need to cause mutation.
No they don't but that is what the paradigm was primarily designed to
do [...]
Nonsense.
So what?
If something can be just a simple function then let it be just a
simple function.
Following this reasoning you would need to object to Math.pow(...), too.
But they were wrong.
According to whom, and because of what?
Aesthetically yes but more substantially because it is a simple
function call rather than a message passing system.
Sounds pretty much like circular reasoning.
Efficiency considerations
aside, that is is a matter of preference. And given that in math we are
writing
10
2
to display the value of "two to the tenth power", is it not more similar
and therefore more intuititive to write (2).pow(10) in source code?
I wouldn't rest my argument on the idea that Mathematical notation is
good. Mathematical notation is unnecessarily complex and unclear. [...]
Sorry, you have not the shadow of a clue what you are talking about.
-1
(sin(x))
-1
sin (x)
I rest my case.
I'm not saying the namespacing is required. I'm saying that having to
write eight characters for the name of the function instead of three
characters isn't something to get fussed about.
If your reasoning was consistent, you would *need* to get fussed about to
begin with.
But, you do not really have a point; you are just rambling here.
Anyhow, please trim your quotations to the relevant minimum next time.
PointedEars