<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chetan Sharma</title>
    <description>The latest articles on DEV Community by Chetan Sharma (@chetan2309).</description>
    <link>https://dev.to/chetan2309</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F182517%2Fb4af1b4f-39d9-44c3-b9ee-667dbc161d9b.jpg</url>
      <title>DEV Community: Chetan Sharma</title>
      <link>https://dev.to/chetan2309</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chetan2309"/>
    <language>en</language>
    <item>
      <title>One month challenge to track your expenses</title>
      <dc:creator>Chetan Sharma</dc:creator>
      <pubDate>Tue, 24 Mar 2020 17:51:47 +0000</pubDate>
      <link>https://dev.to/chetan2309/one-month-challenge-to-track-your-expenses-2f95</link>
      <guid>https://dev.to/chetan2309/one-month-challenge-to-track-your-expenses-2f95</guid>
      <description>&lt;p&gt;I will keep this article short and crisp. This article is more of a challenge than a lazy reading routine. It's an activity which will engage your mind and body to make you aware of your spending habits and the areas in which you overspend. It's a challenge to track down your expenses. At the same time, if you do it regularly, I promise in 2-3 months time you will be in a better position to forecast your expenses and take necessary actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the challenge after all?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The challenge is simply to write down your daily expenses to minutest details. For example, if you have made a visit to a local restaurant, make an entry into the expense sheet. Give a logical name to the entry so that when you see it later, you will be able to recognize the expense made.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is there any specific pattern to follow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although there are already tons of available software, I maintain a very simple google spreadsheet. It consists of a main workbook containing one spreadsheet per month to track my monthly expenses. I am attaching here a &lt;strong&gt;&lt;a href="https://docs.google.com/spreadsheet/ccc?key=0AnPA74tl73-0dERfS2FzTVZoZFNLMDZVUzJzNkRDMGc&amp;amp;usp=sharing"&gt;spreadsheet&lt;/a&gt;&lt;/strong&gt; that I use. You can use a notebook also. But I find the “spreadsheet way” to be more time effective and overall more efficient. I can copy a month’s expense format to other months and can just delete the not required entries. Also, editing is very easy with a spreadsheet as compared to maintaining a notebook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the purpose of this exercise for 30 days?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is scientifically proven that 95% of a person's life is operated by unconscious mind. Our actions to certain situations are almost automatic. When someone yells at us we have a definite pattern in which we react to this situation. This unconscious mind is not that bad. It's only because of unconscious mind that we are able to drive a car automatically. The unconscious mind registers events. The conscious mind delegates repeated tasks to unconscious mind so that it can do some other new challenging tasks. This registering of events with unconscious mind takes a little time. Similarly, your financial world or situation is also running in an auto-pilot mode. In order to make some changes to it you need to develop a way or habit that can give you clear image of our spending habits. And by using this image you can introspect our current financial situations and can help your unconscious mind to register healthy financial habits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the benefits of doing this?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The other benefits of writing or tracking down your expenses are:-&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A 30 day challenge will give you ample time to form a new habit and you will get enough data to analyze your spending habits.&lt;/li&gt;
&lt;li&gt;I don't know how it will work on an individual basis, however, when I know I will have to write an expense in my spreadsheet, it makes me more mindful about what I am going to spend on. This has saved me from doing impulse spending.&lt;/li&gt;
&lt;li&gt;The insights that you will gain, &lt;em&gt;how much I spent on what?&lt;/em&gt; may help curb few bad financial choices you are making in your life.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Who all should write down the expenses?&lt;/strong&gt;&lt;br&gt;
Anyone who wants to improve his or her financial situation no matter where he or she is right now.&lt;/p&gt;

&lt;p&gt;While I was in deep debt, one of my family members advised me to track down my expenses. I looked out for a few software and finally settled for a basic &lt;strong&gt;&lt;a href="https://docs.google.com/spreadsheet/ccc?key=0AnPA74tl73-0dERfS2FzTVZoZFNLMDZVUzJzNkRDMGc#gid=0"&gt;spreadsheet&lt;/a&gt;&lt;/strong&gt; which I prepared for myself. When I started writing entries I realized I was spending 10% of my salary on fuel. This expenditure was mainly to travel to and fro from office. I realized that if I keep traveling by car, how can I expect myself to be out of debt? However, there was a bigger reason to opt for public transport. Traveling by car increased my travel time due to peak hours traffic. So, I opted to travel by the Metro, thus helping me save on both time and money. This brought down my expenses on traveling by almost 75%.&lt;/p&gt;

&lt;p&gt;Similar realizations came for expenses such as frequently eating out. I was spending 10% of my salary on this. This was turning out to be expensive for both &lt;strong&gt;my pocket and belly&lt;/strong&gt; :) . These choices were not purely financial but were able to help me introspect other aspects of my life.&lt;/p&gt;

