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

style-guide: Include more style guidelines for Vala. #108

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

Diego-Ivan
Copy link
Contributor

  • Object initialization with properties
  • Styles for enumerations

* Object initialization with properties
* Styles for enumerations
@sonnyp
Copy link
Contributor

sonnyp commented Feb 21, 2024

Can you mention the preference between properties and methods?

ie window.title = "foo" versus window.set_title("foo")

@Diego-Ivan
Copy link
Contributor Author

It is mentioned in the parent section as a general preference. Though, from what I can tell from the demos, that is not the preferred style for Python. In that case I think it should also be added to the JavaScript subsection and removed as a general guideline.

@sonnyp
Copy link
Contributor

sonnyp commented Feb 21, 2024

Agree - could you take care of it in this PR? I'm not too convinced we should update the current style for Vala which currently seems to prefer getter/setters. WDYT?

@Diego-Ivan
Copy link
Contributor Author

Diego-Ivan commented Feb 21, 2024

Agree - could you take care of it in this PR?

Sure

I'm not too convinced we should update the current style for Vala which currently seems to prefer getter/setters. WDYT?

Not sure if that's the case. At least all of the demos that I've ported use properties instead of getter/setters. From a quick glance to most of them I could tell that just the first demos that were ported use getters/setters (i.e #99, #106, #107 and #83), but those also don't follow other guidelines such as string formatting and C-Style casting. I can take care of improving those demos and address other issues they have later, so I think that properties should be preferred over getters/setters for Vala IMO.

@sonnyp
Copy link
Contributor

sonnyp commented Feb 21, 2024

My mistake then 👍

@sonnyp sonnyp merged commit a55e79e into main Feb 21, 2024
1 check passed
@sonnyp sonnyp deleted the diego-ivan/vala-style branch February 21, 2024 22:01
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

Successfully merging this pull request may close these issues.

2 participants