Re: What *tasks* are hard for PHP? [message #172069 is a reply to message #172068] |
Sat, 29 January 2011 10:59 |
Tim Streater
Messages: 328 Registered: September 2010
Karma:
|
Senior Member |
|
|
In article <%MP0p.22457$3K(dot)9265(at)newsfe12(dot)iad>,
"P E Schoen" <paul(at)pstech-inc(dot)com> wrote:
> "Curtis Dyer" wrote in message
> So, I'm very new to server-side programming, and I've just found it
> difficult to learn. I suppose I'm just somewhat resisting the concept of
> context based typing and the myriad of alternate ways to do the same thing,
> especially using very cryptic symbols instead of the much more verbose but
> more intuitive and human-readable verbosity of Delphi Pascal. I actually
> prefer C to some extent, but I've come to accept Delphi as my language of
> choice, especially for Windows GUI.
If you prefer C I'm surprised you're having trouble with PHP, which I
found to be a simplification. Personally I find declaring variables to
be a bore and waste of time, along with worrying about their types.
Nothing nicer than being able to say:
$num = (something, e.g. number of result rows from database query)
$char = "s";
if ($num==1) $char = "";
if ($num==0) $num = "no";
echo "We got " . $num . " result" . $char . "\n");
thereby producing a nice human-friendly message with a small number of
statements. Try doing that in C.
I would avoid perl just for the reason you cite: far too cryptic, and
the people on the perl ng appear to focus solely on the notion of making
their programs *more* cryptic. By contrast the PHP docs site at:
<http://www.php.net/manual/en/>
is an excellent reference source. I've purchased no books on PHP and
only occasionally asked a question here.
I started programming in 1965. During the late 90s I did none at all,
but just 11 years ago, the bloke came up to me and told me I was now the
man for the company's assets database, just being created. He gave me a
quick 30 minute talk about PHP, mySQL, and JavaScript, none of which I'd
ever used, and it was only mySQL that I'd even heard of. But, that intro
was all I needed.
So why are you, with your experience, having trouble with server-side?
Hmmm, I might replace the three statements above with:
$char = $num==1 ? "" : "s";
$num = $num==0 ? "no" : $num;
Got to make the program shorter! :-)
--
Tim
"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
|
|
|