Passing parameters by reference Wouldn't it be better to always pass parameters by reference to avoid creating unnecessary copies? 

#include &lt;iostream&gt;

void deliver(const std::string&amp; message){
    std::cout &lt;&lt; message;
}

void say(const std::string message){
    std::cout &lt;&lt; message;
}

int main(){

    std::string message = "Hello World";

    deliver(message);    
    /* VS */
    say(message);


    return 0;
}


If not, why not?

Because I'm really starting to think references and pointers are useless.

I've been coding in C++ for a year and a half and never even once had to use a reference or pointer.

I've made countless programs and just finished making my biggest one ever, a 5000 lines game, divided in 28 separate files without using any of them.
Generally, the "order" of what you want to pass by looks like this for user-defined classes (ignoring C++11, for the moment):


Pass by const&amp;. This should be the default way of passing
parameters. 
Pass by &amp;. If you need to modify the parameter for whatever reason, then
you'll need to pass a reference or pointer to it. However, you should prefer references to pointers (explained below).
Pass by value. Unless you really need to make a copy of the value, there's not much reason to pass by value compared to passing by const&amp;. However, if you're going to be making a copy of the parameter in the function body either way, then you may want to simply pass by value in the first place.


For a good example of when explicit pass by value makes sense, see the copy-and-swap idiom.

However, this is "muddied" by a number of considerations:


Is the class small? Does it only encapsulate a few (simple) data members? For example, something like a std::pair. In this case, it may actually be better to just pass by value.
For fundamental data types (int, char, double, and so on), it's better to simply pass by value. There's no performance benefit to passing by reference, and in fact, it can often be slower.


With move semantics in C++11, this advice changes considerably. We now have an extra possibility: pass by rvalue reference (&amp;&amp;). Passing by value and using std::move then becomes a distinct possibility, especially when we want to be explicit about ownership. You may want to read this Stackoverflow post for a bit more information. Dave Abrahms (one of the principle authors of boost) has also written about this topic.

I haven't mentioned pointers at all until now. Really, the only difference between references and pointers is that references cannot be null. Sticking to references means that you eliminate a whole host of possible bugs to do with dereferencing null pointers. In modern C++, passing by pointer is rare. In fact, it should always be wrapped up in a stack allocated class that deals with the ownership semantics and eliminates the possibility of resource leaks (say, unique_ptr or shared_ptr). These are then passed by one of the ways mentioned above.

Finally, one must use pass by reference or (smart) pointer when using dynamic dispatch - that is, when dealing with inheritance.

This post may be far more than you ever wanted to know, but the answer is effectively "it depends". Deciding how to pass a parameter requires some actual thought, but boils down to some (subset) of the following considerations:


Is it a primitive data type or a class encapsulating only a few primitive datatypes?
Does it encapsulate some resource? If so, after the call, who do I want to own the resource?
Do I need to modify it in the function I'm passing it to? If so, can I rewrite the function in some way so that I don't have to, as this often makes it more difficult to understand the program.
Is inheritance involved? Do I want to be able to pass a derived class where a base class parameter is involved?
Am I going to simply make a copy of the parameter in the function body? If so, perhaps passing by value is the best idea (again, see the copy and swap idiom).
Should I provide overloads so I can have the option of passing a const reference vs passing an rvalue reference?
What will give me the best performance? What is easiest to reason about and maintain?


(Note: I realise this isn't really a code review as such. If this is too off topic, feel free to remove it).