&lt;p&gt;The next area in which I was overspending, about which I was ignorant, was money spent on clothing. I was spending about 15% of my salary on clothing, shoes and other stuff. Most of these spending were impulse-driven. I realized, during this period of my life that I was a little low on happiness index and I associated my happiness with buying stuff which were non-essential.&lt;/p&gt;

&lt;p&gt;These were my personal realizations when I tracked my expenses. You will also be surprised by the amazing revelations it will bring. &lt;strong&gt;It will reveal your authentic self to you.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's more than money Honey!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The benefits associated of tracking down your expenses are more than purely financial. It was difficult to build this habit of tracking expenses every day for 5-10 minutes. I am successfully carrying out this exercise for almost 2 years with at least 98% accuracy. The benefits of tracking down were quite revealing. Few of them I have already shared: becoming aware of spending habits, associating happiness to buying clothes and eating very often outside that dampened my health and made me overweight.&lt;/p&gt;

&lt;p&gt;Not only my financial situation improved because of cutting down expenses but also my self esteem and confidence. You will be surprised to see that it may even help to cut down on smoking, drinking and other non-essential spending. Once you will strengthen one of the body muscles, it will have a ripple effect and will help you improve other areas of your life. It's like spending time in gym to strengthen your muscles and the lasting effects of good health will spill in other areas of your life. &lt;strong&gt;Once your willpower becomes stronger, it touches everything.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The results of following all these were amazing in my life. By following this 5-10 minutes daily ritual I was able to pay off around 1.9 Million Indian rupees in debt. Not only this, I now have a &lt;strong&gt;6 months of emergency fund&lt;/strong&gt;. I am now currently working to build &lt;strong&gt;2 years worth of emergency fund&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The whole exercise is again becoming mindful about your &lt;strong&gt;money&lt;/strong&gt; and your &lt;strong&gt;life&lt;/strong&gt;. The whole purpose of this exercise is to make you become mindful about your lifestyle. Otherwise we normally live in fragments. When you become mindful, you feel more connected to your life and to people who you love. As I said, the benefits are not purely financial; they are amazing. It's not about money, Honey!!&lt;/p&gt;

</description>
      <category>mindfulness</category>
      <category>money</category>
      <category>motivation</category>
      <category>finances</category>
    </item>
    <item>
      <title>Pareto principle for Web development</title>
      <dc:creator>Chetan Sharma</dc:creator>
      <pubDate>Fri, 24 Jan 2020 11:54:37 +0000</pubDate>
      <link>https://dev.to/chetan2309/pareto-principle-for-web-development-9ph</link>
      <guid>https://dev.to/chetan2309/pareto-principle-for-web-development-9ph</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Pareto_principle"&gt;Pareto principle&lt;/a&gt; - named from after Italian economist Vilfredo Pareto showed that approximately 80% of the land in Italy was owned by 20% of the population. Amazed by Pareto's principle, I thought how I could apply this rule for website‘s optimization?&lt;/p&gt;

&lt;p&gt;It made me think what are those 20% things that I can do that will help me score big performance gains on website optimization. To be precise 80%. These tweaks, in turn, will contribute to reducing the page load time considerably.&lt;/p&gt;

&lt;p&gt;After building numerous websites/web-applications and by observing errors still made by developers due to naivety, I concluded following errors were still made and have a significant impact on website's performance and its load time.&lt;/p&gt;

&lt;p&gt;For this article, I will limit my discussion on few key points that if fixed with few hours of effort will create a significant impact.&lt;/p&gt;

&lt;p&gt;I use Kentico CMS for developing large websites, and my examples will include snapshots of how it is done in Kentico. However, to make this discussion technology agnostic I will provide a relevant technology agnostic example.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Minify your Javascript&lt;/strong&gt; - The most common error which developers make is not keeping Javascript minified. Minification reduces the size of a resource by as much as by 80% thus reducing the amount of data transferred over HTTP. Kentico provides an excellent solution where you don’t have to run a build process to get a minified JS. Developers can keep writing code in the way, and it will be served minified on the fly. A Win-Win situation for everyone.&lt;/p&gt;

&lt;p&gt;Referring a file in Kentico like below will not result in minification.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/CMSScripts/jquery/jquery.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Referring a file in Kentico like below will result in minification.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/CMSPages/GetResource.ashx?scriptfile=/CMSScripts/jquery/jquery.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Non-Kentico users can use a service like Google’s Closure compiler to minify and bundle code. A good thing about Google’s Closure Compiler is that I can check for dependency among JS files to correctly bundle them as one file which Kentico cannot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Minify CSS&lt;/strong&gt; - Another common error which developers make is not minifying CSS file. Minifying a CSS file will result in 80% reduction in payload transfer over HTTP. You can easily achieve this with Kentico.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;CMSPages/GetResource.ashx?stylesheetname=stylesheet_file&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 = CSS  minification is working.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;CMSPages/GetCSS.aspx?stylesheetname=stylesheet_file&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
 = No minification. &lt;/p&gt;

