[Github-comments] [geany] Geany hangs on saving a certain file (reproducible) (#815)

elextr notifications at xxxxx
Wed Dec 16 09:05:58 UTC 2015


> As for changing the API, the usual solution would be to add the new parameter and provide a default argument for it (and the default would be the "normal" behaviour, so other plugins don't even notice that there is something new). If I am not mistaken, Geany is implemented in C, and C doesn't have the feature of default arguments builtin, but there are several ways to achieve this functionality in C too.

Yes, C++ overloaded functions would be a nice alternative too, but unfortunately ....

> so IMO, the best (and maybe easiest) way would be to extend the API.

So long as one of the options of the new API matches the semantics of the old API then the old API could just call the new one with the appropriate options.  There is a common idiom of having something like "save", "save_2", "save_3" etc when new interfaces are needed and the old one is to be left unchanged.

The thing is to design an API and semantics that minimises the risk of introducing bugs in the normal save operations.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/815#issuecomment-165039486
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151216/5b982dc0/attachment.html>


More information about the Github-comments mailing list