diff --git a/about/coding.md b/about/coding.md index b1a5c13..2525bc6 100644 --- a/about/coding.md +++ b/about/coding.md @@ -17,12 +17,23 @@ These are guidelines for code style and quality that we follow at UseTheSource. * all public classes are documented with Javadoc to state their intent and purpose. * all public methods are documented with Javadoc to state their intent and purpose. -* package names are `io.usethesource..` +* package names are `io.usethesource..` +* use the `@Override` annotation everywhere it's possible. +* clean up all unused imports. ## Rascal -* all public functions have @synopsis tags in Rascal tutor format. -* most public functions have @description and @examples tags in Rascal tutor format. +* all public functions have `@synopsis` tags in Rascal tutor format. +* most public functions have `@description` and `@examples` tags in Rascal tutor format. * tools for languages reside in `lang///.rsc` * generic algorithms for analysis reside in `analysis//.rsc` * generic utilities (i.e. for communication) reside in `utils/.rsc` +* names, unless mapped one-to-one from an external source, follow these rules: + * references to instances like variables, constructor names, field names, functions, pattern variables, tag names all start with lowercase and continue with camelCaseStyle. + * names of types, data, syntax, lexical, keyword, layout, and alias types, all start with a capital and continue with CamelCaseStyle. + * constants are in ALL_CAPS + * meaningful reserved names, such as `if` for the constructor name are not renamed to avoid the collision but escaped like so: `\if`. This holds for all names. + * Abstract syntax trees use the typical names as declared in `analysis::m3::AST`: Declaration, Expression, Statement, Type, Modifier. + * the source location of the original information is always stored in the field `loc src=|unknown:///|` + +