
{"id":2090,"date":"2015-08-30T22:43:39","date_gmt":"2015-08-30T22:43:39","guid":{"rendered":"http:\/\/www.codergears.com\/Blog\/?p=2090"},"modified":"2015-08-30T22:43:39","modified_gmt":"2015-08-30T22:43:39","slug":"programming-tip-tag-your-source-code-to-assist-the-developers","status":"publish","type":"post","link":"https:\/\/codergears.com\/Blog\/?p=2090","title":{"rendered":"Programming Tip: Tag your source code to assist the developers."},"content":{"rendered":"<p>How many times have you searched in the code base of your company projects to know how a recurrent\u00a0treatment was implemented? This\u00a0might concern a technical\u00a0treatment like the database access, logging, socket access, etc&#8230; , or it might concern a design needs like the design patterns implementation.<!--more--><\/p>\n<p>Currently, to develop a recurrent treatment, a developer could:<\/p>\n<ul>\n<li>Spend several minutes in searching for what he wants in the code<\/li>\n<li>Ask a collegue<\/li>\n<li>Develop from scratch without using an existing code as a sample.<\/li>\n<li>Use some guides from its company<\/li>\n<\/ul>\n<p>In this post we will talk about a technique that we use in our company for recurrent programming needs.<\/p>\n<p>The tip\u00a0is to tag some treatments in your code base to assist the developers of your company when they need a recurrent treatment. Let&#8217;s take as an example\u00a0the database layer: we could add for each recurrent need (Select, Insert, Update, Delete, stored proc) a tag in a\u00a0method doing this treatment. This method will be the model of this recurrent need.<\/p>\n<p>For example, for a\u00a0\u00a0method \u00a0doing a select into the database, we can\u00a0add the following tag in the comment block <strong>[DatabaseSelect]<\/strong><\/p>\n<p>Another example might concern a design pattern like the singleton or the adapter, it could be interesting to tag each actor of the pattern, and you can use as an example these tags <strong>[Adaptee]<\/strong> and <strong>[Adaptor]<\/strong>.<\/p>\n<p>Any developer could just search in the code where a\u00a0tag exists if he or she needs specific\u00a0treatment. A repository of all tags will\u00a0be available from the company wiki web page. Of course a tag will be added only once and no need to add it wherever a similar treatment is done.<\/p>\n<p>The advantages of this technique are:<\/p>\n<ul>\n<li>Developers could find in few seconds what they want as recurrent treatments.<\/li>\n<li>The source code will be homogenous\u00a0for all the company projects.<\/li>\n<li>The treatment tagged will be a reference concerning the implementation quality.<\/li>\n<li>After few months, the company will have a repository of almost all the recurrent needs.<\/li>\n<\/ul>\n<p>Sometimes, there is no need to be assisted by an advanced tool or a very advanced technique in order to assist the developers in their works; indeed, it&#8217;s very easy to adopt this technique and the result is very interesting.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How many times have you searched in the code base of your company projects to know how a recurrent\u00a0treatment was implemented? This\u00a0might concern a technical\u00a0treatment like the database access, logging, socket access, etc&#8230; , or it might concern a design needs like the design patterns implementation.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2090","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/2090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2090"}],"version-history":[{"count":19,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/2090\/revisions"}],"predecessor-version":[{"id":2110,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/2090\/revisions\/2110"}],"wp:attachment":[{"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codergears.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}