PHP - typos not welcome

Tuesday January 05 2010

After a few days away from PHP I’m back to reading PHP for Absolute Beginners I’m on page 85 right now. I’m going slow because I’m actually typing out all the exercises. Why type it out? Well I learn best by doing and by actually typing It’ll actually help me to remember the syntax.

One thing I’ve learned is that PHP is very finicky when it comes to syntax. One little typo and the whole script blows up and fails to execute properly. One of the most common typos I’m making is failing to type in the underscore for superglobals like $_POST and $_SERVER. Am also wondering if it’s okay to type those in lowercase or is PHP case sensitive?

update

turns out superglobals are case sensitive from @designchuchi via twitter .

One thing that PHP for Absolute Beginners recommends is to use an IDE. I am using the recommended one—Eclipse For the most part I like it as it has code highlighting. However one thing I’m not so keen on is the auto closing of tags, brackets, braces and quotes. In particular I don’t like auto closing quotes and brackets as it slows down my typing. inside quotes and brackets for the most part it seems I’m typing single words and at the end of the word I then have to look to the keyboard to find the arrow keys to move to the end of the auto closed bracket or quote. Is there a hot key command to skip to the end or a way to turn the auto closing off?


Sean inscribed these words of wisdom on Tuesday Jan 5, 2010 at 02:47 PM
Permalink | tags: code, editor, php, eclipse, ide, |

Comments

Picture of Dave

Dave wrote 69 words  on  Friday Jan 8, 2010  at  09:22 AM Korea (South)

I’m pretty sure you can use the home/end keys to move to the beginning/end of a sentence (been a while since I used winblows though). Also, you have to dig through the (awfullys complex) settings, but you can definitely disable auto-closing quotes.

I’m curious though.. what language allows you to make typos and still execute the code? Sounds rather bad, if you ask me (try debugging that sucker raspberry).

Sean

Sean wrote 44 words  on  Friday Jan 8, 2010  at  09:26 AM China

Dave,

my thoughts about typos weren’t really a complaint so much as a point for me to remember and be more careful about my typing/syntax. If typos were allowed I definitely wouldn’t want to debug that.

Will check out he options for disabling auto-closing.

Picture of Dave

Dave wrote 10 words  on  Friday Jan 8, 2010  at  09:55 AM Korea (South)

Ahh.. there we go. Must’ve miss-read that one, hehe grin.

Picture of fat burning furnace reviews

fat burning furnace reviews wrote 45 words  on  Wednesday Feb 10, 2010  at  07:34 PM India

I like to do 5-7 reps with heavy weights at the gym once every 2 days. However, I also need muscular endurance and some people say that you can do body weight exercises without having to worry about over-training. Is this true?fat burning furnace reviews

Commenting is not available in this weblog entry.