veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.22k stars 223 forks source link

Rename constants to Go standard? #343

Closed ghost closed 5 years ago

ghost commented 6 years ago

Since all function bindings work differently from C's versions, why not go full-in and rename constants from LIKE_THIS to likeThis?

when in Rome, do as the Romans do

veeableful commented 6 years ago

I wanted to rename the constants to follow Go standard but there's constants like sdl.QUIT that will cause conflict with the function sdl.Quit if renamed. I seem to vaguely remember there's other constants that conflict with existing stuff when I was trying to rename them but I'll have to double-check again.

ghost commented 6 years ago

Maybe it should follow Go standards anyway even by renaming some of the constants/function? I don't have a feeling that these SDL2 bindings care about compatibility with C anyway, this repo has been changed drastically quite some times in the past, so this one should not be a problem either.

veeableful commented 6 years ago

I'll have a go at it again and figure out what needs to be done about the conflicts from there. I'll probably only make the change once Go has a proper versioning system though (which seems soon!) so there's less unexpected breaking changes.

I'll keep this issue open :grin:

ghost commented 6 years ago

I agree with the premise here. I have hardly needed to reference the SDL docs here given how simple SDL is, and It would definitely make development a bit easier. I also feel like it might be wise to try to implement so of the more common interfaces used in Go instead of those offered by SDL. For example, RWops is pretty confusing sometimes, so why not using io.ReadWriter or something similar? Most Gophers know how to use io.Read or io.Write right away, but it took me some time to try and figure out what to do with RWops. The implementations are similar enough that it wouldn't be hard to change.

zigo101 commented 5 years ago

Rename constants to Go standard is not good for googling the constants.

jclc commented 5 years ago

I don't think it's a good idea, you'd have to start guessing what some functions or constants are called if you have to rename them to avoid conflicts. This renaming scheme could also be inconsistent between different contributors and it's just a lot of extra work for very little benefit. Not to mention it's a breaking change...

veeableful commented 5 years ago

It seems based on the feedback we should keep the constants as they are which I also agree, mostly because I don't want to upset people. I also remember when I tried to do this, there was a conflict with either struct, constants, or functions having same name.

I'll be closing this issue then!