Using reserved words as property names, revisited

In ECMAScript, starting from ES5, reserved words may be used as object property names “in the buff”. This means that they don’t need to be “clothed” in quotes when defining object literals, and they can be dereferenced (for accessing, assigning, and deleting) on objects without having to use square bracket indexing notation. That said, reserved … Read more

Automatic reserved word escaping for Hibernate tables and columns

AFAIK, Hibernate doesn’t maintain a list of reserved keyword (per database) so I think you should look at database identifier escaping. If you are using Hibernate 3.5+, try hibernate.globally_quoted_identifiers=true to quote all database identifiers (this is something they added for JPA 2.0, see the secion 2.13 Naming of Database Objects of the spec for the … Read more

Is it bad practice to use a built-in function name as an attribute or method identifier?

It won’t confuse the interpreter but it may confuse people reading your code. Unnecessary use of builtin names for attributes and methods should be avoided. Another ill-effect is that shadowing builtins confuses syntax highlighters in most python-aware editors (vi, emacs, pydev, idle, etc.) Also, some of the lint tools will warn about this practice.

Reserved words as names or identifiers

This is a valid question. Such a thing is possible in other languages. In C#, prefix the identifier with @ (as asked before); in Delphi, prefix with &. But Java offers no such feature (partly because it doesn’t really need to interact with identifiers defined by other languages the way the .Net world does).