Skip to content

Conventions

StephenChan edited this page Nov 12, 2012 · 3 revisions

Terminology

  • In the past, the artificial-intelligence entity that automatically annotates images has been variously called "robot annotator", "machine annotator", "automatic classifier", "robot classifier", etc. However, the terminology should be consistent to avoid confusion, so we've decided on the name machine annotator. The action of the machine annotator doing its work is machine annotation. These terms should be used consistently, especially in form help texts, or other writing that is visible to website users.

Language specific coding conventions

These aren't strictly monitored conventions, but more of suggestions and guidelines to follow when in doubt of anything.

Python

In general, refer to PEP8.

Javascript and jQuery

When a variable is a jQuery object, prefix the variable name with "$". (Yes, JavaScript allows the dollar sign in variable names.) For example, you might have $loginForm as the jQuery object containing the login form DOM object. The reason this convention is useful is that you could easily have a function that manipulates both jQuery objects and DOM objects, and the $ is a clean indicator of what kind of object a given variable is.

In general, variables and functions are named with camelCase. There is a fuzzy line, though, when your Javascript variables refer directly to DOM elements of a particular ID or class, because HTML IDs and CSS classes often use lower-case-with-dashes or lower_case_with_underscores. (To further complicate things, Javascript does not accept dashes in names, while HTML and CSS do accept dashes.)

Clone this wiki locally