Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Retarded Coding Standards

Name: Anonymous 2012-06-22 1:20

"Always compare equality with a constant on the left, for example if (5 == maxUsers) instead of if (maxUsers == 5). If neither of the expressions being compared are constants, rewrite the condition so it is, for example if (0 == userCount - userLimit) instead of if (userCount == userLimit)."

"For consistency with the previous rule, non-equality comparisons should also be formatted using the same style. For example, use if (0 < userCount) instead of if (userCount > 0), and if (0 < userCount - userLimit) instead of if (userCount > userLimit)."

Name: Anonymous 2012-06-22 15:37

>>27
Best solution for everyone:

//;--# Disclaimer: the syntax here is completely arbitrary, I'll use all comment syntaxes I know to achieve full neutrality, except VB's because it's retarded above salvation.

--//#; `let', `var', whatever to declare variables, refs instead of everything-is-mutable (optional).
let x = getX(), y = make_ref(2);
//--#; (:=) assigns to refs/mutable variables. Its return type is void or unit.
y := 3;

#//;-- Then equality is one of:

;#//-- If the language doesn't permit definition of new operators. If it's in a let, it's a binding =, else it's just an operator.
if x = y ...
#;--// the usual, x = y is a syntax error: expected expression, got a binding form.
if x == y ...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List