Will a recursive static method be a tail call, optimized in a way by how the static method is implemented under covers?
Static methods have nothing to do with tail recursion optimization. All the rules apply equally to instance and static methods, but personally I will never rely on JIT to optimize my tails. Moreover, the C # Compiler does not generate a tail call command, but sometimes this is done anyway . In short, you never know .
The F # compiler supports tail recursion optimization and, when possible, compiles recursion into loops.
Read more about C # vs F # behavior in this question .
Was this equivalent to functional programming for writing an entire application with static methods and without variables outside the local area?
It is not, and yes.
Technically, nothing prevents you from calling Console.WriteLine from a static method (which is the static method itself!), Which obviously has side effects. Nothing prevents you from writing a class (using instance methods) that does not change any state (that is, instance methods do not access instance fields). However, from a design point of view, such methods really don't make sense as instance methods, right?
If you Add a .NET Framework List<T> element (which has side effects), you will change its state. If you append an item in the F # list , you will get another list and the original will not be changed.
Note that append indeed a static method in the List module. Writing "conversion" methods in separate modules helps to create a free effect without side effects, since by definition internal storage is not available, even if the language allows it (F # does, LISP). However, nothing prevents you from writing a free non-static side effect method .
Finally, if you want to understand the functional concepts of a language, use one! . It is much more natural to write F # modules that work with immutable F # data structures than to simulate the same in C # using or without static methods,