HACKER Q&A
📣 kizer

Could domain-specific/business logic code be clearer without strings?


Would aiming to avoid string literals or strings in general, if possible, end up producing more expressive data structures and more readable code?


  👤 lioeters Accepted Answer ✓
One example that comes to mind is the "string by default" approach of HTML, Markdown, etc.

Another example would be "no strings at all", like WebAssembly with only integers and floats.

I'd say neither fits the description of enabling expressive data structures or being more readable.


👤 whb07
Could use expressive types to model business logic. Not the weak types you see like "int customerId" in C#/Java/generic-oop language. Scott Wlaschin does a good job at it using F# check him out

👤 gt2
Example? Other than avoiding magic strings by swapping them for upper-cased vars, I'd love to see what you mean because it sounds interesting.