Hi all
Here's a problem I often run into. I have a couple of pages on a site that use a few functions. Let's say for now that the functions are used to display a list of developer news-related articles.
Say page 1 is the main news page, and page 2 is the full list of just developer articles.
Now I can put the functions in one of two places:
- The global functions file for the entire website.
- A specific include file for (say) developer news functions.
To date, I've been using a mixture of the two. For functions that really are used all over the place I put them in the former, and use the latter for groups of functions that are only used in certain places.
When looking at other's code I sometimes get frustrated because I don't know where a function comes from.
What do people prefer for maintenance?
Should I keep all functions/classes in one file/folder, regardless of grouping?
-Antun