Code Monkey home page Code Monkey logo

Comments (7)

kt3k avatar kt3k commented on July 19, 2024 2

There seem no consensus on this move.

Also the core team is against this change as the scope of implication of this change is too large and unclear.

Let's not do this.

from deno_std.

Leokuma avatar Leokuma commented on July 19, 2024

I'm slightly against it because to be consistent we would probably have to change many other functions all across Std such as regexp/escape to regexp/escapeRegexp, html/escape to html/escapeHtml, msgpack/encode to msgpack/encodeMsgpack, SemVer functions and so on. If we did that to the entire Std, I think it might feel too verbose in the end.

from deno_std.

andrewthauer avatar andrewthauer commented on July 19, 2024

I'm a bit indifferent about this, but have these additional considerations/points:

  • There is also dotenv & semver (possible others) that have similar method names in their respective modules. Does this mean we would also change these to be consistent?
  • Of the listed ones, I've found myself aliasing the import name anyways since parse/stringify is not very descriptive or sometimes collides with a function I've written or import.

from deno_std.

BlackAsLight avatar BlackAsLight commented on July 19, 2024

I'd say yes because one would need to alias the import names if importing from multiple packages.

from deno_std.

timreichen avatar timreichen commented on July 19, 2024

What would be the reason to do this?
I think putting the mod name into the function name is a slippery slope because one would also need to consider renaming other or even all exported functions of a module to be consistent. Putting the mod name into the function name seems redundant to me. Multiple same name imports can easily be solved with import aliases or * imports.

from deno_std.

iuioiua avatar iuioiua commented on July 19, 2024

I suggest the inverse: keep stringify() and parse() and remove words from APIs that could be seen as overly verbose (within reason). Most APIs within the codebase already adhere to this convention (see list below). However, as already pointed out, far more APIs would need to be adjusted to apply the issue's initial suggestion, which would be very disruptive. Using named imports in the appropriate cases is fine and, to me, is a non-issue.

List of all public function names in the codebase:

https://gist.github.com/kt3k/b387e7faf08ac7170384688261055e6a

from deno_std.

frou avatar frou commented on July 19, 2024

This seems kinda analogous to the Deno philosophy of using actual web platform APIs rather than inventing APIs.

In this case, the similar philosophy would be to encourage the use of the actual JavaScript language feature (import aliases) rather than inventing something to avoid using it.

from deno_std.

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.