commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <sebastien.bris...@m4x.org>
Subject Re: svn commit: r1343163 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/linear/ test/java/org/apache/commons/math3/linear/
Date Mon, 28 May 2012 12:28:32 GMT
Hi Gilles,

2012/5/28 Gilles Sadowski <gilles@harfang.homelinux.org>:
> Hello.
>
>>
>> >
>> > Why do you call "valueOf"?
>> >
>> I have to say I do not like implicit conversions, that's why I tend to
>> always use Integer.valueOf and the likes.
>
> Why?
>
This is going to get "philosophical": I would not dare to claim that
I'm holding *the* truth, this is only my way of seeing things. I do
not like things to happen implicitely, because I think that it opens a
door to errors (this would not be true of professional programmers,
but remember that I work in an environment where people are not real
computer scientists... so my philosophy is "close as many doors as you
can"...). I even think that J. Bloch has a nice example of potential
issues with auto-boxing. However, I agree with you: calling valueOf in
this context (that is: building a new exception) is certainly
far-fetched.

That was the initial reason why I moved from C++ to Java ten years
ago: too many things happened "behind my back". Again, I'm not saying
that C++ is evil. I'm just saying that I did not have the background
with C++ to be fully aware of these implicit assumptions, and their
potential consequences.

I'm pretty sure I will not convince you on this. I hope I have at
least convinced you that I have a good reason to do it this way :-)

>> However, if you think that
>> it leads to less readable code, I'm OK with your way of seeing things.
>
> Good! ;-)
>
> Gilles
>
As I said, I will remove these explicit boxings (but be warned: I've
used valueOf() in the past, and do apologize for any unwanted
occurence...).

Best regards,
S├ębastien


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message