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

Improving naming of fasm.parser.parse_fasm_X API #36

Open
HackerFoo opened this issue Dec 9, 2020 · 0 comments
Open

Improving naming of fasm.parser.parse_fasm_X API #36

HackerFoo opened this issue Dec 9, 2020 · 0 comments

Comments

@HackerFoo
Copy link
Contributor

Context from #28 (comment):

@mithro mithro 17 hours ago Member

[optional] I wonder if these should be fasm.parser.filename and fasm.parser.string. Then maybe you can do either;

import fasm.parser
fasm.parser.filename(XXXX)

or

from fasm.parser import filename as fasm_parser_filename

Currently this "stutters" a bit.

From https://blog.golang.org/package-names

Avoid stutter. Since client code uses the package name as a prefix when referring to the package contents, the names for those contents need not repeat the package name. The HTTP server provided by the http package is called Server, not HTTPServer. Client code refers to this type as http.Server, so there is no ambiguity.

See also https://michaelwhatcott.com/go-code-that-stutters/ and rust-lang/api-guidelines#66
@HackerFoo HackerFoo 17 hours ago Author Member

I like fasm.parse.from_X, but it can make things like parse.available and parse.implementation slightly awkward.

fasm.parser.from_X isn't bad.
@HackerFoo HackerFoo 14 hours ago Author Member

I'm going to keep the same names for now to make it clear that they are replacements for the old code.
@mithro mithro 2 hours ago Member

Please create a follow up GitHub issue to track cleaning up these names then.

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