I have read the article that Ralf posted another time and i tried to read the comments (too much and its too late)
Because the comments are post and we have the same discussion (not about checked exceptions in particular)

In the end i felt like: uhm they missed a point :
The actual problem of developers is that its so difficult to write so much code if a error occurs (which is reasonable)
This removes freedom and cleanness. If you have in Java a bunch of these:

  try {
    f.read();
  } catch(e:IOException) {
    // do something
  }

you won't be able to read anything anymore. One idea to get freedom would be a direct redirect to a errorHandling method which might be directly within the class or within a property. Just like:


void fileNotFoundMessage(IOException excp) {}
void systemControl.fileNotFound(MyClass scope, Throwable excp) {}

f.read() handle fileNotFoundMessage, systemControl.fileNotFound;

the certain methods get automatically mapped by their first parameter and it will be transformed like:

try {
  f.read();
} catch ( IOException excp) {
  fileNotFoundMessage(excp);
} catch (Throwable excp) {
  systemControl.fileNotFound(this, excp);
}

In essence you could deal a lot more than just exceptions with that but I focus. Of course you loose the local scope and
its no "alltimesolution" anyway but it might improve readability and allows to integrate general error points more easily.

uhm
just an idea
yours
Martin.


2006/8/28, Chris Allen <[EMAIL PROTECTED]>:
On 8/27/06, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:
> ... but passing events up a deeply nested call chain is a pain, isn't it?
> it's surely possible, but much more code.
>
For what it's worth, I usually take this event broadcasting approach
with AS2, if you accept that most stuff is event based and style your
code to that it's not too cumbersome. But, I would love to see better
support of Exceptions in ActionScript. Even AS3 hasn't taken it as far
as it should to make it useful IMO.

> cheers,
> ralf.
>
> On 8/27/06, Martin Heidegger < [EMAIL PROTECTED]> wrote:
> > > For me, the main point of using exceptions is the possibility to pass
> >
> >
> > > the control up the call chain.
> >
> >
> > I usually use events for those kinds of problems because they are usually
> > better for visualisation.
> > I mean like:
> >
> >   .onXmlParseError
> >   .onFileNotFound
> >   .onConnectionNotPossible
> >
> > because those are on one hand better readable and on the other hand there is
> > better support
> > for events than for exceptions. So it matches a little better in my
> > workflow. I hide this way the
> > problems too from the unnecessary code parts because they just are not going
> > to be called.
> >
> >   .onXmlParseReady -> builtTree (only gets called if everything was fine
> >
> > yours
> > Martin.
> >
> > _______________________________________________
> > osflash mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
> >
> >
>
>
> --
> Ralf Bokelberg < [EMAIL PROTECTED]>
> Flex & Flash Consultant based in Cologne/Germany
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org



--
ICQ: 117662935
Skype: mastakaneda
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to