Fly-by-wire vs hydraulic systems
I was wondering which one was better and why. 

When done equally right they are equally good.

However, FBW makes it possibly to improve the quality of control beyond what's determined by the aerodynamics (e,g, making unstable airplanes stable, or making hard-to-fly airplanes easy to fly), and making the airplane robust against malfunctioning components (e.g. stuck actuators or control surfaces), or and adverse conditions (neutralizing turbulence, wind gust, etc).

Giving computers some authority also enables the computer to correct for human error (stalling, overloading, etc), hence improves safety as well.

Which one is safer? 

FBW is extremely hard to design, tune, test, and validate. Although the benefit of FBW could make the flight safer in a lot of ways, the risk that a premature FBW system could introduce is quite significant as well.

In general, although it is hard to state that an airplane equipped with FBW is inherently safer than one with conventional controls, and often times the reverse seemed true in history due to early bad track record of some FBW equipped airplanes, yet if an airplane is designed with safety as priority, FBW could offer a lot of benefits, again, if done right.