-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse the current signature of Deno.copy
#3422
Comments
Hmm I wouldn't include I am personally okay with either ordering. I do want to point out that some actually argue the reason for Unix-y For references of fixing the order, Rust did the switch and had an interesting discussion here and related discussion |
Ah, actually, yeah - correct. I can see why Seeing such decisions not for the first time, I never understood why things like Deno (tools, languages and etc) that are based on something should partly inherit the lower-level. Even more in the case of Deno, where the ecosystem and community has nothing to do with Go or Rust - meaning that Deno is oriented to javascript/nodejs/typescript/web developers which may not be (and it's not required to be) familiar with such langs. Deno is providing familiar Web/nodejs/browser APIs. What if we have Hypothetically, It's like as package author (in nodejs realm) to export |
@tunnckoCore Much of Deno's internal code is ported from Go, including this copy function. The ordering of arguments is intentional - it's like strcpy in C. |
Yea, okay. But why web developers should accept something inherited from lower-level bases and write in a way that's not aligned to some logical, natural & intuitive way? Okay, they will, and most probably won't care why it's that way, and learn it and write it that way, but... And yea, okay, it's probably a bit religious thing. I'm in programming for a decade and I just don't getting why this is done. The logical sense and natural way of thinking while writing it is that you're copying A to B, and you're kind of supposed to write it in the same way/direction I'm always about the little things and details. They some times can drive me crazy and I'm sure I'm not the only one. |
I was overruled in this. We are changing the order of copy's args |
Awesome! <3 |
As seen here https://twitter.com/tunnckoCore/status/1200346772893323264
Currently
copy
signature isdst, src
which totally deviates from the standard one which is used in the rest of the API -copyFile
,readFile
,writeFile
are allsrc, dest
.And more or less the API is already following the years of experience in Node.js and is more or less similar thing. There's no
copy
in Nodejs and that's the only thing that is different in Deno. For me, it doesn't make sense to randomly follow some other language signature and more so one single method of a whole API.The text was updated successfully, but these errors were encountered: