[Vtigercrm-developers] Day 2: Modernizing your codebase

Tim Mohrbach preexo at googlemail.com
Sun Dec 4 10:05:34 GMT 2016


They tried a bit to make it look like it. But from the content you can tell they have never looked at vtiger code and have never tried to work with vtiger the company before. It's all valid and good but kinda useless if not done in cooperation with vtiger 

On December 4, 2016 12:56:00 PM GMT+08:00, Sutharsan Jeganathan <ajstharsan at gmail.com> wrote:
>Hi
>
>Is this anything related to vtiger
>
>
>Thanks
>SUTHARSAN JEGANATHAN
>
>On 3 Dec 2016 6:39 pm, "Holbok István" <holbok at gmail.com> wrote:
>
>> Dear List-members, here is also some idea ...
>> ------------------
>> Today we're going to dive into *Modernizing your codebase*.
>>   Coding Standard
>>
>> For years, there were no uniformed standards for writing PHP code.
>Some of
>> us chose to follow Zend Framework Coding Standard, some preferred
>PEAR
>> Coding Standard, and the rest simply came out their own way of
>writing PHP
>> code.
>>
>> Distributing PHP code without a coding standard is kind of mess.
>Since
>> everyone has his or her own way of formatting the source code,
>scanning
>> someone else's code becomes a hassle. By sticking to one uniformed
>coding
>> standard, we not only encourage someone else to read our code, but
>also
>> make reading someone else's code easier for ourselves.
>>
>> So first step to become a modern PHP developer is to adopt a coding
>> standard. Currently the most updated coding standard in PHP is PSR-2
>(PHP
>> Standards Recommendations number 2).
>> Autoloading
>>
>> Are you tired of using statements like include / require whenever you
>> need to include classes from other files.
>>
>> We had this problem in PHP for a long time. Code became cluttered and
>ugly
>> when we used this technique in our main file to include all desired
>> classes. Not only that, it was difficult to maintain the codebase,
>for
>> example when some classes needed to be refactored to other names.
>>
>> Fortunately we have autoloader. Basically, autoloader is a technique
>to
>> load classes from file paths automatically. This magic saves us from
>hard
>> coding file paths whenever we need those classes.
>>
>> So if you are writing a class or using someone else's class today,
>start
>> using PSR-4 Autoloader, which is the latest autoloading
>specification.
>> Package management
>>
>> In the old days, managing 3rd party libraries in your own codebase
>was
>> super difficult. The following was a typical scenario: you downloaded
>an
>> awesome library from the Internet and it worked great with your
>existing
>> codebase. You were happy until you needed to upgrade the library
>because
>> the server had upgraded its PHP version. The codebase started
>breaking down
>> right after you downloaded the latest version of the library. You had
>no
>> clue why it happened. You had not changed any piece of your code. So
>you
>> asked your server admin and consulted your fellow colleagues. After
>half a
>> day of digging through code, you found that one of the API methods
>was
>> removed from the latest version of the "awesome" library you
>downloaded.
>>
>> Does above story sound familiar to you?
>>
>> Fortunately we have Composer. The de-factor package manager for PHP
>> codebase. It takes care of all the nitty-gritty of using a package
>for us.
>>
>> So if you have not yet started with Composer, start using it right
>now!
>> Next up, we'll learn about *Modernizing your database handling*.
>>
>>
>> Until tomorrow,
>>
>> Keep learning!
>> Xu
>> www.startutorial.com
>> Kindest regards:
>> Istvan Holbok
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>http://www.vtiger.com/

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20161204/fee12991/attachment-0001.html>


More information about the vtigercrm-developers mailing list