Pilates is a much younger practice, beginning in the mid-20th century by an athlete named Joseph Pilates. Plagued by asthma and ricketts as a child the "pilates method" sprang from his determination to strengthen his frail and sickly body. He called this method "The art of Contrology" or muscle control, his unique approach of using the mind to master the muscles (mind, body connection). Later interned during the first world war, he taught his method to other internees, whilst others became weak and died, they maintained their health and survived. Yoga originated in India more than 5,000 years ago. It has evolved over the centuries and cultures into many different types of yoga, using a mind, body, spirit connection. Yoga tends to use isometric movement which the muscles are worked by tension and stretching, where Pilates uses a more functional movement of the muscle in a controlled, fluid, precise way.
In both practices, you will gain strength, muscle, improved posture and flexibility. Pilates classes offer a total body workout but focus is on aligning the spine and strengthening the core, which is why it is favoured by many professional dancers and athletes. The exercises done in pilates classes involve movements to gain core and spine strength. In a yoga class, each posture is accompanied by a counter-posture to ensure you create balance in your body.
Breathing and concentration techniques are important to both yoga and pilates practices as helps with focus, concentration, relaxation, mental clarity and clearing of stale air from the lungs. Breathing in Pilates is usually breathing in through the nose and out through the mouth, where in yoga you are taught to breathe in through the mouth and out through the mouth. Often in yoga classes, there will be segments dedicated to breath work, called pranayama.
No doubt both practices are beneficial but the best way to decide would be to have in mind what you wish to achieve from your practice and to try them and see which one you enjoy as this would make it easier to stick to it. Remember not all Yoga and Pilates Classes are they same, some are more athletic, aimed at specific groups, for fitness, flexibilty or posture, so ask questions before you attend to find out if it is what you are looking for. Whichever you choose definitely beats the gym!