Python or PHP?

Ville Vainio ville at spammers.com
Mon Apr 25 02:49:50 EDT 2005


>>>>> "John" == John Bokma <postmaster at castleamber.com> writes:

    John> Who told you Perl can't do exceptions?

Back when I learned (heh, I never 'really' learned, but knew enough to
write programs in it) perl, almost every function call was followed by

or die("blah");

i.e. the user had to check the error code. If the function would have
raised an exception instead, such check would be redundant because it
would never be executed.

In Python, all error conditions raise exceptions. If python
'supported' exceptions but standard library functions didn't raise
them, the feature would not be worth much.

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list