DHTMLX grid multiple ways to define and init?

I noticed DHTXML grid has multiple ways of defining columns etc - in js and in xml?

When would we should use which way?
or are they functionally equivalent and it is just user preference?

we recommend you to initialize your grid from js. Such way is the most effective.
Sometimes the grid need be initialized from the server-side. F.e. due to the dynamic header structure. In this case you may define the header in the xml.