Which one of the following sentences is better?
When we came out of the restaurant it was half past eleven.
or
When we had come out of the restaurant it was half past eleven.
It's Not about better, its about the context. Vandana you must be from INDIA and must be using the language where it can be more easily Differentiate between past simple (Bhutkal) and past perfect (Purna Bhutkal). Now coming to your sentences
1) When we came out of the restaurant it was half past eleven.
Simple past : gives idea about when half past eleven you came out of the restaurant.
2) When we had come out of the restaurant it was half past eleven.
Past Perfect: It gives idea when half past eleven you ware already out of the restaurant. It mean you were already out of the restaurant when half past eleven.
Both meaning are slightly similar but gives different idea about actions.