-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
gen: Improve identifier naming, quality of generated code #122
Conversation
Looks good so far. Much nicer. Don't know if people actually want lowercase class methods after underscore, but given we convert method names everywhere else to capitalized it seems like they should be capitalized too, even if they technically don't have to be. Thoughts? |
Open to that, trying to do this iteratively and I think this merits inclusion as-is while we iterate on naming scheme. |
IIRC the trailing underscores is something I saw done in PyObjC. I know it looks a little weird, but without it I think there can be selector conflicts where you have one with and one without an argument. |
Yeah we have an example in/with the webkit reload method |
Looks good. Fairly breaking change though. Should we cut a release before merging? |
@progrium As for the question of whether to capitalize the first letter of a method's name when dealing with a class method. Objective-C doesn't do it. Go does like camel case. But Go functions don't usually have an underscore to them. If I had to vote between these options:
I would probably pick NSEvent_alloc(). It seems like less work to have to write it out like this. As for cutting a release, please do so. The more release numbers there are the easier it to tell what changes have been made between releases. |
@tmc Thank you for the changes. I really like how the return type of a function is on the same line as the func statement. This is so much easier to read than how it was before. |
we're doing |
@tmc I can learn to live with that. |
Fixes #119, this omits trailing underscores from generated identifiers and adopts new more Go-idiomatic naming.