Both have lots to do, and both are amazing cities. Barcelona arguably has more attractions within walking distance, if you will be based in the city centre. The beach in Nice is rocky, not sandy, so you may want to spend that extra day at the beach in Barcelona.