Q:

When to use app/code vs app/design

I saw two topics about that but I'm still not sure.
I'm discovering Magento 2, I'm a frontend developer and right now, I just want to make my company website's header and footer (html, css) (so a theme)
Which folder should I use ? app/code or app/design.
If I'm creating a new module, I have to create all phtml files, layout, etc... in app/code/../view/frontend/templates/xx.phtml but if I'm overriding an existing module, eg : module-theme or module-catalog, I'm doing it in app/design/frontend/../../templates/xx.phtml?

A:

Depends on the approach you want to have.
You need to understand few things.
In the app/design, you only can edit files: phtml, html, less, css, xml
The design is last in the chain than anything that happens in the app/code.
So if something happens in luma design, you can have troubles changing things in the app/code.
In the app/code this is a place for new modules.
You can't access the mage lib here.
Your can't change the templates that exist in the current design or any of its parent.

