Thoughts on versioning

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Oct 28 14:30:42 UTC 2021


On Thursday, 28 October 2021 at 14:01:57 UTC, Adam D Ruppe wrote:
> On Thursday, 28 October 2021 at 13:34:14 UTC, Ola Fosheim 
> Grøstad wrote:
>> "can" is one thing, but can you do it in a way with that is 
>> undetectable?
>
> No, but I also don't think that matters. You need to pick a new 
> version so then you expect things to be different.

Hm, not sure if I follow... For this to work well I think you 
would need to have a different culture and a type system that 
focus more on abstract interfaces.

When programmers write code for a particular 
language/library/runtime/compiler they tend to make assumptions, 
that they probably shouldn't have. Like implementation specific 
aspects of how the runtime behaves or how classes are laid out 
and serialized.

Let's say you have a file cache package that assumes V1 file 
objects. It does use templated parameters so it actually accepts 
anything (duck typing) with the right interface. In the docs it 
says you have to always use objects from the standard lib. But 
there is no actual type checking that forces it to be V1, so the 
outcome could be unpredictable when handed V7 objects, as the 
package is tailored to V1 (making assumptions that are specific 
to V1).

One might claim that people should not write ugly code, but most 
applications of scale does contain ugly code.



More information about the Digitalmars-d mailing list