Click here to Skip to main content
15,886,019 members

Survey Results

A vendor makes a breaking change to an API you use. How should they let you know?

Survey period: 2 Sep 2019 to 9 Sep 2019

The more things change the more things stay the same. At least that's what we wish when it comes to critical APIs.

OptionVotes% 
By email53255.59
By tweet656.79
By a post on their social media page(s)949.82
By a notice in their documentation41743.57
By a prominent notice on their website / dev portal36438.04
Through a well-publicised and always up to date change-log41643.47
By a message returned by the API when an attempt is made to use affected functionality38540.23
APIs should never make breaking changes.40242.01
Other353.66
Respondents were allowed to choose more than one answer; totals may not add up to 100%



 
GeneralI think you underestimate tweets Pin
Lutosław6-Sep-19 8:52
Lutosław6-Sep-19 8:52 
GeneralTell me last week Bill! Pin
maze34-Sep-19 4:15
professionalmaze34-Sep-19 4:15 
GeneralLaughed So hard Pin
Abbas A. Ali3-Sep-19 2:14
professionalAbbas A. Ali3-Sep-19 2:14 
GeneralRe: Laughed So hard Pin
Sharath C V3-Sep-19 3:37
professionalSharath C V3-Sep-19 3:37 
Generalby changing major version number PinPopular
Andrea Simonassi2-Sep-19 22:16
Andrea Simonassi2-Sep-19 22:16 
GeneralIn a perfect world... Pin
Dominic Burford2-Sep-19 21:59
professionalDominic Burford2-Sep-19 21:59 
General9gag post Pin
iskSYS2-Sep-19 20:44
professionaliskSYS2-Sep-19 20:44 
GeneralDepends on the API Pin
Afzaal Ahmad Zeeshan2-Sep-19 9:30
professionalAfzaal Ahmad Zeeshan2-Sep-19 9:30 
GeneralRe: Depends on the API Pin
  Forogar  4-Sep-19 3:42
professional  Forogar  4-Sep-19 3:42 
GeneralAPIs should never make breaking changes Pin
Daniel Pfeffer2-Sep-19 1:59
professionalDaniel Pfeffer2-Sep-19 1:59 
GeneralRe: APIs should never make breaking changes Pin
kalberts2-Sep-19 21:55
kalberts2-Sep-19 21:55 
Functionality is extended over time, so how do you hanlde it? In the Windows API, you can find two distinctly different approaches:

If the original function was MyFunction(), the new one is claled MyFunctionEx(). The next version is MyFunctionExEx(), and so on. You can find MyFunctionExExExEx() - but I saw that many years ago, so maybe there is a MyFunctionExExExExEx() nowadays... These are really all new APIs, sharing part of the name. Usually, the parameter lists are fairly similar, but newer versions may have added more parameters at the end.

The other approach is to put all the parameters into a struct, which is the single parameter to the API. The first member of the struct is its size. So the API can be named MyFunction() through an arbitrary number of versions; revisions are usually distinguished by the size of the struct. (Sometimes, but certainly not always, one of the members is a version identifier; this allows new versions without adding new parameters.)

Guess which approach I prefer! The second one is fully backwards compatible; old programs will work perfectly fine. There are a couple of minor disadvantages: A new version may not need all the parameters/members used by previous versions, but cannot delete them from the struct; once a member is added, it must remain in the definition forever, even if no longer used. This doesn't occur very often, and the cost is minimal.

Second: Rather than just listing parameters in the call, the caller must copy every parameter into the struct. For the code size/speed, it doesn't matter too much: Essentially, the compiler is doing very much of the same when moving the parameter list into the stack frame. The difference is mostly in the source code, which may grow by a few lines. I think that is OK.

For maintenance of the API implementation, this approach is also a lot better: There is only one implementation of several versions of the API, rather than multiple method definitions with individual implementations. Unchanged functionality is coded once for several versions. For modified functionality, the old and new versions are available side-by-side, making it easy to verify the difference between them.

When the "parameter struct" approach is used, "breaking changes" ought to be completely unnecessary, especially if a version code member is included in the struct (as well as its size). So when I am in charge of defining APIs, I follow this philosophy whenever possible.
GeneralRe: APIs should never make breaking changes Pin
Daniel Pfeffer2-Sep-19 23:48
professionalDaniel Pfeffer2-Sep-19 23:48 
GeneralRe: APIs should never make breaking changes Pin
kalberts3-Sep-19 0:47
kalberts3-Sep-19 0:47 
GeneralOnly One Legitimate Way PinPopular
W Balboos, GHB2-Sep-19 0:48
W Balboos, GHB2-Sep-19 0:48 
GeneralA breaking change should cause a new api version / URL of the api PinPopular
Mike (Prof. Chuck)1-Sep-19 21:32
professionalMike (Prof. Chuck)1-Sep-19 21:32 
GeneralRe: A breaking change should cause a new api version / URL of the api Pin
GregoryW1-Sep-19 22:24
GregoryW1-Sep-19 22:24 
GeneralRe: A breaking change should cause a new api version / URL of the api Pin
Afzaal Ahmad Zeeshan2-Sep-19 9:32
professionalAfzaal Ahmad Zeeshan2-Sep-19 9:32 
GeneralRe: A breaking change should cause a new api version / URL of the api Pin
Ravi Bhavnani2-Sep-19 10:51
professionalRavi Bhavnani2-Sep-19 10:51 
GeneralRe: A breaking change should cause a new api version / URL of the api Pin
Marc Clifton4-Sep-19 2:43
mvaMarc Clifton4-Sep-19 2:43 
Generalall of the above? Pin
Slacker0071-Sep-19 20:55
professionalSlacker0071-Sep-19 20:55 
GeneralRe: all of the above? Pin
OriginalGriff2-Sep-19 0:14
mveOriginalGriff2-Sep-19 0:14 
GeneralRe: all of the above? Pin
Nathan Minier3-Sep-19 0:51
professionalNathan Minier3-Sep-19 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.