Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: "L505" <DelphiNG(@)z505(.)com>
- Date: Sun, 11 Jun 2006 14:04:41 -0600
"Michael Stum" <devnull@xxxxxxx> wrote in message
news:448b7108@xxxxxxxxxxxxxxxxxxxxxxxxx
L505 schrieb:
With no compiler, its the gateway drug to bad programming. IIFRC, PHP *IS* case sensitive, at least on my Linux box, it is.Actually it´s mixed. PHP variable names are case sensitive, but the
names of functions are case insensitive.
think Microsoft got this one right with ASP.NET.
Try this in PHP, too:
$dummy1 = '20usd';
$dummy2 = 'usd55';
print $dummy1 + $dummy2;
The output on my web browser is:
20
Talk about inconsistency and danger in dynamic/weak typing.
I just imagined that, and my conclusion is: if you REALLY rely entirely
on the user input and properly double check it, even a perfect language
would not do the job here.
I know it's just an extreme example, so I just ignore the fact that such
horrible implementations indeed exist
Well I can say that it's hard to imagine, but plenty bad programs out there like
this do exist as I've been able to inject javascript into user input forms on
even big corporate websites, when they are only supposed to accept say
characters [a..z]... I guess I should start going around to websites and hacking
in to them and then contacting the website owner and asking if they want to hire
me as a security expert (where does destructive hacking become constructive?).
Really, I'm not a script kiddy - I've been analyzing this common unfiltered weak
type PHP habitual programming for constructive purposes. I'm developer of a web
library for Pascal and want to make sure it is done right - so analyzing all the
flaws of PHP actually is constructive in designing the web library for Pascal.
In both PHP and ASP programs I found plenty of cases where people do not check
their input..
But this does go beyond just compiler type checking. Compiler type checked apps
can also be poorly designed - but the point is I guess that using the is_numeric
function bloats the code up when at least some of the web program could have
just be checked at compile time - yet the dynamic/weak type language advocates
argue that weak/dynamic typing offers less code bloat since the code is simpler
and cleaner on paper - but not if you have to do more Unit Testing and add more
run time check code - that gets you back to adding more code bloat in the end
and reinventing strong typing/strong filtering.
Only the most unsafe and unfiltered PHP programs are clean and neat source - the
real strong PHP programs are strongly typed at run time, using run time code to
check input...Ironic.
Worst yet - you know those websites that say "Hacker Safe" on them? For fun,
I've found quite a few websites with the "Hacker Safe" logo on them which are
unfiltered and written like the above example I gave. Yes, I've found plenty of
"Hacker Safe" websites which are unfiltered and unsafe programs, with many
glitches like the above code snippet I gave... But don't worry, I'm not using it
for destructive purposes - again, I'm a web library designer and have been
scouting all this information out for constructive purposes :-)
Function that you can use in the mandatory check-function:
http://fr3.php.net/manual/en/function.is-numeric.php
In my opinion, the output should be 0 or "error, cannot add two strings". I
wouldn't want it to be 75, 20, or 55. That's lunacy.
I share your opinion on that - returning 20 in the above example is
really a big WTF.
Yes, maybe even "8" would make more sense if you are adding say for example
two 4 byte storages... 4 + 4 is 8. But I still think 0 or an error is more
reasonable. :-)
.
- Follow-Ups:
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Jim Rowell
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- References:
- Delphi has ruined me. Ruined, I tell you, ruined.
- From: Warren Postma
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Felipe Monteiro de Carvalho
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: mramirez
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Eddie Shipman
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Felipe Monteiro de Carvalho
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Henry Hansen
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: L505
- Re: Delphi has ruined me. Ruined, I tell you, ruined.
- From: Michael Stum
- Delphi has ruined me. Ruined, I tell you, ruined.
- Prev by Date: Re: HOT FIXES SUCK!
- Next by Date: Re: .NET 3.0 created by the stroke of a pen
- Previous by thread: Re: Delphi has ruined me. Ruined, I tell you, ruined.
- Next by thread: Re: Delphi has ruined me. Ruined, I tell you, ruined.
- Index(es):
Relevant Pages
|