Comments (7)
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.
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.
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.
I'd say yes because one would need to alias the import names if importing from multiple packages.
from deno_std.
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.
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.
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)
- Check the usage of TextDecoder
- Rename the repository to `std` HOT 1
- question(collections): `intersect()` function name differ from Set method name HOT 1
- docs: more thoroughly document `expect.toThrow()` behavior HOT 2
- feat request: add a pluralize word function HOT 4
- feat request: expose publicly `capitalizeWord` (or similar) HOT 9
- http/file-server, media_types: new addition `application/mp4` to mime db overrides `video/mp4` and breaks some net players HOT 7
- isGlob and globToRegExp do not support windows paths HOT 4
- feat req: add enums for WebSocket status HOT 1
- feat req (html): add a validator for custom name elements ? HOT 4
- to-do: add doc check for JSDoc tags that aren't needed
- to-do(yaml): document different YAML schemas
- proposal: remove `examplePath` option from `@std/dotenv/load`
- proposal: remove `defaultPath` from `@std/dotenv/load`
- Performance: `levenshteinDistance` becomes extremely slow for large edit distances HOT 5
- The windows logic in std/path breaks in DNT HOT 2
- tracking: support iterables in `@std/collections` APIs
- to-do: review custom error classes
- suggestion: add CBOR encoding/decoding HOT 1
- to-do: fix unstable notices
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_std.