Frege on compositionality
A proposition has a sense, and the sense of the proposition has a corresponding thought. This is is how we communicate. But we don't attach a simple sign to each thought, otherwise we could only communicate as many thoughts as there were simple signs. So a proposition is composed of simple signs, each of which has a sense. We can put these simple signs together in as many ways as we like, so we can communicate new thoughts.
I do not believe that we can dispense with the sense of a name in logic; for a proposition must have a sense if it is to be useful. But a proposition consists of parts which must somehow contribute to the expression of the sense of the proposition: so they themselves must somehow have a sense. Take the proposition 'Etna is higher than Vesuvius'. This contains the name 'Etna', which occurs also in other propositions, e.g., in the proposition 'Etna is in Sicily'. The possibility of our understanding propositions which we have never heard before rests evidently on this, that we construct the sense of a proposition out of parts that correspond to the words. If we find the same word in two propositions, e.g., 'Etna', then we also recognize something common to the corresponding thoughts, something corresponding to this word. Without this, language in the proper sense would be impossible. We could indeed adopt the convention that certain signs were to express certain thoughts, like railway signals ('The track is clear'); but in this way we would always be restricted to a very narrow area, and we could not form a completely new proposition, one which would be understood by another person even though no special convention had been adopted beforehand for this case.