Naming conventions: Difference between revisions

m
Line 527:
// a module name is the name of the app or library, followed by the domain name of the organization;
// alternatively, a "throw-away" module can have a simple name, like "TestApp"
module shop.acme.com {
{
// other than modules, all type and class names (including enum values) use upper CamelCase;
const Point(Int x, Int y);
enum Color {Red, Green, Blue}
interface Callback {
{
// variables, properties, methods, and functions using lower camelCase
Boolean active;
void onEvent(String event);
void onError(Exception e);
}
 
// constants use upper CamelCase, or in some cases, UPPER_SNAKE_CASE
Line 546 ⟶ 544:
// type variables are named for their meanings, and use upper CamelCase
interface Bag<Element>
extends Iterable<Element> {
{
void add(Element e);
}
}
}
</syntaxhighlight>
 
162

edits