Code Behind

BrandonLevasseurBrandonLevasseur USMember, University
edited June 2015 in Xamarin University

Coming from a native iOS/Android background and being placed into Xamarin training, I would like to point out how the term 'code behind' is being used incorrectly in the university videos (such as the Android 101 video) and is fairly annoying/misleading on my behalf. If possible, just note code rather 'code-behind'. The intermediate translation layers between C# and native code doesn't justify labeling this a similar code structure to an application, so this is very irritating for someone like me to hear professionals use this term consistently and is potentially mis leading to new people in the mobile development community.


  • ZephCohenZephCohen USMember, University

    I agree with Brandon's post above. This is a misleading concept for native iOS and Android developers who may not have worked with .NET before since the code behind in Xamarin is technically running on the device and not on a web server.

  • MarkSmith.8123MarkSmith.8123 USXamarin Team, University, XamUProfessors Xamurai
    edited June 2015

    Hi @BrandonLevasseur,

    Thanks for the comments -- the term is used a bit loosely by a lot of people. While it's commonly used for ASP.NET (to indicate the server-side code), it's not exclusive to that environment.

    For example, it is/was commonly used for the desktop frameworks (WSA/WPF/WinForms/Silverlight) to represent the code tied to the markup (XAML) or designer files - just searching WPF books finds a whole bunch of them using the term.

    Given that Xamarin's app structure (particularly Xamarin.Forms) mirrors this style (where a designer emits code to tie you to the visuals), I think the instructors are just using the term to represent the code that is direct tied to the markup (vs. other code you might add to the project such as ViewModels or data entities).

    I think most of the instructors have a heavy-Microsoft background, vs. iOS or Android, which is why they tend to use more Microsoft-centric terminology. Much like I imagine Microsoft devs would call an EditText widget in Android, or a Label in iOS a "Control". I can't really influence their language much - your background often skews you and they likely don't even think about the term.

    Thanks for bringing it up though -- it tells me to be more conscious of the language used in the materials, or to define terms we tend to use that might be coming from a background unknown to the learners to make sure everyone clearly understands what we are talking about.

Sign In or Register to comment.