Developer Question: function calling conventions

Diskussions related to the development of PhpLogCon

Google Ads


Developer Question: function calling conventions

Postby rgerhards » Mon Feb 11, 2008 12:38 pm

Hi,

I just discussed with Michael how the calling interface for functions should be. So far, we have settled on a model where each function returns an integer error code, for which some constants are defined. There is one OK state and a number of error states. The caller must check the returned result and decide whether or not to abort its own operation on unexpected return states.

So far, we have decided not to use exceptions, one reason being that we are a bit unsure about proper cleanup.

But it remains the question if exceptions would be a better way to go, if they are used together with some return state signaling.

Please let's discuss this topic here, it is an important one before we can start developing actual code.

Thanks,
Rainer
rgerhards
Site Admin
 
Posts: 3806
Joined: Thu Feb 13, 2003 11:57 am

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Postby alorbach » Mon Feb 11, 2008 12:58 pm

Lets go for the error return state codes. I wasn't aware php had something like exceptions yet. If, it is proberly a very new feature and won't work with older PHP Installations.
alorbach
Site Admin
 
Posts: 1627
Joined: Thu Feb 13, 2003 11:55 am

Postby rgerhards » Mon Feb 11, 2008 1:46 pm

OK, so be it. I have to admit I expected a longer discussion, but I like quick ones ;)

Rainer
rgerhards
Site Admin
 
Posts: 3806
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 0 guests

cron