qhtml, qurl, qsql, qjs

These are some easily remembered functions for quoting used in website programming.

Using the idea of consistency allows you to remember how to quote things. Just use the function with a q in front of it.

url quoting, html quoting, sql quoting, and javascript quoting are things that web developers do almost every day in some frameworks.

Please consider using these short cut functions in your web frame work. Maybe if quoting was easier to use then people would use it more often.

It's probably the next best step compared to quoting by default, and not needing to quote at all.

They should be top level functions as well so they are easy to use.

* Note, I also use qhtm as a shortcut for qhtml. Just like how htm and html are used for webservers. qjavascript would probably be another good alias - but not one I use. I don't use a qxml, since when writing xml I use more verbose forms for constructing xml - but maybe it would make sense too?

Comments

Anonymous said…
It's always seemed strange to call this "quoting", when you're using anything other than quotation marks. So the q is counterintuitive to me.
René Dudfield said…
Maybe e is a better prefix. Then it could stand for escaping, or encoding.

However I think the marketing world has ruined eSomething for me.

ehtm esql ejs eurl

Yeah, I think e may be a better prefix. What do you reckon?

Popular posts from this blog

Draft 3 of, ^Let's write a unit test!^

Is PostgreSQL good enough?

post modern C tooling - draft 6