Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:58:16+00:00 2026-05-24T19:58:16+00:00

My question is language transcendent, I’ve often found prototypes of copy functions define parameters

  • 0

My question is language transcendent, I’ve often found prototypes of “copy” functions define parameters in the order: argument1:”destination” then argument2:”source”.
It is the case of memcpy for example in C. But it is NOT the case of file copy on bash ! You say, e.g.: “$ cp file file2” where file2 is the new file.
Which makes much more sense to me, we always say “copy that text here please” and not “copy here that text” which is Yoda-esque.

So the true question is: a good API should use what form (order) ? and maybe another subsidiary question: what form is everybody expecting, if there is any ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:58:17+00:00Added an answer on May 24, 2026 at 7:58 pm

    I expect source to come first, and destination later.

    If you can disambiguate in the language, it would be better. For example, in a OO language:

    source.copyTo(destination);
    

    In a language with named parameters:

    copy(source: s, destination: d);
    

    The important thing is to make clear what’s going on for people reading the code. Code is more often read than it’s written.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is language agnostic but I am a C# guy so I use
An idle question on language design, see Does C# have a right hand if
This is sort of a best language question, but hopefully with enough of a
I have a language-agnostic question about an algorithm. This comes from a (probably simple)
Question: I can get the SQL Server database language by querying: SELECT @@language And
This question is for the java language in particular. I understand that there is
Question: I want code for: syntax highlighting (of programming languages) Language: C# or assembly
Question over here is are design patterns specific to a programming language or technology,
EDIT: This question is more about language engineering than C++ itself. I used C++
I asked a question earlier about which language to use for an AI prototype.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.