Organise files by function Good or Bad?


#1

I read this blog post today:

The author suggested a different approach to structuring Angular apps that also applies to Ember. Break up section by functionality as opposed to category.

So, place your controller/models/routes/views/templates for a particular area in one folder.

Have any people experimented with this kind of file structure? Is it a good or bad idea?


#2

I have not tried this approach, but seems to be a good idea considering that one resource may have more than one functionality/scenario. I have a large number of files and I think this approach would definitely help me to navigate better through them in debug mode.


#3

I never navigate trees using my UI, just using cmd + t. So changing this wouldn’t directly affect me. However, I have a couple of lingering doubts:

What about components that have no functional area? For example a category model. Would that go in topic or list or its own section?

Another issue: I really like about how Discourse organizes js files is it is congruent to Rails. It is basically the same tree – models, controllers, views, templates. Is okay to have the client side app not match the same structure as the server side app?