How's Shortest Code Solution Defined?

By Xah Lee. Date: .

how's shortest solution defined

there are many different ways to consider what is “shortest”.

Normally, people go by counting chars. Obviously, that's idiotic. Cuz then long function names suffer. Such as WolframLang, lisps (except clojure)

rather, a function name should be considered as 1 char.

and among coding competition in WolframLang, they count shortest by counting the number of nodes in the code. eg the code is considered a tree, each atom in the code, is a count.

this is the most sensible for “shortest” code, in the WolframLang case.

but doesn't apply to C or others, cuz in these langs, you have statement, and syntax... they no form a tree, nor a unit. basically you just have char soup.

in C java python etc, you might count by tokens. yes. i think that'd be best.