Giter Site home page Giter Site logo

Comments (5)

ikokostya avatar ikokostya commented on May 21, 2024

all arguments MUST be explicitly cast

Operator == introduces implicit casts.

from mapsapi-codestyle.

twirl avatar twirl commented on May 21, 2024

Follow the logic:
(a) all parameters must be explicitly cast before being used in any conditions;
(b) so there must be no difference whether you use == or === in conditions, since casting is already done;
(c) why using one more = sign?

from mapsapi-codestyle.

dmikis avatar dmikis commented on May 21, 2024

You guys have core disagreement here: we never cast function arguments to types declared in documentation. We may normalise the arguments (i.e., remove optionals or assign defaults to them). Other than that we rely on user follows described function contract.

Yes, it may be bad for APIs such as Maps API, but it works pretty well for us.

from mapsapi-codestyle.

twirl avatar twirl commented on May 21, 2024

You are saying that you don't use polymorphic functions. Either state this in a codestyle or provide guidance what to do in such case. Personally, I simply don't understand then why using === at all if you know all types at runtime (with possible exclusion for null, since it's an object — known language bug)/

from mapsapi-codestyle.

vtambourine avatar vtambourine commented on May 21, 2024

(c) why using one more = sign?

To avoid possible error and misuse.

from mapsapi-codestyle.

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.