The two languages are so close but so different. Some things are exactly the same, like curly brackets , if statements and ending semicolons. But variables in PHP start with "$" and JS don't. Of course I get into the habit of adding that dollar sign and then JS has a complete fit.
And what's with the console log? Can't you just spit out info like with PHP print_r?
Then there's string concatenation. PHP uses a period and JS uses a plus sign. Of course, I'm going to forget and use the wrong one. Ack!
But the worst part is that when spend a lot of time with PHP, JS seems completely and bizarrely incomprehensible. No matter how long I've been doing this, there's always a delay when I have to re-remember how to look at JS code.
Was JS created by aliens? Surely no human thinks that way - all those 'getElementById.wtf' statements... Seriously?
I wonder - when JS was created was there an attempt to deliberately mess with PHP programmers.
Leave a comment