[erlang-questions] On OTP rand module difference between OTP 19 and OTP 20

Loïc Hoguin essen@REDACTED
Thu Aug 31 17:35:45 CEST 2017


On 08/31/2017 05:32 PM, Attila Rajmund Nohl wrote:
> 2017-08-31 17:27 GMT+02:00 Loïc Hoguin <essen@REDACTED>:
>> On 08/31/2017 05:13 PM, Attila Rajmund Nohl wrote:
>>>
>>> 2017-08-31 15:42 GMT+02:00 Loïc Hoguin <essen@REDACTED>:
> [...]
>>>> I certainly hope this is not the general policy for OTP. We program
>>>> against
>>>> the documentation. The documentation *is* our reality.
>>>
>>>
>>> I disagree. Take this example:
>>> https://lwn.net/SubscriberLink/732420/9b9f8f2825f1877f/ The printk()
>>> function in the Linux kernel was documented to print new logs to new
>>> lines unless the KERN_CONT option was passed. In reality it didn't
>>> always started new lines and people expected (maybe even relied on)
>>> this - and when the code was updated to match the documentation, they
>>> were genuinely surprised when their code was broken.
>>
>>
>> This story is not about people following the documentation and then have the
>> documentation be "fixed" under their feet without them noticing, it is in
>> fact the complete opposite.
> 
> The moral of the story: people are programming against
> behavior/implementation, not documentation. In these cases fixing the
> implementation instead of the documentation has very real possibility
> of breaking existing programs. Of course, one can tell its users that
> "it's your fault you haven't followed the documentation!" but it
> doesn't necessarily make those users happy...

Maybe in the Linux kernel. Outside, where there is such a thing as 
documentation (comments are not documentation), if the code behaves 
differently than the documentation, you open a ticket... And in that 
case, yes, for a limited time, you will program against the behavior and 
not against the documentation. But it's the exception, not the rule.

-- 
Loïc Hoguin
https://ninenines.eu



More information about the erlang-questions mailing list