Nugget 25: Code Representation and Information Density
The previous two Nuggets ( N23 , N24 ) explored how, Primary Constructor, and Comments have a direct influence in Token Economy Management (TEM). These examples, show that reducing code verbosity shift TEM in our favor. However, consider the following: // Represents a customer identifier that must match our internal // regular expression format public string CustId { get; set; } And compare with: public CustomerId Id { get; set; } This is not only a reduction of tokens. There is a transfer of information from natural language documentation into the programming language type system. There is semantics in the type. This is Typographic Semantics . The type CustomerId now encapsulates validation rules. There is a caveat in this because the type must actually enforce the rules described in the documentation, and the LLM must have access to its definition when needed. However, TEM benefits from this approach. From this particular scenario, it becomes evident that we ...