I just tried it with Firefox 1.0, popupblocking, and tabextensions set to single window mode. I do NOT get the Secunia window when I click on the Consumer Alert image, I get the regular Citibank information, in a new tab.
Call bullshit on this, too. IE will happily save SSL served pages, even with the "save SSL files to disk" option turned off. Explicitly saving is a totally different animal, from both a usability and a security standpoint, than cache saving anyway.
Too bad. That's not your job. It's MY computer, not yours, and my window manager will stick windows wherever I want it to. There's no need for you to "reliably" position the windows anywhere, unless you're a control freak, in which case you need to stop that.
This is very normal in courts. There's some reasons for it, although I don't know or recall all the technical terms and details. It has something to do with not being able to bring up new defenses upon appeal, or even after certain points in some cases. So you always present all the possible arguments you can, independently.
This can get taken to extremes, like the same party arguing opposing views in 2 different courts.
These "stringent requirements" aren't worth shit. The results of the testing are not public. The standards for the tests are not public. The leaked Diebold source code, which was audited by people without a grudge to bear (ie, before all this Diebold crap started making the news), and was shown to be chock full of the most ridiculous security flaws, was code that had run on machines used in elections and theoretically passed these reviews. A review isn't worth a damn if the people doing it have ultierior motives, or are just incompotent.
And if you don't think that adminitrative pressure to roll these machines out wasn't responsible for a lot of the problems we see with them then you're deluding yourself.
Diebold is spinning like a top to counter this kind of publicity. It's possible that this represents a legitimate change of heart there, but I really doubt it. I'll take thier past actions and thier documented behaviors under a lot more consideration than last minute claims made in the middle of a hail of bad publicity.
It's that you can't take an application, developed under the GPL using the Open Source version, and then close the source once you've bought the commercial version.
That said, I still think Qt is unsuitable/useless for cross-platform OSS development because anyone wanting to compile for windows (including every one of your windows developlers) must have a pricey commercial Qt license. One person who packages binaries every now and then is one thing, but an involved Windows user and developer community is another.
I think what he's saying is caching some of that information across program invocations, so that the next time you invoke "wc -l" the JVM looks at its JIT cache and pulls up (depending on whats available or practical) the profiling information it has from the last run or the actual compiled code.
This seems obvious and I wonder why it's not widespread. Maybe it is and I just don't know it? Maybe the work of figureing out whether or not your cache is stale outweighs the benefits? Taken to it's logical conclusion, this ends up turning into AOT compilation, of course, so there's some point where the disadvantages outweigh the advantages...
We've got this for normal compilers already in the form of profile based compilation. JIT does it per instance. I don't know for sure that any current JIT has a way of saving that sort of information/state across invocations but seems like a really obvious extension.
6/10 only looks bad to you because you're used to gamer mags that would give "Triple Insane Paintball Command Quake Engine XXX Extreme" a 7.5. 6/10 is an "eh, it's okay for a while" score, which sounds like exactly what it deserves (and matches my rating after the demo).
Bull. It costs practically nothing to set up a MUD, while still attract people. If he can validate his theories with a text based game, maybe he can get some funding for a MMORPG. I don't think he can, because there's been MUDs with PD and they were never very successful - they attracted a certain core of people who eventually ended up controlling the mud and nobody else. I've seen it happen a dozen times. The game mechanics of modern MMORPGs aren't really that different than MUDs so I think most of the playabilty concerns are the same. If Bartle thinks I'm wrong, then he can pokey up say 5 grand, write his New and Better mud, spend a little of that money on advertising and see how much of a player base he can draw.
You might be able to create some sort of game with Bartles ideas. But it won't be a very good MMORPG. It might be a half-decent fantasy gamelet. I might give it an hour or so to check it out. But I think Bartle has fallen into the same trap that a lot of game designers (thankfully, not very many succesfull ones) do, and has decided that what he wants and what he thinks is more elegant is what people should do, and players should be forced to conform. His whole article points at it - remove teleportation and instancing as a way of forcing people to interact with strangers. You can't get away with this kind of crap and expect to have a successful game, and it's not because the "newbies" have too much "power". It's because people don't like being told how to play your game and if you try to force the issue they're going to leave. Now, you can take the indie route and claim that your game isn't supposed to appeal to "the masses" and the games that do "are dumbed down" all you want, but the bare facts are that people don't think your game is any fun, and they gravitate to the ones that are. If your game is New and Different, but also Fun, then you'll get attention. It might be slow going becase there's some merit to the reasons he provides, but it's an obstacle, not a barrier. Bartles problem is that he doesn't approve of what people find fun, and that's his problem as a game designer, not our problem as players.
In the late 90s there was a rash of US Postal workers snapping under stress and shooting everyone at the office. A couple people who didn't work at at the PO used it as an outlet for shooting people too. Kinda like school shootings.
Note that nobody blamed video games for that, and media shied away from blaming themselves, even though it's reasonable. At least as reasonable as blaming video games.
Games don't make you do anything. But if you're going to snap and kill people, then it might influence the way you do it. If you're borderline crazy already, and you play a lot of GTA, then when you go over the edge you might act that out. Same with the postal thing - if you're crazy already, then hearing 24/7 coverage of someone shooting a post office will likely influence you when you snap.
Wasn't going to reply as this is an old thread, but what the hell.
1) Java's finalization is non-deterministic, which makes it totally non-suitable for resource cleanup. There's no way to tell when a resource will be released and in fact there is no guarantee that it will EVER be released aside from program termination. This is what is called a "resource leak".
2) Because the designers of Java know this, they have try/finally instead, so you can explicitly clean everything. This is a problem because there's more changes for programmer error (admittedly a fairly minor case), but more importantly because you end up with enormously deep layers of complex nested try/finally and state managment code. C++ style exceptions would be cleaner and also perform better (stack unwinding and objects removes the need for explicit managing of state, fewer try blocks means less stack overhead).
Java is better because it's successfull? Sure, by some metrics. Java is popular because it's adequate. It's a lot like VB - it's not "good". But it's good enough, the bar to entry is shorter and you can throw a lot more hardware at the problem. I've seen a ton of mission critical applications written in Access. Not in VB using Access, mind, but actually in the Access form/scripting front end. Does that mean Access was the best choice for that application? Of course not. In my professional experience, roughly zero design decisions are based on objective merit. C++ isn't perfect. You do need better developers. You do need a longer developlment cylce. There is less handholding and mistakes can cost you more - you'll crash rather than simply performing badly. Companies like this cause they can skimp on QA and throw hardware at problems instead, and that's a viable alternative. But it offends the asthetic in me, which is why I like C++.
As a long term mudder and gamer, I too think Bartle is full of crap. I've read his stuff before and I think he gets far too carried away with his "virtual worlds" and his elitism about what the "correct" way to have fun is. Like a lot of critics in a lot of fields he likes to point at anything lots of people like and call it bad.
If Bartle actually had this theoretical New and Better Game, and it was actually New and Better, then maybe he'd have a point. Permadeath is a lousy concept because it detracts from the fun. If permadeath doesn't detract from the fun, then it's because you aren't attached to your character and what the hell is the point then? The persistence of who you are is important in MMORPGs. Forcing a rotation of the high level players because you can't think of anything better for them to do is the lamest designer copout there is. You better hope your new and better game is going to attract the newbies, becuse it's damn sure you aren't going to have that many old timers sticking around.
There's been plenty of MUDs with permadeath. A few of them are even still around. None of them are large or vibrant. There's a reason for this and it's not because they're wonderful games that plebians won't play. It's because permadeath sucks.
Instancing is another area he has his head up his ass. It's a working solution to a problem all high population games have. It's also an easy way to provide semi-random content. Is it perfect? No, the perfect solution would be to have more content than your players can consume. But since that's a practical impossibility, we'll settle for instancing so that consuming the content that is available doesn't suck. If he's got some magic method for being about to create content that fast, then maybe thats what he should be sharing. I think his current method of "alienate everyone but a couple dozen players" isn't really a road to success.
I'm a professional software developer and I can't think of any reason to include the system described. Maybe in a testing environment, but in a critical system like this I'd forgoe simpler testing in favor of more complete, and insist that testing be done on "release" versions of the software, and that none of the sort of debugging hacks developers like to add be permitted.
Naturally Diebold disputes it - I don't see that as noteworthy. I'm not very impressed with the auditing they undergo either, as the software which was leaked was software which had been deployed on voting machines, had passed audits, and was FULL of problems. So all things considered I'm going to dismiss that. There's a lot of problems with Diebold machines, and while I don't think that outright election fraud is one of them (at least not organized - maybe there's a rouge developer or three, but I emphsize that I have no proof of that) I think that they are real problems none the less. The "workarounds" for procedural issues (like printing "System Tests passed") should be familiar to anyone who's worked in government or even a lot of corporate software development. It's slapping stuff together to make it work and keep your users from looking too closely at it. I think that for something this important that sort of behavior shouldn't be tolerated.
Finally, I think that the Kerry campaign, even if they suspected election fraud, wouldn't do jack without hard-edged, totally irrefutable proof. It'd be a political nightmare and they're going to swallow it and try again in 4 years. The Democrats took an enormous hit over Gore pursuing the Florida thing, and that was with evidence of widespread abuse and inconsistencies in the voting record (including from Diebold machines). Did those abuses and incosistencies change the 2000 election? Maybe. Probably not, but they did exist.
Relying on someone else to validate a distrust of the system is pretty much always a bad idea. It's even worse when the person you're replying on is part of the system. It'd be like saying that CNN couldn't have edited it's poll results, because FOX would have reported on it. I kinda wish Kerry did push it, because there's a lot of problems with our election system (all that crap in Florida last time didn't only happen there, that's just what got the press cause it was the swing state), but on the other hand it'd be political suicide for him in 2008, it'd cause a lot of animosity, and even if they weren't actually partisan (fat chance) anything they brought up would be dismissed as partisan.
I saw a riced out 78 oldsmobile the other day. I'm not sure if it was lame enought to be cool or not.
Yes, I mean riced out, not upgraded or modified - titanium bored-out gas pedal, racing seat, ripped up padding on the roof falling down, bolted on wing (that looked like it'd been made by someone in a high school shop class....), chrome rims(1 missing), wings, nitrous and R-Type stickers(!)
Nobody asked if it was okay. They asked why. It'd be a nice world if everyone was treated fairly and evenly but I think it's pretty safe to say to the sort of person who writes and uses exploits, yes, hotmail users are less precious than gmail users.
It's not a power trip per se (I suppose it is in some cases), but a disdain for (for example) hotmail and microsoft and the users thereof. You find much the same sort of attitude toward AOL. In the case of Hotmail/Microsoft it's increased by Microsofts (percieved?) disdain and disregard for them and what they consider important.
Yes, I think reasonable vender notification is a responsible thing to do. But I understand why people aren't willing to extend it to Microsoft. And while I don't agree with it, the argument of "user a better service" or "use a better operating system" certainly does have merit.
Is it really that hard to understand that people like Google and will cooperate with them, and they don't like Microsoft and therefore won't expend any effort to be nice? This is basic Golden Rule stuff.
Exceptions are actually faster than if/goto in the non-error case, because they avoid conditional checks. They are slower than standard return checking in the error case, which is a reason they shouldn't be used for expected conditions like EOF when reading.
Exceptions offer little to no benefit in cases where the error checking is simplistic (including all the cases used as samples in these threads). It's where the error checking is complicated and involves duplicate code (there is plenty of this in the kernel) that you see benefit. There is also gain by minimizing the use of conditionals.
As for how closely the code matches the actual execution... well, C doesn't neccesarily map it either. I'm not sure if you were the poster who said that code should read line by line, just the way the computer executes it or not, but the fact is is that very few non-trivial programs have _no_ parellelism in them. Certainly this is not the case with the kernel.
These guys say they've dropped execution overhead a whole bunch. Is it enough that it's worth simplifying the code? Is it possible that removal of all the conditional checking involved could actually create a net increase? It's possible.
As for debugging.. I don't know how well kdbg handles that sort of thing. I rather suspect it doesn't handle it at all, so thats a very valid point and debugging tools would need to evolve to handle that sort of thing. On the other hand, exceptions can make it a lot easier to do printf() style debugging (with minimal overhead if you don't want debugging, no less) by including the debug code in an exception object. I have no idea if that would be practical in a kernel, though.
I wouldn't except to see this in the main branch for quite some time, if ever.
I'm not disagreeing here, and I think the article is a load of hogwash, but I think that assuming that law enforcement is "doing the right thing" and acting within the law because they (presumably) know it better than you is a silly and dangerous basis for your assumptions.
In this specific case I tend to agree, granted. I'm just taking issue with the general tone of your comment.
Try excluding someone from your shop because he's black and see how far that gets you. Or because he's disabled. The incorrect part is the "for any reason whatsoever". A shop is obviously NOT a home or a purely private residence, it's open to the general public and exclusion is the exception and not the norm, and there's a different standard than there would be for your house.
G++ on x86 (maybe also PPC? I don't know) is the only one I know for sure, but I believe MSVC 7.1 uses a similiar scheme. It's not quite zero overhead, but it's very very small.
Agreed that templates can do crazy things to your executable size. That said:...because they get re-instantiated for every type they're used with
This is not neccesarily true, although I don't know if any current C++ compiler manages this properly. Any way, it's not an inherent problem of templates.
solved by treating types as first-class objects , or by lower-level methods such as explicit dispatch-table pointers.
Templates are a compile time system. A template-based system is faster (modulo cache issues caused by bloated executables....) than a dispatch table because the type lookup isn't deferred until runtime.
This is bad because you're using an exception to manage normal program flow. Here's a better use of exceptions:
try { File f("myfile");//file object manages state while (!f.eof()) { f.read(); } } catch (FileOpenException) { //file object is cleaned up by it's //destructor, only thing we need to do is //alert user }
This is a simplistic case, because you can just easily do this by checking error codes. It shows it's worth when you have, say, a dozen different files to open. You save a lot of if-checks, a lot of duplicate error handling (alerting the user and returning), and you don't have to worry about manually closing all the files which might be open, preventing resource leaks. If your exception system is properly designed, you don't lose any information, because stuff like the file you were trying to open is preserved with the exception information.
Modern (ie, good) C++ compilers get this penalty down under 1%. Whether or not it applies to Java is a pretty silly question - Java must (and does) assume that any code can throw an exception. The whole Java language and VM is built around that concept. It's more accurate to say that ALL java code suffers that penalty, at the lowest possible level.
I just tried it with Firefox 1.0, popupblocking, and tabextensions set to single window mode. I do NOT get the Secunia window when I click on the Consumer Alert image, I get the regular Citibank information, in a new tab.
Call bullshit on this, too. IE will happily save SSL served pages, even with the "save SSL files to disk" option turned off. Explicitly saving is a totally different animal, from both a usability and a security standpoint, than cache saving anyway.
Too bad. That's not your job. It's MY computer, not yours, and my window manager will stick windows wherever I want it to. There's no need for you to "reliably" position the windows anywhere, unless you're a control freak, in which case you need to stop that.
This can get taken to extremes, like the same party arguing opposing views in 2 different courts.
And if you don't think that adminitrative pressure to roll these machines out wasn't responsible for a lot of the problems we see with them then you're deluding yourself.
Diebold is spinning like a top to counter this kind of publicity. It's possible that this represents a legitimate change of heart there, but I really doubt it. I'll take thier past actions and thier documented behaviors under a lot more consideration than last minute claims made in the middle of a hail of bad publicity.
That said, I still think Qt is unsuitable/useless for cross-platform OSS development because anyone wanting to compile for windows (including every one of your windows developlers) must have a pricey commercial Qt license. One person who packages binaries every now and then is one thing, but an involved Windows user and developer community is another.
This seems obvious and I wonder why it's not widespread. Maybe it is and I just don't know it? Maybe the work of figureing out whether or not your cache is stale outweighs the benefits? Taken to it's logical conclusion, this ends up turning into AOT compilation, of course, so there's some point where the disadvantages outweigh the advantages...
We've got this for normal compilers already in the form of profile based compilation. JIT does it per instance. I don't know for sure that any current JIT has a way of saving that sort of information/state across invocations but seems like a really obvious extension.
6/10 only looks bad to you because you're used to gamer mags that would give "Triple Insane Paintball Command Quake Engine XXX Extreme" a 7.5. 6/10 is an "eh, it's okay for a while" score, which sounds like exactly what it deserves (and matches my rating after the demo).
You might be able to create some sort of game with Bartles ideas. But it won't be a very good MMORPG. It might be a half-decent fantasy gamelet. I might give it an hour or so to check it out. But I think Bartle has fallen into the same trap that a lot of game designers (thankfully, not very many succesfull ones) do, and has decided that what he wants and what he thinks is more elegant is what people should do, and players should be forced to conform. His whole article points at it - remove teleportation and instancing as a way of forcing people to interact with strangers. You can't get away with this kind of crap and expect to have a successful game, and it's not because the "newbies" have too much "power". It's because people don't like being told how to play your game and if you try to force the issue they're going to leave. Now, you can take the indie route and claim that your game isn't supposed to appeal to "the masses" and the games that do "are dumbed down" all you want, but the bare facts are that people don't think your game is any fun, and they gravitate to the ones that are. If your game is New and Different, but also Fun, then you'll get attention. It might be slow going becase there's some merit to the reasons he provides, but it's an obstacle, not a barrier. Bartles problem is that he doesn't approve of what people find fun, and that's his problem as a game designer, not our problem as players.
Note that nobody blamed video games for that, and media shied away from blaming themselves, even though it's reasonable. At least as reasonable as blaming video games.
Games don't make you do anything. But if you're going to snap and kill people, then it might influence the way you do it. If you're borderline crazy already, and you play a lot of GTA, then when you go over the edge you might act that out. Same with the postal thing - if you're crazy already, then hearing 24/7 coverage of someone shooting a post office will likely influence you when you snap.
1) Java's finalization is non-deterministic, which makes it totally non-suitable for resource cleanup. There's no way to tell when a resource will be released and in fact there is no guarantee that it will EVER be released aside from program termination. This is what is called a "resource leak".
2) Because the designers of Java know this, they have try/finally instead, so you can explicitly clean everything. This is a problem because there's more changes for programmer error (admittedly a fairly minor case), but more importantly because you end up with enormously deep layers of complex nested try/finally and state managment code. C++ style exceptions would be cleaner and also perform better (stack unwinding and objects removes the need for explicit managing of state, fewer try blocks means less stack overhead).
Java is better because it's successfull? Sure, by some metrics. Java is popular because it's adequate. It's a lot like VB - it's not "good". But it's good enough, the bar to entry is shorter and you can throw a lot more hardware at the problem. I've seen a ton of mission critical applications written in Access. Not in VB using Access, mind, but actually in the Access form/scripting front end. Does that mean Access was the best choice for that application? Of course not. In my professional experience, roughly zero design decisions are based on objective merit. C++ isn't perfect. You do need better developers. You do need a longer developlment cylce. There is less handholding and mistakes can cost you more - you'll crash rather than simply performing badly. Companies like this cause they can skimp on QA and throw hardware at problems instead, and that's a viable alternative. But it offends the asthetic in me, which is why I like C++.
If Bartle actually had this theoretical New and Better Game, and it was actually New and Better, then maybe he'd have a point. Permadeath is a lousy concept because it detracts from the fun. If permadeath doesn't detract from the fun, then it's because you aren't attached to your character and what the hell is the point then? The persistence of who you are is important in MMORPGs. Forcing a rotation of the high level players because you can't think of anything better for them to do is the lamest designer copout there is. You better hope your new and better game is going to attract the newbies, becuse it's damn sure you aren't going to have that many old timers sticking around.
There's been plenty of MUDs with permadeath. A few of them are even still around. None of them are large or vibrant. There's a reason for this and it's not because they're wonderful games that plebians won't play. It's because permadeath sucks.
Instancing is another area he has his head up his ass. It's a working solution to a problem all high population games have. It's also an easy way to provide semi-random content. Is it perfect? No, the perfect solution would be to have more content than your players can consume. But since that's a practical impossibility, we'll settle for instancing so that consuming the content that is available doesn't suck. If he's got some magic method for being about to create content that fast, then maybe thats what he should be sharing. I think his current method of "alienate everyone but a couple dozen players" isn't really a road to success.
Naturally Diebold disputes it - I don't see that as noteworthy. I'm not very impressed with the auditing they undergo either, as the software which was leaked was software which had been deployed on voting machines, had passed audits, and was FULL of problems. So all things considered I'm going to dismiss that. There's a lot of problems with Diebold machines, and while I don't think that outright election fraud is one of them (at least not organized - maybe there's a rouge developer or three, but I emphsize that I have no proof of that) I think that they are real problems none the less. The "workarounds" for procedural issues (like printing "System Tests passed") should be familiar to anyone who's worked in government or even a lot of corporate software development. It's slapping stuff together to make it work and keep your users from looking too closely at it. I think that for something this important that sort of behavior shouldn't be tolerated.
Finally, I think that the Kerry campaign, even if they suspected election fraud, wouldn't do jack without hard-edged, totally irrefutable proof. It'd be a political nightmare and they're going to swallow it and try again in 4 years. The Democrats took an enormous hit over Gore pursuing the Florida thing, and that was with evidence of widespread abuse and inconsistencies in the voting record (including from Diebold machines). Did those abuses and incosistencies change the 2000 election? Maybe. Probably not, but they did exist.
Relying on someone else to validate a distrust of the system is pretty much always a bad idea. It's even worse when the person you're replying on is part of the system. It'd be like saying that CNN couldn't have edited it's poll results, because FOX would have reported on it. I kinda wish Kerry did push it, because there's a lot of problems with our election system (all that crap in Florida last time didn't only happen there, that's just what got the press cause it was the swing state), but on the other hand it'd be political suicide for him in 2008, it'd cause a lot of animosity, and even if they weren't actually partisan (fat chance) anything they brought up would be dismissed as partisan.
Yes, I mean riced out, not upgraded or modified - titanium bored-out gas pedal, racing seat, ripped up padding on the roof falling down, bolted on wing (that looked like it'd been made by someone in a high school shop class....), chrome rims(1 missing), wings, nitrous and R-Type stickers(!)
up2date, but apt4rpm is the bomb.
It's not a power trip per se (I suppose it is in some cases), but a disdain for (for example) hotmail and microsoft and the users thereof. You find much the same sort of attitude toward AOL. In the case of Hotmail/Microsoft it's increased by Microsofts (percieved?) disdain and disregard for them and what they consider important.
Yes, I think reasonable vender notification is a responsible thing to do. But I understand why people aren't willing to extend it to Microsoft. And while I don't agree with it, the argument of "user a better service" or "use a better operating system" certainly does have merit.
Is it really that hard to understand that people like Google and will cooperate with them, and they don't like Microsoft and therefore won't expend any effort to be nice? This is basic Golden Rule stuff.
Exceptions offer little to no benefit in cases where the error checking is simplistic (including all the cases used as samples in these threads). It's where the error checking is complicated and involves duplicate code (there is plenty of this in the kernel) that you see benefit. There is also gain by minimizing the use of conditionals.
As for how closely the code matches the actual execution... well, C doesn't neccesarily map it either. I'm not sure if you were the poster who said that code should read line by line, just the way the computer executes it or not, but the fact is is that very few non-trivial programs have _no_ parellelism in them. Certainly this is not the case with the kernel.
These guys say they've dropped execution overhead a whole bunch. Is it enough that it's worth simplifying the code? Is it possible that removal of all the conditional checking involved could actually create a net increase? It's possible.
As for debugging.. I don't know how well kdbg handles that sort of thing. I rather suspect it doesn't handle it at all, so thats a very valid point and debugging tools would need to evolve to handle that sort of thing. On the other hand, exceptions can make it a lot easier to do printf() style debugging (with minimal overhead if you don't want debugging, no less) by including the debug code in an exception object. I have no idea if that would be practical in a kernel, though.
I wouldn't except to see this in the main branch for quite some time, if ever.
In this specific case I tend to agree, granted. I'm just taking issue with the general tone of your comment.
Try excluding someone from your shop because he's black and see how far that gets you. Or because he's disabled. The incorrect part is the "for any reason whatsoever". A shop is obviously NOT a home or a purely private residence, it's open to the general public and exclusion is the exception and not the norm, and there's a different standard than there would be for your house.
G++ on x86 (maybe also PPC? I don't know) is the only one I know for sure, but I believe MSVC 7.1 uses a similiar scheme. It's not quite zero overhead, but it's very very small.
This is not neccesarily true, although I don't know if any current C++ compiler manages this properly. Any way, it's not an inherent problem of templates.
solved by treating types as first-class objects , or by lower-level methods such as explicit dispatch-table pointers.
Templates are a compile time system. A template-based system is faster (modulo cache issues caused by bloated executables....) than a dispatch table because the type lookup isn't deferred until runtime.
Exactly. Here's an example of poor use of exceptions:
//file object manages state
//file object is cleaned up by it's
//destructor, only thing we need to do is
//alert user
try {
while (1) {
read_from_file();
}
} catch (EOFException) {
clean_up_file();
}
This is bad because you're using an exception to manage normal program flow. Here's a better use of exceptions:
try {
File f("myfile");
while (!f.eof()) {
f.read();
}
} catch (FileOpenException) {
}
This is a simplistic case, because you can just easily do this by checking error codes. It shows it's worth when you have, say, a dozen different files to open. You save a lot of if-checks, a lot of duplicate error handling (alerting the user and returning), and you don't have to worry about manually closing all the files which might be open, preventing resource leaks. If your exception system is properly designed, you don't lose any information, because stuff like the file you were trying to open is preserved with the exception information.
Modern (ie, good) C++ compilers get this penalty down under 1%. Whether or not it applies to Java is a pretty silly question - Java must (and does) assume that any code can throw an exception. The whole Java language and VM is built around that concept. It's more accurate to say that ALL java code suffers that penalty, at the lowest possible level.