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

clear naming convention #3

Open
wilzbach opened this issue Jun 23, 2016 · 3 comments
Open

clear naming convention #3

wilzbach opened this issue Jun 23, 2016 · 3 comments

Comments

@wilzbach
Copy link

I really appreciate the effort to move on with D, make a clear cut and built upon.
However when you want to improve Phobos, please bare in mind that naming is very, very important. Many people (myself) included dislike Phobos for that.

I just saw that you mix CamelCase with under_score in Watt :S

import watt.io.streams : OutputFileStream, InputFileStream;
import watt.varargs : va_list, va_start, va_end;

Other thinks to take into consideration:

  • clear distinction for laziness (split vs. splitter, but chain)
  • clear type of type of verb for functions (std.range: drop, but transposed)
  • intuitive to other languages (e.g. setUnion doesn't filter for duplicates)
  • no synonyms in an API (in std.algorithm there is "isSorted isStrictlyMonotonic ordered strictlyOrdered" e.g. the monotonic is weird in here, also the functions could be combined)
  • ...

There is also a wiki entry: http://wiki.dlang.org/Naming_conventions

@bhelyer
Copy link
Member

bhelyer commented Jun 23, 2016

Thank you for your interest! We agree that consistency is important. Watt is very much in flux right now -- and IIRC at the moment certain things are named the way they are because we're still bootstrapping with D. We're currently self-hosting, so later down the road that won't be an issue, and the library will be more stable and you'll see plenty of changes towards consistency and layout -- they happen fairly regularly anyway, as people are motivated.

All that said, pull requests are fine, but they may take a little while to get processed as everything has to be verified working/fixed with the changes.

Thanks again!

@Dav1dde
Copy link
Member

Dav1dde commented Jun 24, 2016

Just to add on the naming of:

import watt.varargs : va_list, va_start, va_end;

That's simply because it follows the C naming for the very exact thing. I agree about the naming consistency overall, but very well known symbols which are coming from C should just be named the same. And the good part is, everyone will instantly know that these names are special since they don't follow the usual naming convention.

@Wallbraker
Copy link
Member

I agree we should have good consistent naming in Watt.

Now is the time for such renaming/refactoring to be done. We would love for you to write up a small Markdown document on naming for Watt (either in this repo or the Website) . We currently only have a style guide here http://www.volt-lang.org/doc/code-style.html .

The varargs stuff is mostly that way because thats how they work in Phobos. We should move them to a runtime module instead. As outline here https://trello.com/c/ovGl5Azj/152-refactor-runtime

Cheers, Jakob.

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

4 participants