TLDR: watch whichever you feel like watching.
You can actually watch it in any order. Having seen both of them, except for the same protagonist they don't have any link between them.
Handa-kun is an anime in which the protagonist is a high school student. This one leans highly towards comedy than a slice of life. But it's definitely fun to watch.
Barakamon is more the typical slice of life anime with bits and pieces of comedy, it has a sense of purpose unlike Handa-kun which is just everyday events. Here Handa-kun is grown-up and is trying to find some inspiration.