ahgilak / deno_gi

Deno port of Gnome libraries (such as Gtk).
https://deno.land/x/deno_gi
32 stars 2 forks source link

Consider using `g_type_name` instead of `g_base_info_get_name` when possible #18

Closed vixalien closed 4 months ago

vixalien commented 10 months ago

It is a better name for the .name properties (the one that gets logged in the console.) This is very helpful in debugging, particular in the early stages of the project.

The GObject.type_name produces more consistent and better names for classes and methods, unlike GI.BaseInfo.get_name, which only returns the name of the type without including the namespace info.

Another alternative would be just using namespace + name (factoring in parent types). Compare:

GObject.type_name GI.BaseInfo.get_name namespace + name
GtkWidget Widget Gtk.Widget
gtk_widget_init_template init_template Gtk.Widget.init_template
GObject Object GObject.Object