Skip to content

Instantly share code, notes, and snippets.

@Herringway
Created November 25, 2013 13:53
Show Gist options
  • Save Herringway/7641487 to your computer and use it in GitHub Desktop.
Save Herringway/7641487 to your computer and use it in GitHub Desktop.
1. File extensions should only be used when denoting the file type the user will receive.
ie. /index.php is BAD, /index is GOOD. /index.html is also good.
This avoids issues with ports to different languages, where one of two things will occur: either URLs change (very bad) or the webserver will be forced to use awkward rewrite rules.
2. URLs must never become invalid if it can be helped.
Dead links on older sites and various discussion systems only serve to confuse and/or frustrate the users.
3. Data should be made available in a variety of different formats.
At minimum, HTML (if meant to be consumed by users) and JSON.
This allows other developers to find new and creative uses for your data, while saving both bandwidth and time.
It also enables easy non-HTML development (ie mobile apps)
4. Always use GET requests, unless the user should expect something to be changed with the request (email address, password, etc)
Many back/forward button clicks will cause users to be presented with dialogs asking them if they wish to continue, especially combined with HTTPS. This frustrates the user.
5. Ensure standards-compliant output!
Undefined behaviour and poor adherence to standards is, at best, an annoyance to users and developers, and at worst, a security risk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment