I use try-catch but rarely do I find a need for finally. Finally is optional and it is only needed if you absolutely need some piece of code to run regardless of whether the code hits the try or the catch. Personally, I feel like try/catch blocks are just good practice. Maybe it was only the finally that was giving you trouble. Hard to say without the code.

-Jake

SJF wrote:

Technically, it's good practice/professional to use try-catch-finally blocks in your actionscript logic. This ensures a robust, easily debugg-able application.

However, can anyone comment if they actually use try-catch-finally or whether anyone is for or against it's use.

I ask because I've received an application (which streams vidoe) that was blowing out numerous users CPUs to 100%. Upon further investigation, it appears that a netstream event is firing 20 times a second, and within the listener (listener function that is) for the event, there is a try-catch-finally block. I removed the try-catch-finally and CPU usage halved on my machine.

Anyone care to comment for or against try-catch-finally and it's use.
Steve.

Reply via email to