When should I use functional programming language and an imperative language?