Emil Lerch

Husband, Father, Technologist, Cloud Architect

Javascript/PHP annoyances

I ran across a problem the other day in a PHP script, where a variable wasn’t getting populated. It turned out that I misspelled the variable name - clearly my fault. However, it got me thinking about the language itself, and how it is actually somewhat hypocriful. On one hand, PHP (and Javascript for that matter), is relaxed when it comes to variables. There is no strong typing, and in PHP, you don’t even need to declare a variable before using it. On the other hand, both languages are type sensitive.

It seems to me that if you’re going to have a laid back policy in regards to variable naming, you should also be laid back when it comes to case. Being case sensitive with weak controls on variable definition doesn’t make sense. It’s the computer science equivelent of mixing first and third person.