<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body >Hi DG!
<br>
<br>Your comments are well taken. These will be in place at the earliest.
<br>I know that this will be a quick fix but instructions have been sent across to have the code properly commented from now on for any future development/bug fixes.
<br>
<br>Richie<br><br><br><br><br>---- Dennis Grant&lt;dgrant@accuratetechnologies.com&gt; wrote ---- <br><br><blockquote style='border-left: 2px solid #0000FF; padding: 6px;'><html>
<xbody>
Ladies and Gentlemen,<br><br>I am currently employed as the lead integrator/programmer for VTigerCRM<br>at a medium-sized manufacturing company. My job is to maintain the<br>VTigerCRM server, and to customize our installation of VTiger to match<br>our business needs.<br><br>Sometimes this involves getting other systems (like Microsoft Great<br>Plains) to play nicely with the CRM; sometimes it means changing VTiger<br>code to better adopt the CRM to our particular business needs.<br><br>Our current installation is a heavily-modified (and I do mean HEAVILY)<br>modified 4.3.2 installation. To be honest, I painted myself into a bit<br>of a corner with the way I implemented our code changes, such that<br>upgrading to newer versions is a formidable challenge. My intent is to,<br>soon, bring up a 5.0 installation and start backporting our changes into<br>it, but this time with patch management tools to better manage upgrading<br>in the future.<br><br>In a way, it's a bit like maintaining my own private fork of something<br>like the Linux kernel, and so I intend on adopting the best practices of<br>those who have gone before me.<br><br>Anyway, I have occasion to spend a LOT of time in VTiger code, and while<br>I have not yet seen the V5.0 code in any great detail, I have a pair of<br>impassioned pleas for all current VTiger developers (in any version)<br><br>1) For the love of all that is holy, PLEASE COMMENT YOUR CODE! Those of<br>us who have to pop into a module to make a few tweaks to how it<br>looks/operates are hamstrung by the lack of comments in VTiger code. We<br>wind up having to work everything out from scratch, and that makes a<br>difficult job even more difficult. The fact that VTIger code, in<br>general, uses good descriptive variable names helps out a lot, but<br>comments would go even further.<br><br>Please please PLEASE get into the habit of commenting your code, even if<br>you think the functionality is obvious - you'll REALLY help guys like me<br>out.<br><br>2) I see a lot of code that looks like this:<br><br>if ($_REQUEST['module'] == 'module_name1' || $_REQUEST['module'] ==<br>'module_name2') {<br><br>   if ($some_parameter !='') {<br><br>       Do some stuff;<br>   }<br>}<br><br>What is missing here is any sort of exception handling. Not only does<br>this code fail silently if the tested assumptions aren't true (which has<br>caused some unusual bugs) it also fails to communicate to integrators<br>what the allowed/expected parameters of this code block are.<br><br>EVERY SINGLE IF OR IF/THEN NEEDS AN ELSE TO CATCH EXCEPTIONS, without<br>exception (heh) Failing to do this opens the door to bizarre bugs and<br>much wasted time trying to track them down. It also makes an<br>integrator's job that much more difficult.<br><br>Compare to this example:<br><br>// Prepare the foo object for writing to the database<br><br>// We are only supposed to be called from the module_name1 or<br>module_name2 modules<br>if ($_REQUEST['module'] == 'module_name1' || $_REQUEST['module'] ==<br>'module_name2') {<br><br>   // We need this to be set <br>   if ($some_parameter !='') {<br><br>       Do some stuff;<br>   }<br>   else {<br>      print_warning("Expected some_parameter to be set in<br>do_stuff.php");<br>   }<br>}<br>else { <br>   print_warning("Called with unexpected value of REQUEST[module] :<br>".$REQUEST['module']." from do_stuff.php.");<br>} <br><br>I don't want to get all programmer grammer nazi here, but I've been<br>ripping my hair out by the roots for the last few hours, and it's all<br>totally unnecessary.  <br><br>DG<br><br>_______________________________________________<br>Get started with creating presentations online - <a href="http://zohoshow.com?vt">http://zohoshow.com?vt</a> <br>
</xbody>
</html></blockquote></body></html>