Valencia or Barcelona as software engineer?

Hello, I kinda would like to move to Spain but I think I would prefer Valencia over Barcelona but I noticed that salary offers in Valencia are quite low and amount of job offers in general is way less. Is it worth trying it? What are chances of finding something for like 40k a year.