Linked by David Adams on Wed 14th Dec 2011 16:01 UTC, submitted by fran
Internet & Networking PHP's popularity and simplicity made it easy for the company's developers to quickly build new features. But PHP's (lack of) performance makes scaling Facebook's site to handle hundreds of billions of page views a month problematic, so Facebook has made big investments in making it leaner and faster. The latest product of those efforts is the HipHop VM (HHVM), a PHP virtual machine that significantly boosts performance of dynamic pages . And Facebook is sharing it with the world as open-source.
Thread beginning with comment 500231
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[6]: Database
by malxau on Thu 15th Dec 2011 22:22 UTC in reply to "RE[5]: Database"
malxau
Member since:
2005-12-04

If every function needs to add "throws Exception", then there's absolutely no benefit at all...My point was that forced exception handling in Java is awkward for rapid prototype workflows where it makes far more sense to focus on normal code paths first...


I think lucas_maximus is saying that you can effectively cripple the feature, and in doing so get much closer to being a rapidly prototyped environment. Java is trying to strongly discourage you from ignoring errors, but you can tell it that you really want to (if you really want to), bubble everything up to main() and terminate your app (which is what would happen if Java didn't do anything.)

If you do this, at least every function will be documented as propagating exceptions, so you have a permanent record of what to fix later (whereas without this it's never clear where exceptions are propagating.)

Reply Parent Score: 2

RE[7]: Database
by Alfman on Fri 16th Dec 2011 04:31 in reply to "RE[6]: Database"
Alfman Member since:
2011-01-28

malxau,

"If you do this, at least every function will be documented as propagating exceptions, so you have a permanent record of what to fix later (whereas without this it's never clear where exceptions are propagating.)"

Well, if exceptions were merely warnings you'd still get that. And I wouldn't even mind if Java marked class files as "tarnished" if they ignored exceptions, but that's just not how things panned out.

There are other sticky issues too like how checked exceptions are at odds with the OOP idea of encapsulating implementation details behind a stable interface. Suppose we've got two different implementations with the same interface except that use different underlying libraries, which throw different internal exceptions. In all other languages these two implementations would be compatible, but in Java, the calling functions need to be re-written to throw/catch the new exception type.

Now you could wrap up the internal library's exceptions inside a compatibility exception class every time they're handled, but that's considerably more work, and assumes you anticipated the implementation switch down the line.

Some devs are still in favor of it, and that's ok, but as for me I'm thankful other OOP languages haven't copied it.

Reply Parent Score: 2