Giter Site home page Giter Site logo

Comments (4)

matryer avatar matryer commented on September 28, 2024

Thanks for that feedback. Some good points.

Mat

Sent from my iPhone

On 22 Nov 2013, at 20:20, nvcnvn [email protected] wrote:

I'm going to use Goweb for the next project, after reading the API document I feel Goweb use too many ...interface{} for the function agrs. I give some flexible but sometime give some confusions.
Why don't we just provide the most general API for the function?
For example, goweb.Map should be:

func Map(fn func(c context.Context) error, path string, methods []string, matchers []handlers.MatcherFunc) (handlers.Handler, error)
or goweb.MapController should be just:

func MapController(controller interface{}, path string) error
I know this is not that importan and hard to change because you will break your old code but it still worth something! I bet that many of us love Go because the simplicity and clarity (by the lack of function overloading and something else)

Thanks for the team because you provide a great package!


Reply to this email directly or view it on GitHub.

from goweb.

matryer avatar matryer commented on September 28, 2024

You can tell we came from Ruby and JavaScript and not C++ can't you :D

from goweb.

matryer avatar matryer commented on September 28, 2024

Do you think adding strict versions would be a pointless thing?

I.e.

goweb.Map(args ...interface{}) (handlers.Handler, error)

AND
goweb.MapS(fn func(c context.Context) error, path string, methods []string, matchers []handlers.MatcherFunc) (handlers.Handler, error)

The Map function would just figure out how to call MapS but hard-corers would be able to just use the MapS function directly?

from goweb.

nvcnvn avatar nvcnvn commented on September 28, 2024

I think a strict version should be good for the near future.
But in the far future, remove all the switch case block for determine the type should cleaner and shorten some of your code, do you think so?

P/s:
If there is a strict version, you should use it in your examples/tutorials (person like me will look at them first :D)

from goweb.

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.