What does it mean when `Ex` is added to a function/method name?

前端 未结 4 784
感情败类
感情败类 2021-02-05 07:31

I don\'t work with the Windows API much, but I\'ve seen it used there as well as occasionally in a codebase here at work.

相关标签:
4条回答
  • 2021-02-05 07:50

    Not sure but I guess it stands for extended.

    0 讨论(0)
  • 2021-02-05 07:54

    It's a naming convention that simply indicates the function is an extended version of an original.

    0 讨论(0)
  • 2021-02-05 08:07

    It's usually done as a way of changing the parameters to a function in an API without breaking existing client code. Old code can continue to use the previous version, while new code can take advantage of the new features offered by the Ex version.

    0 讨论(0)
  • 2021-02-05 08:13

    Yup, they wanted to improve (Extend) the API and keep a similar name so it was likely that the programmer would move to the new version.

    Notable is GetVersionEx() to get the Windows version, pretty painful for a while with a nasty chicken-and-egg problem.

    The record keeper is the National Language Support team who have several ExEx versions, like EnumCalendarInfoExEx. Unsurprising, culture moves even faster than software. No ExExEx as of yet.

    0 讨论(0)
提交回复
热议问题