OK, my wife just graduated from nursing school a couple of years ago... which means I've had blood drawn and IV's started at least two dozen times... and a majority of those were done very very poorly.
That's why I married a chef, and not a nurse. Of course, that hasn't done wonders for my waistline.;-)
To which I would like to add: do you think there is any reason to try to copy human nature?
To which I would respond: yes, there is a reason to at least try and copy human nature: attempting to replicate it (probably) requires understanding it, which in turn requires studying it in detail. That understanding could prove tremendously useful in bettering the lives of real humans.
Of course, there's plenty of reasons to not try, but here's at least one reason in favor of doing so.
Back in November 1998, we bought Netscape for 4.2 billion dollars... but now, we're offering it to you for just $9.95 a month! Operators are standing by.
I don't care whether it's NASA, libraries, Homeland Security, or the Chinese government, media sensorship is wrong; it hurts everyone's freedom when you sensor the web.
I'm no C++ expert, but IIRC C++ exceptions were a non-standard language enhancement available only to certain compilers. Please enlighten me if I'm wrong.:-)
Regardless, I think exceptions are a good thing, in Java, in C++, in C#, and even in VB.NET of all places. Accept no substitutes!
Trying to open an stream to a file that doesn't exist is exceptional, because the app should have checked this before attempting to open the stream.
Allow me to disagree with this (and explain why). I believe that this line of thinking is just a throwback to the C/C++ days, when there wasn't any other way to do it.
So, you want to open up a stream... that's something along the lines of:
File foo = new File( "foo" ); FileReader reader = new FileReader( foo );
Now, what you're suggesting would go something like this:
File foo = new File( "foo" ); if ( foo.exists() ){ FileReader reader = new FileReader( foo ); } else { System.out.println( "File is missing dammit" ); }
However, the FileReader constructor must declares that it throws a FileNotFoundException.. there's no way to force the programmer to check if the file exists beforehand. So you have to wrap in try/catch (or declare the exception in the calling method of course):
try { File foo = new File( "foo" ); if ( foo.exists() ){ FileReader reader = new FileReader( foo ); } else { System.out.println( "File is missing dammit" ); } } catch ( FileNotFoundException e ){ // This now is (probably) impossible-to-reach code. // What should we do here if this happens anyway? // Probably the same thing we did before. System.out.println( "File is missing dammit" ); }
So now you have a redundant check to see if the file exists (remember, whatever check happens in FileReader's constructor still happens). In addition, the check in File.exists() doesn't necessarily duplicate the check in FileReader(). If FileReader() does some additional (and desireable) checking that File.exists() doesn't, then the call to exists() is truly superfluous and maybe even dangerous (especially if you're dealing with multiple threads).
Instead, I like to do this:
try { File foo = new File( "foo" ); FileReader reader = new FileReader( foo ); } catch ( FileNotFoundException e ) { System.out.println( "File is missing dammit" ); }
This way, there's only one check. Not only do you get the performance gain (which may or may not be trivial), but you also don't have to re-do your error handling code.
I believe that, with the proper care (which isn't that difficult to have with the right training), exceptions can be used to control program flow and increase code readability. Of course, this can be abused too, just like anything else.
The name implies that an exception is something that shouldn't have happened (you ran out of memory, a parameter was bad, something just totally blew up).
Well, you can (and I will) make the arguement that Java has a slightly finer-grained approach to what you just described. In addition to the class Exception, there's also the class Error, and both implement the same interface Throwable.
IMO, the names are appropriate. An Exception means that a method encountered a condition that it can't express in terms of its return value (thank god we don't have to deal with all those result-structs of C/C++). We generally associate this with "bad", but really it doesn't have to mean anything other than "out of the ordinary". An Error takes one step closer to "bad" with it's harsh-sounding name.
Note that, in your examples, the running out of memory condition causes an OutOfMemoryError, not an Exception.
The issue becomes recoverability; an application could probably recover nicely from a FileNotFoundException (perhaps by creating a new file and continuing on merrily?). However, most apps (more specifically, their programmers) wouldn't have any idea what to do if they ran out of memory; hence, you generally don't catch Error, even though it's possible to do so.
I agree that exceptions are a fundamental part of Java and other languages, and they should definitely be covered by any good Java book, but any book that covers exceptions should take the time to teach the user how not to use them as well as how to use them.
I agree with your agreement.:-P Too many tutorials gloss over them. They are very powerful and make a programmer so much more productive, but yet aren't really all that complicated. I'm usually "disappointed" (to borrow a recent cliche) to see how often they're considered a specialty feature.
The topics range from the common (objects, polymorphism) to the rare (RMI, sockets, exceptions).
[rant]
Exceptions are one of the more fundamental (and useful) features of the Java language. Whether or not they are "in your face" (as far as source code is concerned), they exist and have the potential to greatly change the flow of your program. Considering them "rare" is a tremendous disservice to those learning how to use Java in a productive manner. I hope that this is simply the reviewer's choice of language, and not a flaw in the book iteslf.
[/rant]
No idea what saltwater would do, but in Western Canada (where I'm originally from) we could see these things all the time (both around the sun and the moon) when the weather got cold enough. They're commonly called "sundogs"; the technical term is "parhelia".
Insert joke about protein-packed keyboards here...
Ozone a great pesticide, but be careful
on
Ozone As Pesticide
·
· Score: 4, Interesting
I recently bought a house with a pool. While reading up on pool maintenance at this excellent site I came across this interesting page on using ozone instead of chlorine as a pool cleaner. Apparently it works very well at killing bacteria and other contaminents, but it is very expensive and very unstable. Most states don't even allow you to use it as a primary sanitizer for your pool.
Ozone might be effective and more environmentally friendly, but it might be too expensive or dangerous for widespread use. Of course, farm work has never been especially cheap or safe... this is just one aspect out of many.
The Daily Telegraph has learned the helicopter will include a camera mounted in the pilot's seat, giving the moviegoer a bird's-eye-view as the aircraft whizzes across the city.
Personally, I'd prefer that a pilot would be mounted in the pilot's seat, considering how difficult the stunt is and all...
I was looking at the Fujitsu P-series a while back... it looks like a very cool device. However, I was concerned about DVD movie playback on the Curusoe processor.
In your experience, does it have the power to properly decode the MPEG2 from a DVD movie entirely through software? And would doing that kill the battery?
My goal is to find a small/lightweight (and preferably cheap) notebook that I can use to watch movies on flights in addition to checking emails/writing docs, etc.
Craig
Hehehe... that page lists "Softporn Adventure" as one of the games they developed in 1981. Since the highlight for that year is "Leisure Suit Larry is born (without a name)", it seems likely that that's what "Softporn Adventure" turned in to. Too bad they didn't keep the original title... could you imagine seeing that box at your neighborhood software store?
That's only 2 weeks away... of course, they could mean the end of 2002, but the article does specifically say "by the end of this year," so it would have to be a mistake on the part of the reporter.
I find it peculiar that 40 out of 50 cities are already profitable but 10 cities won't be for a year and a half (mid-2003).
That's why I married a chef, and not a nurse. Of course, that hasn't done wonders for my waistline. ;-)
To which I would respond: yes, there is a reason to at least try and copy human nature: attempting to replicate it (probably) requires understanding it, which in turn requires studying it in detail. That understanding could prove tremendously useful in bettering the lives of real humans.
Of course, there's plenty of reasons to not try, but here's at least one reason in favor of doing so.
I've seen it available on Citibank's credit card member site... it's not required though. I just created my own login and used that instead.
Post the URL here, and then Slashdot the buggers into oblivion! Make their bandwidth bill so high that they'll beg you to take it back!
Back in November 1998, we bought Netscape for 4.2 billion dollars... but now, we're offering it to you for just $9.95 a month! Operators are standing by.
Wow, then I've been doing the equivalent of throwing out my entire record collection every night for years...
Bad spellers of the world untie!
Regardless, I think exceptions are a good thing, in Java, in C++, in C#, and even in VB.NET of all places. Accept no substitutes!
Allow me to disagree with this (and explain why). I believe that this line of thinking is just a throwback to the C/C++ days, when there wasn't any other way to do it.
So, you want to open up a stream... that's something along the lines of:
Now, what you're suggesting would go something like this:However, the FileReader constructor must declares that it throws a FileNotFoundException.. there's no way to force the programmer to check if the file exists beforehand. So you have to wrap in try/catch (or declare the exception in the calling method of course):So now you have a redundant check to see if the file exists (remember, whatever check happens in FileReader's constructor still happens). In addition, the check in File.exists() doesn't necessarily duplicate the check in FileReader(). If FileReader() does some additional (and desireable) checking that File.exists() doesn't, then the call to exists() is truly superfluous and maybe even dangerous (especially if you're dealing with multiple threads).Instead, I like to do this:
This way, there's only one check. Not only do you get the performance gain (which may or may not be trivial), but you also don't have to re-do your error handling code.I believe that, with the proper care (which isn't that difficult to have with the right training), exceptions can be used to control program flow and increase code readability. Of course, this can be abused too, just like anything else.
Well, you can (and I will) make the arguement that Java has a slightly finer-grained approach to what you just described. In addition to the class Exception, there's also the class Error, and both implement the same interface Throwable.
IMO, the names are appropriate. An Exception means that a method encountered a condition that it can't express in terms of its return value (thank god we don't have to deal with all those result-structs of C/C++). We generally associate this with "bad", but really it doesn't have to mean anything other than "out of the ordinary". An Error takes one step closer to "bad" with it's harsh-sounding name.
Note that, in your examples, the running out of memory condition causes an OutOfMemoryError, not an Exception.
The issue becomes recoverability; an application could probably recover nicely from a FileNotFoundException (perhaps by creating a new file and continuing on merrily?). However, most apps (more specifically, their programmers) wouldn't have any idea what to do if they ran out of memory; hence, you generally don't catch Error, even though it's possible to do so.
I agree that exceptions are a fundamental part of Java and other languages, and they should definitely be covered by any good Java book, but any book that covers exceptions should take the time to teach the user how not to use them as well as how to use them.
I agree with your agreement. :-P Too many tutorials gloss over them. They are very powerful and make a programmer so much more productive, but yet aren't really all that complicated. I'm usually "disappointed" (to borrow a recent cliche) to see how often they're considered a specialty feature.
FYI, here's some javadoc links:
java.lang.Exception
java.lang.Error
The topics range from the common (objects, polymorphism) to the rare (RMI, sockets, exceptions).
[rant]
Exceptions are one of the more fundamental (and useful) features of the Java language. Whether or not they are "in your face" (as far as source code is concerned), they exist and have the potential to greatly change the flow of your program. Considering them "rare" is a tremendous disservice to those learning how to use Java in a productive manner. I hope that this is simply the reviewer's choice of language, and not a flaw in the book iteslf.
[/rant]
Banana-fanna-fo-FUI
Me My Mo-MUI
GUI!
*sigh*
When you start at zero, anything more than that is "increasingly" :-P
Some links:
http://imagine.gsfc.nasa.gov/docs/ask_astro/answer s/970207e.html
http://www.geocities.com/~kcdreher/sundogs.html
They may be pretty, but they'd be easier to appreciate if they didn't signify that it's freakin' cold outside :-/
Insert joke about protein-packed keyboards here...
Ozone might be effective and more environmentally friendly, but it might be too expensive or dangerous for widespread use. Of course, farm work has never been especially cheap or safe... this is just one aspect out of many.
mod the parent up Dannon shows poetic skill too bad I cannot
Damn, you "beat" me to it :-P
Personally, I'd prefer that a pilot would be mounted in the pilot's seat, considering how difficult the stunt is and all...
I was looking at the Fujitsu P-series a while back... it looks like a very cool device. However, I was concerned about DVD movie playback on the Curusoe processor. In your experience, does it have the power to properly decode the MPEG2 from a DVD movie entirely through software? And would doing that kill the battery? My goal is to find a small/lightweight (and preferably cheap) notebook that I can use to watch movies on flights in addition to checking emails/writing docs, etc. Craig
Hehehe... that page lists "Softporn Adventure" as one of the games they developed in 1981. Since the highlight for that year is "Leisure Suit Larry is born (without a name)", it seems likely that that's what "Softporn Adventure" turned in to. Too bad they didn't keep the original title... could you imagine seeing that box at your neighborhood software store?
...or they can be handed over to you voluentarily, if you say you're doing research on passwords. :-P
I wonder if any non-LOTR fans got freaked out over this.
I find it peculiar that 40 out of 50 cities are already profitable but 10 cities won't be for a year and a half (mid-2003).
Dammit, my reply to your message wasn't. Sorry. Check it out here: http://slashdot.org/comments.pl?sid=24151&cid=2614 769