View Single Post
04/08/14, 09:45 AM   #21
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
I have to say mixing code with layout-structure always reminds me about using inline JS and inline CSS in HTML:

Bad practice

There is a reason you have both.

1. XML is for structure (as in describing your layout)
2. LUA is for functionality that uses that structure (as in bringing that layout to life)

While some coders do prefer doing everything with only code due to performance reasons (which might be valid and better if there isn't much going on) the usability and maintenance of it is significantly harder especially if things get more complex.

For example when they introduce bigger API changes the XML-Definition is high likely to stay the same -
while the API-Functions itself are most likely to change. Resulting in a broken layout that needs to get adjusted.

That taken aside when you have multiple people working on a project (speaking from a professional side) it 's way easier for the Designers to just jump in and make their adjustments in a simple XML-File then by digging in your Code (and breaking the functionality instead of changing the Layout).

At least that is how one should tell it to a beginner in terms of optimal viewpoints overall for both the Designer as well as the Developers.

Pawkette's Projects are an good example at how you could / should mix them properly (in my opinion)

Last edited by thelegendaryof : 04/08/14 at 10:04 AM.
  Reply With Quote