I am developing an app in xamarin forms and I am doing my views in a programmatic way. My question is: In terms of optimization which of the two options is better to use?
Thank you.
I am developing an app in xamarin forms and I am doing my views in a programmatic way. My question is: In terms of optimization which of the two options is better to use?
Thank you.
I have not worked with Xamarin but, from my experience in other environments, I would say that it is better to have the views apart from the code. They will be easier to understand and maintain, especially for someone who faces that project for the first time.
There is only one exception to this and that is when you have to generate the form dynamically (obviously), but for the rest of the cases I think it helps to have things separately.
If in terms of optimization you mean performance, I would not know how to say it.
Developing in Xaml will allow you to use Bindings and an Mvvm architecture (which for me is something wonderful) and that's why it's my choice, but instead the development in programmatic forms is more documented.
Even so I have already 3 applications in form with Xaml and the only thing that I had no choice but to do in code behind has been in a case that wanted a listview not selectable. If you drive with Bindings Xaml it is clearly your best option.
Dear, there is no difference as far as performance is concerned, the compiler converts your XAML code into C # code, personally I find it easier to use XAML and for MVVM issues there is not much impact that you approach.
Greetings