[RndTbl] PHP undefined vars / array indices

Trevor Cordes trevor at tecnopolis.ca
Sat Jan 22 03:18:59 CST 2022


On 2022-01-20 Hartmut W Sager wrote:
> To clear my conscience, I finally have to weigh in with my vote on
> this topic, which has had a great discussion here!
> 
> I am an old-school ultra-hard-core algorithmic programmer (M.Sc.
> CompSci 1975) who absolutely believes in declaring everything,
> initializing everything before first use, etc.  Inconvenience is
> heavily mitigated with a high-grade programmer's text editor (or a
> good IDE).

Love the hardcore!  However, keep in mind that in '75 you didn't really
get a choice regarding declaration.  Most people get "imprinted" on
their first (few) languages.  I know I sure did.  I went basic ->
pascal -> perl -> C -> php/java/js/insert-modern-language-here.

I still think a lot like a pascal programmer, but was able to shake the
declarative/typed aspect.  When I first saw perl I instantly fell in
love and knew this is what I wanted a language to be like.  I've never
shaken the perl imprint, and carried that over to php, which was
basically a better-for-web-perl at the time with virtually identical
syntax and slightly renamed builtin functions.

(Treasurer Brad, share with us your language path!!)

I'm also firmly imprinted by procedural programming, as OO didn't
really exist (well not as a "thing") when I was being imprinted.  To
this day I can't get myself to see the "big win" in a full-OO paradigm.
And I've been forced to do many paid projects (and U assignments) in
full-OO in the past.  Even event-driven programming is easier for me to
grasp and appreciate than full-OO.  Some people are precisely the
opposite.

> I am appalled on a daily basis by the crap programming of Websites I
> encounter, even at places like Rogers, Fido, Telus/Koodo, Bell, etc.,
> where I would expect to see much better (yeah, I visit those sites on
> behalf of others who can't even manage their own accounts).  The one
> major exception is the big banks - for the most part, their Websites
> are functionally still a cut above the rest.

Ya, but I'd proffer that the above is more a function of bad
programmers than bad languages.  Many/most "big guys" sites are
probably Java (typed / declarative / OO), not PHP/perl (loose).

I have to deal with bad-programmer output on a semi-regular basis.
It's bad no matter the language.  I've seen some superb loose-language
code in addition to garbage strict-language code.

> The flurry of new "easy" languages we see seems to mainly exist to
> get people into "programming" who should never be programming
> anything serious in the first place.  That's what produced Cobol ages
> ago, that's what produced Python, and the trend continues unabated.

That could possibly be true, especially if we think in terms of
hobbyist / no-pro programmers.  There's lots of admins who can't really
program who pick up some bash/perl/python out of necessity.  There's
lots of web UI designers who pick up some PHP/ASP/js out of necessity.
But they aren't really "programmers".

I don't know what college/U use as the "1st/2nd year language" these
days, but my guess is it might still be something typed, and probably
heavily OO.  I'm not sure they push "easy" languages except at a
rudimentary level (i.e. "Programming for Arts students 101").  I could
be wrong.

There's always an aspect of elitism, in addition to psuedo-religion,
when it comes to programmers and their languages.  I can exhibit both
myself (some MUUGers are spitting out their beverage right about now).
We all think our favorite language and style is "the best". Nothing
wrong with that, really.  Made for some great flamewars over the
(fidonet/usenet) years. ;-) The beauty of the current situation is
there are so many languages to choose from, everyone can find their
favorite.  The freedom we have these days (in byte-land that is) is
astonishing.

But your comment ties back into the bad-programmer point.  I agree that
the level of competence (as Adam has pointed out) can be strikingly
low.  And that can make all of our daily lives a little more
frustrating.  I chalk this up a bit to the "10X Programmer" article I
put in a MUUG newsletter a while back (there's my elitism!), there just
aren't enough 10X ones to go around to every company!  Not to mention
companies often think hiring 10 bad programmers is better than hiring
one expensive 10Xer.

As a final note, I still maintain that the best programmers are born,
not made.  It's a talent, even a calling, and you either have it or you
don't.  Hire the ones that consider it a calling and the world will be
a better place.


More information about the Roundtable mailing list