Giter Club home page Giter Club logo

Comments (6)

tapir avatar tapir commented on May 19, 2024

I don't remember the reasoning behind it but it seems inconsistent with GLFW API.
Sometimes there are name collisions between funcs and structs and in those cases I might have done this to prevent the collision but this is not the case here.

My guess is that, fully spelled version is more Go-like and readable. If there is strong opinion to follow GFLW API strictly I'm not against it.

from glfw.

slimsag avatar slimsag commented on May 19, 2024

I see. Thanks for the prompt response!

If there is strong opinion to follow GFLW API strictly I'm not against it.

My main argument is that, unless there is a good reason, it is a needless place where someone who has used the C API (or any other language bindings, I guess) would possibly trip.

from glfw.

dmitshur avatar dmitshur commented on May 19, 2024

I think it's better just to keep the spelling the same as GLFW C library. Unless there are very pressing (more so than just better sounding name) reasons to do otherwise.

from glfw.

dmitshur avatar dmitshur commented on May 19, 2024

I will make a PR that changes the naming to be consistent with GLFW names. Let me know if there are any objections, but I think that's the best thing to do.

from glfw.

dmitshur avatar dmitshur commented on May 19, 2024

Just a thought,

someone who has used the C API (or any other language bindings, I guess) would possibly trip.

Isn't that unlikely since Go is statically typed, and there's godoc.org and likely autocompletion available? If someone tries to write window.SetCharCallback(...), they'll get an error:

./main.go:123: window.SetCharCallback undefined (type *glfw3.Window has no field or method SetCharCallback)

Then they'll go godoc.org and see that it's called something else. Or, more likely, they'll be looking at godoc.org to begin with (how else do they have a window, etc.), or their autocompletion will suggest aracterCallback when they type window.SetChar:

image

Nevertheless, I still believe sticking with original upstream API func names where possible is simpler/better. Even if resolving this inconsistency is easy, it's better if it doesn't exist in the first place. Also, porting code will be easier as there'll be less manual/irregular changes.

Making a PR to close this issue now.

from glfw.

slimsag avatar slimsag commented on May 19, 2024

Closing this as the PR has been merged into the devel_glfw3.1 branch.

from glfw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.