[Info-vax] OS implementation languages

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Mon Sep 11 08:29:23 EDT 2023


On 2023-09-09, Arne Vajhøj <arne at vajhoej.dk> wrote:
>
> PHP actually follows the same rules as most languages:
>    not able to continue => error
>    able to continue => warning
>    error => stop execution
>    warning => continue execution
>

Some of what PHP considers to be a warning would be an error elsewhere.

> But PHP does allow some constructs that other languages do not.
>

Loose equality in comparisons is an absolutely moronic feature and
gives you code that appears to work right until certain input is
provided to it.

It's even more moronic that it's the default behaviour and you have
to work to get the strict equality you would see in other programming
languages.

>
> There is a pretty big majority in the IT industry that believe
> type safe languages are not the right choice for web applications.
> Business critical web site or not.
>

Would this by any chance be the same people who just want to continue
throwing bits of code into an editor until what they are building
appears to start working ?

> Just like you can ask a C compiler to not continue with
> warnings then you can do the same with PHP.
>
> function always_die($errno, $errstr, $errfile, $errline ) {
>      echo "$errstr in $errfile on line $errline";
>      die();
> }
> set_error_handler('always_die');
>
> will force PHP to stop at warnings and notices (PHP term for
> informationals).
>

A beefed up version of code like this is included into the top of
every PHP script I write.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list