Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Programmer > Re: To wrap or ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 16 Topic 52595 of 55512
Post > Topic >>

Re: To wrap or not to wrap?

by Tom Anderson <twic@[EMAIL PROTECTED] > May 9, 2008 at 12:37 AM

On Thu, 8 May 2008, Aaron Fude wrote:

> In my personal development efforts, I frequently wrap basic java
> functionality. For example, I have a
>
> String MyIO.urlToString(String url)
>
> or
>
> byte[] MIO.urlToBytes(String url)
>
> etc. These functions catch exceptions and return null if something
> goes wrong. I have other functoins that, for example, load database
> queries into maps.
>
> My gereneral questions are these. Does everybody pretty much end up
> writing convenience wrappers like these for themselves?. If yes, why
> aren't utilities like these commonly available as more or less
> standard libraries? And if no - why not? Is it a bad idea to use these
> and is it for some reason better to, e.g.,  always form URL's, open
> connections, capture exceptions, etc.

What everyone else said. Exceptions are a good way to do error handling. 
Null returns are not. You're shooting yourself in the foot.

tom

-- 
For the first few years I ate lunch with he mathematicians. I soon found
that they were more interested in fun and games than in serious work,
so I ****fted to eating with the physics table. There I stayed for a
number of years until the Nobel Prize, promotions, and offers from
other companies, removed most of the interesting people. So I ****fted
to the corresponding chemistry table where I had a friend. At first I
asked what were the im****tant problems in chemistry, then what im****tant
problems they were working on, or problems that might lead to im****tant
results. One day I asked, "if what they were working on was not im****tant,
and was not likely to lead to im****tant things, they why were they working
on them?" After that I had to eat with the engineers! -- R. W. Hamming
 




 16 Posts in Topic:
To wrap or not to wrap?
Aaron Fude <aaronfude@  2008-05-08 15:19:42 
Re: To wrap or not to wrap?
ram@[EMAIL PROTECTED] (S  2008-05-08 22:54:08 
Re: To wrap or not to wrap?
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-08 19:13:32 
Re: To wrap or not to wrap?
Aaron Fude <aaronfude@  2008-05-08 16:33:14 
Re: To wrap or not to wrap?
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-08 19:36:50 
Re: To wrap or not to wrap?
ram@[EMAIL PROTECTED] (S  2008-05-08 23:44:34 
Re: To wrap or not to wrap?
"Chronic Philharmoni  2008-05-09 05:57:53 
Re: To wrap or not to wrap?
ram@[EMAIL PROTECTED] (S  2008-05-09 12:54:18 
Re: To wrap or not to wrap?
"Chronic Philharmoni  2008-05-10 18:33:24 
Re: To wrap or not to wrap?
"Daniel Dyer" &  2008-05-09 00:37:00 
Re: To wrap or not to wrap?
"Daniel Dyer" &  2008-05-09 00:42:54 
Re: To wrap or not to wrap?
Tom Anderson <twic@[EM  2008-05-09 00:37:43 
Re: To wrap or not to wrap?
Patricia Shanahan <pat  2008-05-08 20:46:58 
Re: To wrap or not to wrap?
Roedy Green <see_websi  2008-05-09 03:48:55 
Re: To wrap or not to wrap?
java_killer <ggl.book.  2008-05-09 00:48:08 
Re: To wrap or not to wrap?
Lew <lew@[EMAIL PROTEC  2008-05-09 09:17:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:16:13 CST 2008.