Mastery of pragmatics allows children to change styles of speech, or linguistic codes, depending on their audience. Each code includes many aspects of language: tone, pronunciations, gestures, sentence length, idioms, vocabulary, and grammar.
Formal code (used in academic contexts), and Informal code (used with friends)
The use of informal or formal could also depend in area, as well as with whomever you are communicating to. One of my personal examples are as a military recruiter. As a military recruiter, we worked out of different schools; each school areas, and locations were different such as social status. Out of the four schools I recruited out of, some were high class; some middle, and some low. In each school I had different approaches with the kids, as wells as different approaches with the staff, and parents. In my higher class schools I had to use a much more formal code, due to higher class students, and having to relate to them. Not using the formal code, and approaching the children, as well as the parents in a informal way they would look down on me, and i wouldn't get much accomplish in that school. In my middle, and lower class schools I had much more of a different approach, and language used. It's like changing faces; in my much more lower class schools, I used different terms or possibly "slang" to relate to that targeted crowd, and staff.
A shorter breakdown, and good comparison of the two would be during a job interview. During a job interview a person would use more of an formal code, compared to a code used with peers. Communicating with peers, one would use an informal code; which is more laid back, and language, and terms used aren't as stressed. During the informal code a person could be themselves, and not have to stress to use correct pronunciations of words.