Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: "Chí-Thanh Christopher Nguyễn" <chithanh@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] versionator.eclass: Add tests for parameter counts
Date: Sun, 24 Jul 2016 10:18:22
Message-Id: 20160724121756.1ccc7276.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] versionator.eclass: Add tests for parameter counts by "Chí-Thanh Christopher Nguyễn"
1 On Sun, 24 Jul 2016 10:17:24 +0200
2 Chí-Thanh Christopher Nguyễn <chithanh@g.o> wrote:
3
4 > Michał Górny schrieb:
5 > > So, to summarize we shouldn't fix existing code because people did
6 > > assume accepting invalid parameters was fine.
7 >
8 > You are changing the API of versionator.eclass, even if it was unintentional API.
9
10 There is no such thing as 'unintentional API'. API is what's described.
11 If you rely on internals, random undefined behaviors or whatever, it's
12 not a part of the API.
13
14 Yes, I know that most of Gentoo developers are bright enough to assume
15 'if it is not explicitly forbidden in words I can't find a way to bend
16 to pretend it's allowed anyway, it's allowed even if it doesn't make
17 any sense'. But that's a social problem that could easily solved by more
18 proactive retirements, and not a good API design point.
19
20 > > Then ebuilds will fail just the same
21 >
22 > No. Before, ebuilds would maybe display an upgrading message when they
23 > shouldn't, or vice versa. Now the eclass dies on them.
24
25 So what's the alternative? Design another eclass where ebuilds will
26 fail just the same because people will ignore the more explicit
27 requirement just the same as they do ignore the API?
28
29 The problem is not 'there is a valid case to pass useless parameters
30 to the function'. The problem is 'I make an invalid assumption about
31 what will happen based on my limited knowledge which I believe is
32 more correct than people who wrote package managers'.
33
34 --
35 Best regards,
36 Michał Górny
37 <http://dev.gentoo.org/~mgorny/>

Replies