Whitespace
Whitespace characters (spaces, tabs, newlines) are generally ignored in Motoko, but are essential for separating syntax components like keywords and identifiers. Proper use of whitespace enhances code readability.
Incorrect use of whitespace
Section titled “Incorrect use of whitespace”persistent actor Counter{var x : Nat = 0; public func inc(): async Int{x+1; }};Proper whitespace usage
Section titled “Proper whitespace usage”persistent actor Counter { var x : Nat = 0; public func inc() : async Int { x + 1; };};