In functional programming, it's often important to optimize any "looping" code to be tail recursive. Tail recursive algorithms are usually split between two functions, however - one which sets up the base case, and another that implements the actual loop. A good (albeit academic) example would be the reverse function.
reverse :: [a] -> ...
Is there a helper of some sort? I want to make a javascript file, put it in the rails directories somewhere, and have the file be included in a view so I can use the methods and functions I declare in the file.
...
These functions may be hard to fit into a specific class,
what's the best practice to deal with them?
...
i wonder if one should create a helper function in a class as a static function or just have it declared as a procedural function?
i tend to think that a static helper function is the right way to go cause then i can see what kind of helper function it is eg. Database::connect(), File::create().
what is best practice?
...