Every developer has their own style of writing code. I'm sure I'm not the only person that has inherited code from someone else only to make grimacing faces when you open it up in Visual Studio. I will admit that sometimes I want to slap people for what they have handed over to me but I'm sure someone has wanted to slap me a time or two as well. If you are like most developers you will have the immediate urge to "fix" this code to bring it up to your "standards". I'm no different. Not that I claim to be the swami of coding standards. I'm always learning and getting better but I think I am not bad compared to stuff I've seen. Here are a few of my philosophies. I have to say that a book that I read called Clean Code by Robert C. Martin has really made an impact on my thought process. I think in general we get so caught up in the work of writing code that we step back and think about how we are writing code. When it comes to coding with CRM 2011 I have some basic thoughts on what things should look like.
Let the code tell the story
Unfortunately when I inherit someone else's code I see one huge method that requires me to hit the page down button a few times to see it all. This is one of my big gripes and plan on running for president of stop doing that crap to other people... organization. Even if you have comments in your code which is rare, if you are doing 50 different things all in one method then its harder to read when the poor smuck that gets stuck with your work after you are gone. Don't do that to them (or me)! Here is my main guideline for code:
Keep It Simple Stupid (KISS)
Every problem has more than one solution. If you don't think so then you either don't understand the problem well enough or you don't have a full grasp of the possible solutions. Perhaps the problem isn't even defined correctly in the first place. The point is don't make things more complicated than it needs to be. I inherited an application where the previous developer had written a custom ASP.NET application that was hosted in an iFrame of a form. In the host web page the developer retrieved an XML web resource from the server that contain a list of servers and then this was used to compile a URL to redirect the current page to the custom web application. Not only that but the developer invoked an ActiveX control to parse the XML file to get the settings. This seemed a little overly complex for just pointing the user at the right URL for the custom application besides the fact that the custom web app shouldn't be dependent on what CRM server we are on.
Question Your Conclusions (at least once)
Like I said there are multiple solutions to a problem. You may come up with some good ones, but there are always more. Maybe the best way to go is with an ASP.NET application. It's probably better to go with a Silverlight solution but sure I'll take go with it. The more complex your solution the less likely it is the most appropriate solution. Ask yourself and someone else who you know won't sugar coat their opinions. If you're in a team situation then this problem won't be too much of a problem.
This is just some of the things that go through my mind on projects. I'm in the process of coming with a more formalized development philosophy and strategy when it comes to multiple developer CRM projects so stay tuned and I'll float something out there shortly. Hope that this little byte of thought was at the least something to get you through your morning cup of coffee/hot pocket.
I hear you! I think the issue with code quality worsens in CRM as you get system customisers who dabble with code trying to create plugins and assemblies instead of software engineers.My problem is that my code is very abstract, based on interfaces and design patterns so when those dabblers look at my code they have no chance of extending it!Should I dumb my code down for them or should they learn proper software development techniques!!
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.