None of them is better or worse - they are different. Machines allow you to have more isolated moves, which helps with developing very concrete muscles. On the other hand, free weights are very good because they will also develop lots of stabilizer muscles, which is very good for overall development. Therefore, it is best to combine both things in your training routine, and not just limit yourself to one thing.