|
|||||||||||||||
Current Texts Comic Imprint Calendar Search PHP-Classes Container-Wizard main.s21 |
|||||||||||||||
Categories
{{login}}
|
prototype.js
Ouch - stepped onto another mine within the IT landscape. This time I wondered why a certain JavaScript-Function - a tiny function - stopped working from now to then. It was nothing special, take an associative array and merge it to a string. So compared two instances, working page and non-working one. There was a JavaScript "prototype.js" included in the non-working version. Short search machining brought an explaination: you should not use associative arrays in JavaScript anyway, therefore we broke it. Have a nice day (and by the way, you qualify as idiot just for asking). Of course, there were other positions, rants against prototype.js as well as replies to rants, so to say rants against rants. Possibly something like "blank indentation vs. tab indentation". It supports my hypothesis of JavaScript being 'utter crap'. Not utter crap as in 'responsible for security problems and bad site design', because that's not fault of the tool, but utter crap as in 'badly designed language'. For I think that it is a bad thing if you can 'enhance' a language userspacewise in a way that it becomes a different one, and I find it extra bad that it is obviously necessary to do so in order to turn it into something at least decently usable. So my beef is less with prototype.js but JavaScript itself, as I find it difficult to understand why you should ship a language without a proper implementation of associative Arrays. I've done wonderful things with associative Arrays even before I was into proper OO design, and even today I wouldn't miss them. And before someone comes up with 'associative Arrays aren't OO' and some 'everything is an object'-crap, 'fine': let me tell you that OO in JavaScript sucks as well, at least as long as I haven't got a proper syntax such as the usual class {}, private x, protected y, class foo inherits bar and so on. In the end, it reminds me on why I like PHP so much and never got quite warm with Python/Ruby in a web environment: PHP works out of the box, and it works simple. I can just write a mostly HTML file and put some <?php echo date("Y-m-d H:i:s"); ?> in there and be happy. With Python/Ruby, you go down a road of "handlers" and "apache output classes", which will eventually raise the question whether you should write your own framework or use an existing one; which basically means that from thereon you cannot say "Ruby" any longer, but have to say "Ruby with Rails" or "Ruby with NIH-Guard which I wrote myself" or "plain Ruby that drove me insane". Welcome to a developer's life. CommentsPlease note: comments posted won't be visible immediately, as they will be checked for harmful content. |