If I ask a user for a URL, and they type in something like 'www.google.com', should I assume they meant
It depends on the context in which you're asking for a URL. If the url is supposed to be a fully qualified URL (
http://example.com/foo/bar/baz) you can safely assume
http:// if they haven't prefixed it with
ftp, and any other possible acceptable protocols.
If, instead, you're asking for a url that may or may not be relative to the current domain, you wont be able to assume any protocol, although you could provide a default value of
http:// as starter text
For a great example of where this is used, look no further than Stack Exchange's own link field in the popup used in the question/answer content editor (Ctrl + L).