3 ms·
Sentence 1: The C compiler can help you catch implicit conversion errors. Sentence 2: Catching implicit conversion errors is idealistic, pedantic, and prevents
by throwaway894345 5mo ago
Sentence 1: The C compiler can help you catch implicit conversion errors.
Sentence 2: Catching implicit conversion errors is idealistic, pedantic, and prevents you from doing your job.
Great stuff. 10/10. No notes.
- uecker 5mo agoThe point is that you can get the warnings without having to deal with a strict type system all the time.
- throwaway894345 5mo agoWarnings are just noise, so there's no point in printing them--they will be ignored (maybe not when there is a singular warning, but if warnings are allowed to accumulate beyond some manageable threshold). If a warning is worth printing, it should be treated as an error, and if you treat it as an error, you now are "strict" by definition.
- uecker 5mo agoAny reasonably good C code I ever worked with aimed to be warning free. But yes, if you can also make it an error. The flexibility is important though.
- throwaway894345 5mo agoRegardless of whether you're "aiming for the code to be warning free" or telling the compiler to turn the warning into an error, you will make the implicit cast explicit and move on with your day. You've already said you should use your tools to flag these errors and that aiming to be warning free is a good thing, so I don't understand where we disagree, especially when making implicit casts explicit costs a single-digit number of keystrokes.
- uecker 5mo agoI was disagreeing with the statement that a "serious" language needs to have this hard-coded. think the C model where you can have the strictness if one wants to, but one can also opt-out is better.