3 ms·
What do you honestly expect me to answer? That's kind of a moot point: the entire reason we have type systems in the first place is that they are partial, machi
by qsort 6y ago
What do you honestly expect me to answer? That's kind of a moot point: the entire reason we have type systems in the first place is that they are partial, machine-checkable proofs of correctness. The entire discussion is how to strike the best power/practicality balance while keeping the thing decidable. Keeping you from shooting yourself in the foot is exactly the type system's job.
Why do you even bother with static types if you seriously believe that?
- mikewarot 6y agoI believe in type systems as a way of knowing how data is encoded in memory. I don't expect them to somehow prevent me from writing that memory location more than once.
- badsectoracula 6y agoHave you ever used procedure Foo(constref Something: SomeType); instead of procedure Foo(var Something: SomeType); in Free Pascal? Both will pass the same stuff in memory (stack), but one has different semantics. Similarly const NiceFeature = $01; NeatFeature = $02; GoodFeature = $04; var Features: Byte; and {$packset 1} type Feature = (Nice, Neat, Good); var Features: set of Feature; would be stored the same way in memory but again, different semantics with the compiler helping you in the second case to avoid logic bugs (e.g. setting Features to an invalid value). These are cases where Free Pascal helps you from shooting yourself in the foot.
- mikewarot 6y agoI've never used ConstRef, nor $packset I can see the value of making sure you don't end up with invalid values.