Posts

Showing posts from November, 2026

Nugget 25: Code Representation and Information Density

Image
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 ...

Nugget 24: Token Economy Management — Comments Are Not Free

Image
Expanding, just a little, on Nugget 23 , where the fundamental idea is "Token Economy Management" (TEM), I found something literally disturbing: The Cost of Good Habits → Comments. Computer science professors have always told us that someone else will need to read our code and that, after we have departed, other software engineers and developers will look at what we did. Let them know with comments. For the following test, the file IEnumerator from System.Collections was selected. TEM was analyzed. These are the findings: ================================================== Traditional Comments vs. No Comments ================================================== Commented Function Token Count:    295 Non-Commented Token Count:            65 Tokens Saved:                                  230 Context Window Reduction:          77.97% ===========...