A practical introduction to functional programming (2013)
The thing with functional languages is that most imperative languages can "do functional things", but not vice versa.For example, many algorithms are beautiful when expressed in a recursive manner (Fibonacci, for example) , and pretty much all languages permit one to do recursion (even old fashioned C).But many algorithms are much more elegant when expressed through for loops. For example, if one needs to iterate through lines keeping state into account, afor (int i =0;i<len;i++){
  if(lines[i] == "a"){
    i+=2;
  }
}seems much cleaner than an equivalently functional algorithm.-----EDIT.I (purposefully) left out the "main" logic (as it's not really relevant to the post).Of course in a "real" example, the code would look like: 
for (int i =0;i<len;i++){
  if(lines[i] == "a"){
    i+=2;
  } else{
    parseLine(lines[i]);
  }
}The goal is to skip the line after a line starting with the letter "a".