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 500198
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: Database
by lucas_maximus on Thu 15th Dec 2011 18:43 UTC in reply to "RE[3]: Database"
lucas_maximus
Member since:
2009-08-18


Java forced exceptions caused a lot of friction with developers who simply wanted exceptions to bubble up until they were caught or the program aborted itself. Without a Java IDE to insert code templates, calling exception throwing functions was uniquely painful. Java invented a new problem that no other languages had. It would have been much better handled as a compiler warning. This was the deciding factor in my personal projects to avoid java despite wanting to use it for it's other qualities.


What are you on about? Painful, yes typing throws Exception is so painful </sarcasm> and using a try catch later, pure torture </sarcasm>

If you don't want to handle the exception locally you just add throws Exception after the method declaration. and catch the exception in the calling method.

Is this stuff hard to understand. With C# you don't have the throws keyword. However I actually wish that C# did since it would make it clear what exceptions the method would throw.

Edited 2011-12-15 18:51 UTC

Reply Parent Score: 2

RE[5]: Database
by Alfman on Thu 15th Dec 2011 20:25 in reply to "RE[4]: Database"
Alfman Member since:
2011-01-28

lucas_maximus,

"If you don't want to handle the exception locally you just add throws Exception after the method declaration. and catch the exception in the calling method."

This is exactly the wrong way to handle it IMO. If every function needs to add "throws Exception", then there's absolutely no benefit at all. By casting to the base exception class, we actually loose the information about the specificity typed exceptions which are thrown and we force calling functions to handle generic exceptions instead of specific ones.

I understand that checked exceptions are a highly opinionated topic, and I have no problem with devs who like them. 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, and then add exceptional cases at later stages of development as needed.

Reply Parent Score: 2

RE[6]: Database
by malxau on Thu 15th Dec 2011 22:22 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