locked
What's best to do? RRS feed

  • Question

  • Hi,

    I would like to know regarding best practices for CRM 4.0 code.

    Javascript code:

    1- When we add 'debugger' in the  javascript code, isn't it better to remove it before deployment on production server?

    2- Try and catch, isn't better to also remove them from the code on the production server?

    Plugins:

    1- Isn't it better to remove try and catch before deploying plugin code on production server?

    Thank you in advance

    Friday, December 16, 2011 10:07 AM

Answers

  • Yes you want to remove the debugger statements from your javascript, but it's good practice to have try and catch blocks as part of a robust error handling system. If you are throwing error messages to users from your catch blocks, you want to change the code to provide friendly and meaningful messages rather than the detailed messages you might throw when testing and debugging. See here for a best practices article from Microsoft: http://msdn.microsoft.com/en-us/library/seyhszts.aspx

    Friday, December 16, 2011 10:17 AM

All replies