@belisarius is right to point out that the frequency strongly depends on the programming style. The answer reported above are mostly applied for .m file (package) file, where there are many comments (* *)
, many strings ""
, such as in this code.
(* Mathematica Package *)
(* Created by the Wolfram Workbench 11-Jan-2010 *)
(*
TODO
Way to pass down options with GenerateCode
Support for unknown expressions passed into CForm
*)
BeginPackage["SymbolicC`"]
ToCCodeString::usage = "ToCCodeString[ symbolicC] generates a string of C code from a symbolic C expression."
That's why, the string "
and *
is really frequent in packages. But I want to check the character frequency in normal Mathematica example, not in packages, such as demonstrations, or fast-code example. This is the results from many featured demonstrations in Wolfram Demonstration project.
ALL LANGUAGES
Source: http://xahlee.info/comp/computer_language_char_distribution.html
MATHEMATICA
Discussions:
The ,
and [
, ]
is the most frequent character. Due to the function,
argument style [argu1, argu2, argu3]
0, 1, 2
is mainly used in Manipulate[...,{x,0,n}]
. In application demonstrations, number is very frequent.
{}
is really important for list, and in Manipulate[expr,{u,umin,umax}]
The quote "
are mainly used for interface such as Row
, Style
, Text
, Labels
, Options
, Appearances
...
=
is important (Set
)
/
and .
are used in ReplaceAll
/.
;
is less frequent
>
is more frequent than <
, used in :>
, ->
_
and :
are mainly used for function declaration but less frequent. In daily Mathematica use, no need to delaire new function :)
Surprisingly, @
, &
, #
are really important in functional programming, but less frequent in demonstrations.
Remap keyboard
Finally, I will remap my keyboard for the [],{}
using with my thumb, index finger in Mathematica because these are the most used characters. For numbers, I will use the numeric keyboard because pressing 0
with right pinky finger is painful.
f[x]
vs.f@x
vsx // f
,or the improbablex~f~Sequence[ ]
,{a, b}
vs.List[a, b]
etc). So you first need your codebase $\endgroup$