Question: I was going through the difference between inheritance and composition. Everyone has praised composition over inheritance, so questions is how do we make choice ? Also if we didn't use inheritance at all then what are we going to miss as per OOP principal ?

Answer: 
It really comes down to how your data is structured. Inheritance is used for "is a" relationships while composition is used for "has a" relationships. 

For example, if you were look at cars. 

Inheritance: you would have 'Toyota', 'Honda', 'BMW' under 'Car' because they are types of cars. 

Composition: you would have 'Engine', 'Wheels', 'Door' under 'Car' because they are parts that make up the car. 

'Toyota', 'Honda', 'BMW' aren't parts of a car same way 'Engine', 'Wheels', 'Door' aren't types of cars.
You can google thousands articles about it. So if you want to understand more deeply, google and learn, we dont have to reinvent wheel here.

If you want short explanation what `composition over inheritance` means, it basically says - do not overengineer your solution with some super complex inheritance. If you develop something and you see some clear advantages of inheritance and you cant achieve the same with composition, you are free to use inheritance. If you dont see it or you can achieve the same with composition, use composition.