mattn / go-gtk

Go binding for GTK
http://mattn.github.com/go-gtk
BSD 3-Clause "New" or "Revised" License
2.11k stars 248 forks source link

New Developer documentation #401

Open yarbelk opened 5 years ago

yarbelk commented 5 years ago

I would like it if you could give some good advice to people who wish to contribute. There is deep magic in the gobject and GTK libraries that is not clear to me (and probably many golang developers). The team has obviously figured out how to deal with it; but lets say I want to help drive the % up, and possibly add libhandy bindings: what do I need to know? What are the pitfalls I'm going to screw up? how do I coherently test this code?

This could be a wall of prose, or even as a beginning, point form with links to cannonical examples in what you've already done. There is enough code here that I cannot easilly find the 'good' example to copy.

and i really, really, want to help

mattn commented 5 years ago

At the first, I must understand what is current issue.

yarbelk commented 5 years ago

As a non-C developer, I would like a canonical example of F(gtk_func_in_C) -> 'gtk_func_in_go' that is well documented, and explains how they differ. In this way, I can make PRs to this repo to add in missing functionality. I don't really know what I don't know when it comes to how badly I can screw up the memory model, and a little bit of pointing in the right direction in terms of convention and testing would go long way.

The Go APIs are clear enough(I think as I struggle with any GUI, be it css/html, or gtk, or qt) because I think in pipes and data streams).

yarbelk commented 5 years ago

In another way: What is the best piece of code in this repository graded on: Clarity, demonstrating conventions and documentation.

For comparison: when I'm giving an example from the standard library of golang, I usually link to https://github.com/golang/go/blob/master/src/sort/sort.go which demonstrates one non-java like usage of an interface, the different between exported and not and how they interact, and how to comment code. (and expert level use of the underlying primitives in golang)