&lt;p&gt;Non-Kentico users can use an excellent service like &lt;a href="http://cssnano.co/"&gt;cssnano&lt;/a&gt; or &lt;a href="https://css.github.io/csso/csso.html"&gt;csso&lt;/a&gt; to minify CSS. Both tools do a great job.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Enable Gzip compression&lt;/strong&gt; - There is no reason not to use this provided it is already built-in configurable feature in all application servers. &lt;/p&gt;

&lt;p&gt;You can test whether your website has Gzip enable or not - &lt;a href="https://www.giftofspeed.com/enable-gzip-compression/"&gt;Enable Gzip Compression&lt;/a&gt; It also has ways through which gzip can be turned for Apache, IIS servers.&lt;/p&gt;

&lt;p&gt;Website Gzip compression can reduce the size of an HTML page by 30% and can lessen the size of a JSON response by up to 80%. Gzip compression results in fewer payload transfers over HTTP&lt;/p&gt;

&lt;p&gt;In Kentico it can be done by going to Settings -&amp;gt; System -&amp;gt; Performance&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Leverage browser caching&lt;/strong&gt; -  Every time a browser loads a web page it has to download all the various web resource files to display the page correctly. These resources include all the HTML, CSS, JavaScript, and images. During initial page load (a.k.a without cache) it is bound to happen. However, the idea of leveraging is to not re-load static resources on subsequent calls. These resources are the ones who don't change over time like JS, CSS or Images.&lt;/p&gt;

&lt;p&gt;Twitter on average load 3+ MB on its initial page load request. Loading all these resources over and over will create a bad UX for Twitter users.&lt;/p&gt;

&lt;p&gt;The issue is a double-edged sword.&lt;br&gt;
These large files take longer to load on a slow internet connection. Bad user experience(UX)&lt;br&gt;
Each resource request makes a separate request to the server means more non-asynchronous or blocking calls thereby reducing your page speed and increasing page load time.&lt;/p&gt;

&lt;p&gt;Remember no caching means no performance.&lt;/p&gt;

&lt;p&gt;Kentico is just ASP.NET application, so likewise leverage browser caching can be implemented by adding one line your web.config file like this under  tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;staticContent&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;clientCache&lt;/span&gt; &lt;span class="na"&gt;cacheControlMode=&lt;/span&gt;&lt;span class="s"&gt;”UseMaxAge”&lt;/span&gt;  &lt;span class="na"&gt;cacheControlmaxAge=&lt;/span&gt;&lt;span class="s"&gt;”365.00:00:00”&lt;/span&gt; &lt;span class="na"&gt;cacheControlCustom=&lt;/span&gt;&lt;span class="s"&gt;”public”&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/staticContent&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above code will set caching for static resources for 365 days. The format is days:hours:minutes:seconds&lt;/p&gt;

&lt;p&gt;Gtmetrix has explained enabling browser caching for Apache server &lt;a href="https://gtmetrix.com/leverage-browser-caching.html"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Use CSS sprites instead of individual images&lt;/strong&gt; - Combining images into as few files as possible using CSS sprites reduces:-&lt;/p&gt;

&lt;p&gt;a.  the number of round-trips and delays in downloading other resources&lt;br&gt;
b.  reduces request overhead, and&lt;br&gt;
c.  can reduce the total number of bytes downloaded from a web page.&lt;/p&gt;

&lt;p&gt;For this optimization, images that are part of website theme are the ideal candidate like site logos. This step should be discussed with your site designers upfront before starting the development process. Remember, every HTTP request is blocking call that will defer/delay loading of the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Use external CSS and JS&lt;/strong&gt; - Any static resource if combined with power leveraging browser caching will reduce the size of a page on each page load. For this reasons CSS and JS files should be kept separate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Optimize load order for CSS and JS loading&lt;/strong&gt; - A simple but yet often ignored rule is the ordering in which CSS and JS files are loaded.&lt;br&gt;
i. Load CSS files in the head tag of a page&lt;br&gt;
ii. Load JS at the end of the page - Defer loading of JS if possible. A better strategy is to load only specific JS using tools like &lt;a href="http://requirejs.org/"&gt;RequireJS&lt;/a&gt;, or combine all JS files into one file using tools like &lt;a href="https://developers.google.com/closure/compiler/"&gt;Google Closure Compiler&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are other 20+ parameters that should be considered while developing a website. However, the performance gains using at least these seven principles will create maximum impact on your website’s performance and are in line with Pareto’s principle.&lt;/p&gt;

&lt;p&gt;Further useful links&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/speed/pagespeed/insights/"&gt;Google PageSpeed insights&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gtmetrix.com/"&gt;GTMetrix&lt;/a&gt;&lt;br&gt;
&lt;a href="http://yslow.org/"&gt;Y-slow by Yahoo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>optimization</category>
      <category>web</category>
      <category>pareto</category>
      <category>kentico</category>
    </item>
  </channel>
</rss>
