Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve function naming consistency. #50

Closed
vitaut opened this issue Jun 28, 2014 · 2 comments
Closed

Improve function naming consistency. #50

vitaut opened this issue Jun 28, 2014 · 2 comments

Comments

@vitaut
Copy link
Contributor

vitaut commented Jun 28, 2014

Currently there is an inconsistency in function naming. Some functions are named according to Google C++ Style Guide:

  • Format
  • Print
  • Clear
  • ReportSystemError
    ...

Other follow standard library conventions:

  • c_str
  • str
  • clear
  • resize
  • reserve
  • printf
  • sprintf
    ...

The names should be unified before the version 1.0 of the API is released. This is pretty arbitrary, but it's probably better to follow standard library conventions for public API for consistency with printf and because its done already for most functions.

@vitaut
Copy link
Contributor Author

vitaut commented Jun 29, 2014

To minimize the number of API changes, it might be useful to consider simplification of a common use case of formatting into an std::string here too. Currently it requires two function calls:

str(Format("{}", 42));

Ideally it should require a single function call. Possible ways to do this:

  1. Make format return std::string.
  2. Add another method (strformat) returning std::string.

@vitaut
Copy link
Contributor Author

vitaut commented Jul 2, 2014

Fixed in version 0.9.0.

@vitaut vitaut closed this as completed Jul 2, 2014
vitaut added a commit that referenced this issue Jul 25, 2014
vitaut added a commit that referenced this issue Jul 26, 2014
vitaut added a commit that referenced this issue Jul 27, 2014
vitaut added a commit that referenced this issue Jul 27, 2014
vitaut added a commit that referenced this issue Jul 27, 2014
@vitaut vitaut reopened this Jul 27, 2014
vitaut added a commit that referenced this issue Jul 28, 2014
@vitaut vitaut closed this as completed in d8b9f41 Jul 29, 2014
vitaut added a commit that referenced this issue Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant