enum Format

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri Jan 12 05:36:25 UTC 2024


On 12/01/2024 6:28 PM, Walter Bright wrote:
> On 1/11/2024 11:50 AM, Timon Gehr wrote:
>> On 1/11/24 03:21, Walter Bright wrote:
>>> As for it being a required feature of string interpolation to do this 
>>> processing at compile time, that's a nice feature, not a must have.
>>
>> As far as I am concerned it is a must-have. For example, this is what 
>> prevents the SQL injection attack, it's a safety guarantee.
> 
> Why does compile time make it a guarantee and runtime not?
> 
> We do array bounds checking at runtime.

Where possible we absolutely should not be.

Making things crash at runtime, because the compiler did not apply the 
knowledge it has is just ridiculous.

Imagine going to ``http://google.com/itsacrash`` and crashing Google.

Or pressing a button too fast on an airplane and suddenly the fuel pumps 
turn off and then refuse to turn back on.

Instead of the compiler catching clearly bad logic that it has a full 
understanding of, you're disrupting service and making people lose 
money. This is not a good thing.


More information about the Digitalmars-d mailing list