Alan Hogan

Feed
  

Guide to Working With My PHP Projects

Indentation conventions

  1. Use real tabs, not spaces, to indent. Some editors require you to enable a setting to switch this. PSPad for Windows is one such program; go to Settings > Program Settings > Editor (Part 2) and check “Real Tabs.”

  2. I try to use tabs of size 4 in all my webdev files, including PHP and Markdown, PHP files, so set your editor accordingly. (This is partly because of the next rule…)

  3. Markdown, if you use it, requires tabs or 4 spaces (and no less!) to indicate indentation.

Filename and URL conventions

  1. In public URLs, I almost always prefer hyphens (-) between words for readability and because underscores can look like spaces when underlined (e.g. in a hyperlink), which can especially confuse new Internet users.

  2. In server-side-only files and directories that will never appear in a browser address bar, I prefer underscores (_) between words.

  3. Going “up” a level in the URL should produce expected functionality!

Original content, graphics, and code © Alan J. Hogan 2000–2008. Contact me.

Other work © respective authors.

Site map