[Vtigercrm-developers] Code quality

Błażej Pabiszczak b.pabiszczak at yetiforce.com
Tue Dec 6 16:45:35 GMT 2016


I totally agree with you, it's all marketing spam. However, the truth is
that the code quality in Vtiger is very low and their devs should read
through all the elements from his tutorial, so maybe they'd stop
programming the way it was done 7 years ago, because now we program
according to standards.

---
Z poważaniem / Regards 

BŁAŻEJ PABISZCZAK 
_Chief Executive Officer_ 
M: +48.884999123
E: b.pabiszczak at yetiforce.com 

W dniu 2016-12-05 18:57, socialboostdk napisał(a):

> Hi there, 
> 
> Its a nice idea for you to send it out, but it is also sending a lot of info for a full list, where no-one of us asked for it. So could you not instead send 1 mail with the relevant links & suggestions, etc. instead of forcing a daily mail? 
> 
> Thanks :) 
> 
> Best, 
> Chris. 
> 
> On 5 December 2016 at 18:07, Holbok István <holbok at gmail.com> wrote:
> 
>> Today, in day 4 of our 5-day mini-course, we're going to discuss ERROR HANDLING. 
>> Error handling 
>> 
>> For a long while, error handling was just about magical status codes for us. You know what I am talking about, right? 
>> 
>> When user submits an order, return 0 when the date is expired, return 1 when there is no more stock, return 2 when user is not eligible for current order, return 3 when user is not logged in, and return 4 when order is placed successfully. 
>> 
>> Have you done anything similar above? If so, you need to learn a better way of error handling. We did, and we've never looked back. 
>> 
>> Error codes are terrible; they are meaningless to new developers; are hard to keep track of because they contain no real information. 
>> 
>> Error handling should be done properly with exceptions. 
>> 
>> A lot of errors in our applications are exceptions. They are exceptional cases in our applications, which we should handle directly as soon as they occur. 
>> 
>> PHP introduced Exception class in PHP 5. 
>> 
>> Similar to exceptions in other languages, an exception is "thrown" when an error occurs:
>> 
>> throw new Exception('No more stock')
>> 
>> And an Exception class ought to be handled in a catch clause: 
>> 
>> catch (Exception $e) {
>> echo 'Caught exception: ',  $e->getMessage(), "\n";
>> }
>> 
>> To make sure some code always runs such as closing a database connection, we use a finally clause: 
>> 
>> finally {
>> // close PDO connection
>> }
>> 
>> Now you know error handling does not mean returning magical codes. Using exceptions to handle exceptional cases is the way to go!
>> 
>> Tomorrow, in the final installment of this course, we'll take a look at TEST DRIVEN DEVELOPMENT.
>> 
>> You won't want to miss it,
>> 
>> Keep learning!
>> Xu
>> www.startutorial.com [1]
>> 
>> Kindest regards:
>> Istvan Holbok 
>> _______________________________________________
>> http://www.vtiger.com/
> 
> _______________________________________________
> http://www.vtiger.com/
 

Links:
------
[1] http://www.startutorial.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20161206/04defec3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: open
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20161206/04defec3/attachment-0001.gif>


More information about the vtigercrm-developers mailing list