It can be harmful for the computer, you should always shutdown using the shutdown menu, or configure the power button to perform a graceful shutdown. Holding the power button down may cause data corruption and in worse cases prevent the computer from starting.