PHP classes = ‘Happy’; Javascript “classes” = ‘Pull your hair out’;
As mentioned previously I have been trying to move INAP away from a simply function based system to a class based system. The PHP was unbelievably easy to convert. It literally took a couple hours to convert the entire program from prefixed functions to nice, neat and easy-to-read classes. It was rolled out with a few bugfixes and very little stress.
Then I started to do the same to Javascript, so the plugin could clarify its variables and functions and still “play nice,” and I swear the all the Javascript was specifically coded to make it difficult. Getting all the variables alone to be readable where and when they needed to be was bad by itself, throw on top of it some of the bad coding style that has just perpetuated itself over the past year in the scripts and the fact that Javascript doesn’t have real classes.
Oh well, I think switching over to Javascript design patterns will be worth it in the long run. I just wish that Javascript had real classes like PHP, so you didn’t have to fake it so much.