I will keep on ranting and raving about the ugliness of web development. Ιt is so frustrating I really wonder how a normal programmer could stand such unnecessary complexity, absolutely offending to “The Art of Computer Programming”, so firmly established during the seventies. I really don’t know web designers’ opinion—they may get carried away with the artistic aspect of their job, but for programmers it is as bad as it could get.
In the previous part I confined myself to the client side of the web. Alas, there is more (and worse) to grumble about in the server side, where the web server and the database live (for now let’s ignore the intermediate application server). Mainstream language there is PHP.
In a smartass recursive fashion, PHP stands for “PHP Hypertext Preprocessor” which is wrong, as PHP is a plain hypertext (HTML) preprocessor producing no PHP code, as some functional languages (Lisp) do.
PHP is embedded in HTML using <!?php ... ?>
tags, as if they couldn’t simply use <script type="text/php"> ... </script>
or even <php> ... </php>
. I dislike the superfluous echo/print
vs document.write
, but I respect DOM hierarchy.
PHP syntactically resembles C, but, strangely enough, PHP’s commands are case insensitive! But, wait, its variable names ARE case sensitive. Forget not, that JavaScript is case sensitive, whereas HTML is not. Perverts!
Logical operators can be written Pascal-like as and, or
, or C-like as &&, ||
. Even worse, some twisted mind decided to assign different priorities to &&
and and
. Thankfully, xor
has no C-like analogous, and !
has no Pascal-like analogous. I really wonder why did he miss introducing a times
operator for lowering the priority of the *
multiplication, and so forth. Unbelievable!
To break the tradition of mocking PHP, I value its use of the $
(although I would like to optionaly alias it with €
). Seriously now, preceding variable names with a $
may perplex you, but it offers the opportunity of explicit dereferencing, once or twice. And doubly dereferencing is the proper syntax for passing parameters reference in function calls. That I like! However, if dereferencing were to be used consistently, assignment should be coded as num1 = $num1 + 3;
I could go on pinpointing ugliness in arrays, in foreach
, but honestly PHP has overwhelmed me. If I were a translator program, I would get pimples chewing it and indigestion while post-processing it.