workbenchdev / demos

Demos of GNOME technologies - GTK, libadwaita, CSS, portals, ...
Creative Commons Zero v1.0 Universal
11 stars 15 forks source link

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

Closed Diego-Ivan closed 9 months ago

Diego-Ivan commented 9 months ago
sonnyp commented 9 months ago

Can you mention the preference between properties and methods?

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

Diego-Ivan commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

My mistake then :+1: