<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Charlie Murray - Ezeiatech</title>
	<atom:link href="https://ezeiatech.com/author/charliemurray/feed/" rel="self" type="application/rss+xml" />
	<link>https://ezeiatech.com</link>
	<description>Global technology consulting company</description>
	<lastBuildDate>Fri, 27 May 2022 11:26:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.7</generator>

<image>
	<url>https://ezeiatech.com/wp-content/uploads/2022/04/cropped-Ezeiatech-Icon-32x32.png</url>
	<title>Charlie Murray - Ezeiatech</title>
	<link>https://ezeiatech.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Rust Concurrency</title>
		<link>https://ezeiatech.com/rust-concurrency/</link>
		
		<dc:creator><![CDATA[Charlie Murray]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 11:06:00 +0000</pubDate>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://13.127.63.32/?p=2518</guid>

					<description><![CDATA[<p>For a long time I have been thinking about writing a sample program in Rust “the” new systems language. I have done coding in C++ for initial 5 years of my career before I moved on completely to Java and recently in one of my products a requirement came up that a low latency high [&#8230;]</p>
<p>The post <a href="https://ezeiatech.com/rust-concurrency/">Rust Concurrency</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>For a long time I have been thinking about writing a sample program in Rust “the” new systems language. I have done coding in C++ for initial 5 years of my career before I moved on completely to Java and recently in one of my products a requirement came up that a low latency high performance component had to be developed.</p>



<p>As I have written by default Java was a default choice as its my first choice anyways. However I realized that this component could not afford non deterministic nature of garbage collector.</p>



<p>So need was to write program where I could have control over exact memory deallocation without worrying about “stop the world” garbage collection. Natural Choice was C++ but programming is all about having fun and I wanted to try out something new and C++ threading support and syntax is not all that great even in C++11.</p>



<p>So I decided to try out Go. but again Go had an issue of garbage collection and same fear of non determinism creeped in.</p>



<p>So time to try out&nbsp;<a href="https://www.rust-lang.org/en-US/" target="_blank" rel="noreferrer noopener">Rust</a>.</p>



<p>Program is simple but can be extended to lot of other scenarios.</p>



<p>One thread keeps spitting out data at some regular intervals. A vector keeps track of generated data.</p>



<p>Other thread keeps ticking at regular intervals (100ms or so) and whenever there are items which have elapsed time greater than a threshold those items are expired. Same as cache TTL.</p>



<pre class="wp-block-preformatted"><strong>use </strong>std::thread;
    <strong>use </strong>std::sync::mpsc;
    <strong>use </strong>std::time::{Duration,Instant};
    <strong>use </strong>std::collections::HashMap;
    //Define struct
    #[derive(Clone)]
    <strong>struct </strong>Item {
        <strong>created_at</strong>: Instant,
        <strong>id</strong>:<strong>i64</strong>,
        <strong>pub description</strong>: String
    }

//Implement Item
    impl Item {
        pub fn new(id: i64,description: String) -&gt; Item {
            Item {
                created_at: Instant::now(),
                id: id,
                description: description
            }
        }

        fn created_at(&amp;self) -&gt; Instant {
            self.created_at
        }

        fn id(&amp;self) -&gt; i64 {
            self.id
        }
    }

    fn main() {
        let (sender, receiver) = mpsc::channel(); //Creat  multiple publisher single receiver channel
        let sender_pop = sender.clone(); //clone sender
    
        //Create a thread that sends pop every 2 seconds
        thread::spawn(move || {
            //Create infinite loop
            loop {
                thread::sleep(Duration::from_millis(100));
                sender_pop.send(Item::new(-1,String::from("Pop"))).unwrap();
            }
        });

        //Create a thread that keeps sending data every second t
        thread::spawn(move || {
            let mut val = 1;
            //Create infinite loop
            loop {
                val = val + 1;
                sender.send(Item::new(val,String::from("New"))).unwrap();
                thread::sleep(Duration::from_millis(1000));
            }
        });

        //Create a mutable vector
        let mut vals: Vec&lt;Item&gt; = Vec::new(); 
        let ttl = 5; //TTL in seconds
        //Receive items in non blocking fashion
        for received in receiver {
            //let item = &amp;received;
            let mut item = &amp;received;
            let newItem: Item  = item.clone();
            match item.description.as_ref(){
                "Pop" =&gt; {
                    println!("Pop");
                    vals.retain(|ref x| Instant::now().duration_since(x.created_at).as_secs() &lt; ttl);
                },
                _ =&gt; {
                    vals.push(newItem);
                }
            }
        }
    }</pre>



<p>That’s it. You have done synchronisation between threads without any race condition. That’s how cool&nbsp;<a href="https://www.rust-lang.org/en-US/" target="_blank" rel="noreferrer noopener">Rust</a>&nbsp;is.</p>



<p>In the next blog we will try to send notification whenever items are expired.</p>



<p>Happy Coding&nbsp;!!</p><p>The post <a href="https://ezeiatech.com/rust-concurrency/">Rust Concurrency</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Microservice Architecture and Its Challenges</title>
		<link>https://ezeiatech.com/microservice-architecture-and-its-challenges/</link>
		
		<dc:creator><![CDATA[Charlie Murray]]></dc:creator>
		<pubDate>Mon, 29 Mar 2021 11:02:00 +0000</pubDate>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Micro Services]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://13.127.63.32/?p=2515</guid>

					<description><![CDATA[<p>Microservices architecture is becoming increasingly popular while building large scale applications as it provides n number of benefits. Separate lifecycle of each service so services can be deployed independently which means services can evolve separately. Each service can be fine tuned for different SLAs and scalability Each Service can be developed using different stack Each [&#8230;]</p>
<p>The post <a href="https://ezeiatech.com/microservice-architecture-and-its-challenges/">Microservice Architecture and Its Challenges</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Microservices architecture is becoming increasingly popular while building large scale applications as it provides n number of benefits.</p>



<ul><li>Separate lifecycle of each service so services can be deployed independently which means services can evolve separately.</li><li>Each service can be fine tuned for different SLAs and scalability</li><li>Each Service can be developed using different stack</li><li>Each service can be monitored separately</li></ul>



<p>However, Microservice service architecture is not a free lunch. It throws many challenges that must be discussed and dealt with even before venturing into this (unchartered) territory.</p>



<ul><li><strong>Authorisation</strong>&nbsp;– How do you make sure that particular service and its APIs can be called only when user is authorised to do so.</li><li><strong>Data Consistency</strong>&nbsp;– ACID is no longer available, deal with eventual consistency.</li><li><strong>Service Discovery</strong>&nbsp;– How to find and interact with new services. If there are lots of services then how to make sure that they are discoverable from other services</li><li><strong>Deployment</strong>&nbsp;– What if there is a hierarchy in microservice dependency<ul><li>A -&gt; B -&gt; C</li></ul></li><li><strong>SLA</strong>&nbsp;– Multiple hops in a request will add to latency and affect your SLA</li><li><strong>Fault Toleranc</strong>e – How to handle Cascading Failure</li><li><strong>Monitoring</strong>&nbsp;– (How to monitor a system which has 100s or even 1000s of services)</li><li><strong>Tracing&nbsp;</strong>&nbsp;– Logging &amp; Request Tracing (A message will travel across many boundaries so how to nail down where message got lost/delayed)</li><li><strong>Tech Stack</strong>&nbsp;– Selecting a stack (to go with single stack or multiple stacks?)</li><li><strong>Packaging and Deploying</strong>&nbsp;– (How to come up with a uniform way of packaging and delivering services )</li><li><strong>Debugging –&nbsp;</strong>During development phase how to make sure that developers are able to debug code as effectively as they do in monolithic system</li></ul><p>The post <a href="https://ezeiatech.com/microservice-architecture-and-its-challenges/">Microservice Architecture and Its Challenges</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Software Architecture &#038; Its Importance</title>
		<link>https://ezeiatech.com/software-architecture-its-importance/</link>
		
		<dc:creator><![CDATA[Charlie Murray]]></dc:creator>
		<pubDate>Thu, 25 Jun 2020 10:48:00 +0000</pubDate>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://13.127.63.32/?p=2509</guid>

					<description><![CDATA[<p>This post is about understanding architecture of an application and it’s role in web application development. I have worked in various domains writing softwares. All of us know that although developing software for each business domain throws new challenges and their needs differ vastly but there are many tools and systems which are used commonly [&#8230;]</p>
<p>The post <a href="https://ezeiatech.com/software-architecture-its-importance/">Software Architecture & Its Importance</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This post is about understanding architecture of an application and it’s role in web application development.</p>



<p>I have worked in various domains writing softwares. All of us know that although developing software for each business domain throws new challenges and their needs differ vastly but there are many tools and systems which are used commonly everywhere.</p>



<p>So, most of the web applications are following this approach what we can call 3-tier applications.</p>



<p>You have got a presentation layer, business layer and a database layer. When you deploy you should be able to deploy on 3 boxes. Surprisingly lot of times you will end up deploying only on 2 boxes. Reason why some company might do this is that they did not&nbsp;segregate&nbsp;between physical and logical layers. One with all the logic and other one with just RDBMS running in background. Even sites like twitter and GroupOn had one big chunk of monolithic softwares where everybody was coding. Later on they decided to dismantle it into smaller blocks as it was impossible to scale this big piece.</p>



<p>Most of seasoned developers understand the meaning of layers but one important thing that they do not understand that a layer can be logical as well as physical.</p>



<p>A logical layer (separation of concerns, modular programming ..whatever you call them) sits in the same process space as other layers and just segregates logic.</p>



<p>You create a layer and expose it’s various functionality via interface. Client of your layer injects them using some fancy library like Guice, Spring or does a “new”.</p>



<p>Many start-up companies at least in India are taking this approach. They start small develop code in one big chunk and when they grow they start dismantling their code into various modules.</p>



<p>It might have worked for some companies but it puts a huge pressure on ROI and dependency increases on the existing developers. If one of them leaves you are doomed. And If I am not wrong you went with no documentation at all by following practices of agile programming (in wrong way). So all you can do is further increase the costs by offering higher wages :-).</p>



<p>On the other hand new people are feeling bad because they are not able to participate much as&nbsp;multiple&nbsp;activities are going on in parallel. Refactoring of current architecture, new feature development, pressure of management to develop new feature and bug fixing/maintenance of existing systems.</p>



<p>For refactoring you have probably cut a new branch and start working there but by the time you are finished your existing branch in production and your&nbsp;re-factored&nbsp;branch have been diverged so much that it becomes another exercise to merge them.</p>



<p>People do it though but almost on daily basis you will get regressions and all this mess will lead to another mess and increase the costs significantly. It will hamper the growth of the company.</p>



<p>There is no one solution to it. Different situations will require different solutions but I have also seen systems which have been managed pretty well over the years and thousands of new developers come and join the new team yet things remain in control.</p>



<p>So how come these two sides of same coin exists. When technology stack is same aren’t we supposed to have same kind of maintainable system?</p>



<p>What different one company did then others. As per me answer lies in Architecture of the systems.</p>



<p>One company was able to get it’s application’s architecture spot on right from the&nbsp;beginning&nbsp; Another company was doubtful about it’s growth and quickly wanted to put something on dashboard of users and praying that when they grow they will think about it.</p>



<p>This is also not a bad approach it works in many cases but getting the design right in first place does not take so much effort as it looks like.</p>



<p>Web frameworks like Ruby on Rails, Grails and Java script library JQuery are built on the very concept of plugins. It keeps things under control and these small piece of softwares can be maintained easily. If some component starts behaving badly you just stop using it by unloading that particular component.</p>



<p>It is well known practice adopted by experts and computer scientists that one should write code as if he is writing a library. It automatically brings modularity in system and maintenance become very easy (comparatively). and same is true about architecture also. One should develop modules to be consumed by others. Modules or components are supposed to expose a certain functionality. Others are just consuming it.</p>



<p>Great..looks like this is holy grail for solving our problems. Not yet. Once we have created different components and decided to deploy them on different machines we are actually facing host of other issues Deployment, Inter process communication, Fault Tolerance, Centralized logging to name a few.</p>



<p>We will try to solve these problems one by one in upcoming articles.</p><p>The post <a href="https://ezeiatech.com/software-architecture-its-importance/">Software Architecture & Its Importance</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Web Application Scalability – Service Layer</title>
		<link>https://ezeiatech.com/web-application-scalability-service-layer/</link>
		
		<dc:creator><![CDATA[Charlie Murray]]></dc:creator>
		<pubDate>Wed, 11 Sep 2019 10:16:00 +0000</pubDate>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Applications]]></category>
		<guid isPermaLink="false">http://13.127.63.32/?p=2500</guid>

					<description><![CDATA[<p>So In our last post I promised that we will talk about how to make monolithic code into distributed SOA architecture. Well its not easy. Once you have decided that you want to re-architect the single chunk of software in distributed manner you have to decide about different parts of the system which can be [&#8230;]</p>
<p>The post <a href="https://ezeiatech.com/web-application-scalability-service-layer/">Web Application Scalability – Service Layer</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>So In our last post I promised that we will talk about how to make monolithic code into distributed SOA architecture.</p>



<p>Well its not easy. Once you have decided that you want to re-architect the single chunk of software in distributed manner you have to decide about different parts of the system which can be deployed on different machines and still everything will work fine.</p>



<p>There are many problems while doing so.</p>



<ul><li>How will you host these services (S in SOA).</li><li>How will you communicate and how serialisation/deserialisation will happen?</li><li>How do you make sure that you are able to implement the same workflow which you had in single monolithic component assuming you were doing things sequentially.</li></ul>



<p>To answer the first question there are many options available but I will list down some which I have personal experience with.</p>



<ol><li>Design your services as RESTful and deploy them in you preferred container like weblogic.<ul><li><strong>Pros</strong><ul><li>Location transparency. You refer to the services using URI.</li><li>Interacting with RESTful service is pretty easy in any language.</li></ul></li><li><strong>Cons</strong><ul><li>Serious overhead of HTTP protocol.</li><li>Serious maintenance issues with container management not to mention huge performance hit.</li></ul></li></ul></li><li>Design your services as Java processes and interact with them using a service bus like JMS (ActiveMQ, Fiorano etc.).</li><li>Design your services as Thrift based and interact with them by passing pre-generated client code.<ul><li><strong>Pros</strong><ul><li>Serialization/Deserialization take care by thrift. You just interact with POJOs everywhere.</li><li>Lightweight highly scalable proven architecture (Facebook?). Forget about converting from Json to POJO and vice-versa.</li></ul></li><li><strong>Cons</strong><ul><li>Every time service or schema is changed you need to redistribute client code.</li><li>Schema definition in thrift file has some limitations of its own.</li></ul></li></ul></li><li>Design your services as separate Java Processes and have a networking library like ZeroMQ take care of communication.<ul><li><strong>Pros</strong><ul><li>ZeroMQ is battle tested and used in many mission critical projects. Takes care of networking needs.</li></ul></li></ul><ul><li><strong>Cons</strong><ul><li>Low level programming is needed compared to other approaches.</li><li>Many scenarios will have to be handled even with this approach so code size will swell up.</li></ul></li></ul></li></ol>



<p>For long time I had been dealign with Hub and Spoke Model by using a ServiceBus like MSMQ, ActiveMQ.</p>



<p>ServiceBus is a popular approach especially in financial institutions who invest in enterprise grade product like TIBCO MQ.</p>



<p>Problem with service bus approach is that you have to write code specific to Messaging Bus. So another layer is added which increases complexity.</p>



<p>So for some time I had been tracking if there is a way to remove this layer. Given my experience in Industry there are some areas I believe a company should not invest until absolutely necessary and one such area is networking.</p>



<p>Having said that one day while learning Scala I came across a project called Akka. Akka is a framework which addresses many problems with simple concept of Actors.</p>



<p>Networking and Concurrency provide easy way to program local or distributed services. What you get is complete location transparency as you communicate with remote actors in same way as you communicate with local actors.</p>



<p>There is no hub and spoke model so no new software has to be installed/maintained or written specific code to make things work.</p>



<p>It’s P2P…networking complexities are hidden deep inside and you never have to deal with thread. WOW !! Sounds too good to be true.</p>



<p>Completely asynchronous with a programming paradigm that is easy to understand and concept of actors is already proven in telecom industry.</p>



<p>In the next post we will talk about some sample code for&nbsp;how location transparency can be achieved.</p><p>The post <a href="https://ezeiatech.com/web-application-scalability-service-layer/">Web Application Scalability – Service Layer</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Code Quality Guidelines</title>
		<link>https://ezeiatech.com/code-quality-guidelines/</link>
		
		<dc:creator><![CDATA[Charlie Murray]]></dc:creator>
		<pubDate>Fri, 26 Jul 2019 08:36:00 +0000</pubDate>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Technology]]></category>
		<guid isPermaLink="false">http://13.127.63.32/?p=2494</guid>

					<description><![CDATA[<p>Coding guidelines are extremely important part of a professional developer’s day to day practices. Following these guidelines differentiate&#160;between an experienced developer and a rookie. It surprises me that so many companies still ignore them and produce&#160;poor quality code that results in very expensive maintenance over the period and is so fragile that every time you [&#8230;]</p>
<p>The post <a href="https://ezeiatech.com/code-quality-guidelines/">Code Quality Guidelines</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Coding guidelines are extremely important part of a professional developer’s day to day practices. Following these guidelines differentiate&nbsp;between an experienced developer and a rookie.</p>



<p>It surprises me that so many companies still ignore them and produce&nbsp;poor quality code that results in very expensive maintenance over the period and is so fragile that every time you add a new feature immediately bugs creeps in.</p>



<p>I am sharing some of these guidelines which are far from exhaustive but are most important for me. Some things people might not agree with but these are my experiences and many of them are borrowed from classic tests.</p>



<h3 class="wp-block-heading">GENERAL CODING STANDARDS</h3>



<p><strong>These are general predefined standards for developing a code. This reduces</strong></p>



<ol><li>Naming Conventions should be descriptive (Variable as well as functions).</li><li>Your application must have separate static and dynamic parts.</li><li>No Hard Coding. Find an appropriate place where you can define constants or enums.</li><li>Prefer simplicity over complexity. If your code is turning out to be very complex most likely you are doing something wrong. As the saying goes its “hard to build simple things”</li><li>Avoid premature optimization. Define premature optimization for your own use case. Well sounds awkward. Trust me it is. Only experience can tell you what does this really mean</li><li>Always look for the possibility of following a standard Design Pattern. Tweak it for your own use case</li><li>Strictly prohibit repetitive code. If the code is repeating it’s a candidate for refactoring.</li></ol>



<h3 class="wp-block-heading">CLASS DESIGN</h3>



<ol><li>Class should not be more than 600 lines.</li><li>Constructor should not have any complex logic and has to be exception safe.</li><li>Prefer composition over inheritance.</li><li>Follow one responsibility rule everywhere.</li><li>Design for extensibility.</li><li>If in Object Oriented language always define an interface.</li><li>Avoid circular dependency.</li></ol>



<h3 class="wp-block-heading">COMMENTS AND ERROR MESSAGES</h3>



<ol><li>Write comments at all critical places in your code including variable name, their usage, function signature (input/output/parameters).</li><li>Work with error messages framework. Using error codes for displaying error messages is confusing as it’s hard to figure out which error code is coming from which place. To avoid this chaos, it is recommended to use error message framework.</li></ol>



<h3 class="wp-block-heading">IF ELSE STATEMENTS</h3>



<ol><li>Do not write deep nested if else statements.</li><li>Operator precedence for your language can introduce nasty bugs in your code which are extremely hard to debug. Follow a policy of using parenthesis while writing long if else conditions.</li></ol>



<h3 class="wp-block-heading">IMPLEMENT OOPS</h3>



<p><strong>It is recommended to implement OOPS in your code as much as possible. Program to an interface (contract), not class. Try to make an abstract class for a business service (in case of python/C++, interface in case of Java).</strong></p>



<h3 class="wp-block-heading">FUNCTIONS</h3>



<ol><li>Function should not be more than 25 lines.</li><li>Always check for valid parameters inside public functions. Throw an exception to report an error in params</li><li>To group the statements logically, try to divide different sections of a function into other smaller functions. E.g. Separate function for initializing values for every possible activity.</li><li>Use functional programming capabilities if your stack supports it. I.e. pass around functions to write reusable code.</li><li>Follow Single Responsibility Rule as closely as possible.</li><li>Functions have to be testable (I should be able to write unit test case for this function). In other words promote loose coupling via Dependency Injection or otherwise.</li><li>To continue with loose coupling follow the rule “Prefer composition over inheritance”.</li><li>If you are working with Java8 Never return null. Consider returning Optional</li><li>Try to avoid multiple return statements. This can put nasty bugs inside programs so it’s best to avoid them as much as possible.</li><li>Check Big O Complexity of algorithm you are writing. Especially for the case, where you are writing a lot of lines of code or for&nbsp;<strong>functions which are on a critical path</strong>.</li></ol>



<h3 class="wp-block-heading">LAYERED ARCHITECTURE</h3>



<p><strong>Follow layered architecture in true spirit. Upper Layer should call into lower layers and each layer has to be designed for specific purpose. E.g. while following MVC, Logic in views has to be related to view and all heavy lifting shall be done by the service layer.</strong></p>



<h3 class="wp-block-heading">PACKAGES</h3>



<ol><li>All Java Packages should start with com.yourcompany. Check for specific naming convention in your stack but the topmost package has to be your company.</li><li>Define functions in packages instead of utility. It’s a common malpractice to put every seemingly useful function inside utility classes. And while writing code it becomes difficult to look into these packages. If it’s a business utility function then try to find a proper package for it rather than putting function inside utility classes. Utility classes generally shall have function related to common tasks like String Reverse or some Math functions or may be emailed format checking utility.</li></ol>



<h3 class="wp-block-heading">LOGGING/TRACING</h3>



<ol><li>It is recommended to use logging, wherever possible. Purpose of the logging is to diagnose any potential issues in production. Logging is useful but it incurs significant overhead on the application so it must be used wisely and only information required shall be logged.</li><li>Logging should not be cluttered, it must follow same consistent pattern across the application. Identify a pattern for logging for your specific use case.</li><li>Logging libraries are incredibly useful. Use their package level capabilities to switch on/off selective logging at different levels.</li></ol>



<h3 class="wp-block-heading">EXCEPTION HANDLING</h3>



<ol><li>Do not suppress exceptions.</li><li>If an exception is explicitly raised in a function then it should not be handled in that same function. Create a separate function to handle exception and process.</li><li>Do not suppress original exception even if you have to create a new exception.</li><li>Try to use already available functions in logging libraries.</li><li>Comment on bypassing function i.e if we are passing any exception then mention in a comment why we are doing this.</li><li>Try following naming convention for exceptions as per your language e.g. Exception suffix in Java.</li><li>Do not write complex code in handler. Lot of times this code block throws an exception and hides original exception.</li><li>Read about exception handling best practices for your respective language and follow same.</li></ol>



<p></p><p>The post <a href="https://ezeiatech.com/code-quality-guidelines/">Code Quality Guidelines</a> first appeared on <a href="https://ezeiatech.com">Ezeiatech</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
