<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sailee Renapurkar on Medium]]></title>
        <description><![CDATA[Stories by Sailee Renapurkar on Medium]]></description>
        <link>https://medium.com/@saileerenapurkar?source=rss-d6cfbd35ba43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dtVKiru5GnjSjxsMXh0pVA.jpeg</url>
            <title>Stories by Sailee Renapurkar on Medium</title>
            <link>https://medium.com/@saileerenapurkar?source=rss-d6cfbd35ba43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:39:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saileerenapurkar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Culture as a synonym for growth]]></title>
            <link>https://medium.com/inspiredbrilliance/trust-transparency-and-a-culture-of-growth-ea1b124fc9d7?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1b124fc9d7</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Wed, 07 Dec 2022 05:09:54 GMT</pubDate>
            <atom:updated>2022-12-12T05:20:15.318Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is a company’s culture?</strong></p><p>As the IT industry and the people within it mature, there is a greater emphasis and attention to the effort an organization expends in building a work environment that is conducive for transparency, free thinking and creativity.</p><p>But what is a company’s culture? In my view, it is an organizations’s set of values, attributes and characteristics. It is the manner in which a company conducts itself and enables its people, provides a safe space so that people’s voices and opinions find outlet in day-to-day matters. I would go so far as to say that culture is the soul of an organization. It is just as valuable, if not more, as the nature of work and the compensation of an individual.</p><p>From my experience, company culture should ideally lean heavily on trust, respect and providing agency to people to participate in the decision-making process. I further feel that a flat organizational structure is an essential ingredient in fostering a great culture; removing management layers encourages creativity, opens communication channels and harbours transparency — all of which adds up to people experiencing a heightened sense of ownership.</p><p><strong>Why does it matter?</strong></p><p>A plant that blossoms and bear fruits has been watered religiously and cared for. The more an organization invests in an individual’s growth and well-being, greater is the likelihood that the person will be self-motivated and work effectively without any supervision. Further, if openness and candid conversations are encouraged, challenging the status quo becomes second nature, leading to honest evaluation and eventually, evolution. This spills over to work and its many intricacies; approaching a problem not with a technology mindset but a solutioning mindset, having the support and freedom to try new things and discover the breadth of one’s potential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*z8t18_12TKtE5xwF.png" /></figure><p>It has been almost 2.5 years since I started working at Sahaj. I consider myself fortunate to have started my career here. At work, in addition to client projects, I have been involved in a host of activities that required a lot of decision-making and what seemed like a daunting task at first, has become second nature to me.</p><p>During the initial phase of the pandemic, I was amazed when everyone’s thoughts, including freshers, was taken into consideration for making a decision about pay hikes instead of simply imposing a decision on people. I felt an unprecedented sense of ownership. Recently, as part of a marketing campaign in Nagpur, I appeared on hoardings as the face of Sahaj, among other individuals. Even though I am surrounded by professionals in this company with over decades of experience, I have always felt equally valued — this sentiment right here is the legacy of Sahaj’s culture and it is irreplaceable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea1b124fc9d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inspiredbrilliance/trust-transparency-and-a-culture-of-growth-ea1b124fc9d7">Culture as a synonym for growth</a> was originally published in <a href="https://medium.com/inspiredbrilliance">inspiringbrilliance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trust, Transparency and a culture of growth]]></title>
            <link>https://saileerenapurkar.medium.com/culture-shapes-me-7c76c3b3d64a?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c76c3b3d64a</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Tue, 28 Jun 2022 06:56:24 GMT</pubDate>
            <atom:updated>2022-12-04T23:19:09.471Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Trust, Transparency and a culture of growth</strong></p><p><strong>What is a company’s culture?</strong></p><p>As the IT industry and the people within it mature, there is a greater emphasis and attention to the effort an organization expends in building a work environment that is conducive for transparency, free thinking and creativity.</p><p>But what is a company’s culture? In my view, it is an organizations’s set of values, attributes and characteristics. It is the manner in which a company conducts itself and enables its people, provides a safe space so that people’s voices and opinions find outlet in day-to-day matters. I would go so far as to say that culture is the soul of an organization. It is just as valuable, if not more, as the nature of work and the compensation of an individual.</p><p>From my experience, company culture should ideally lean heavily on trust, respect and providing agency to people to participate in the decision-making process. I further feel that a flat organizational structure is an essential ingredient in fostering a great culture; removing management layers encourages creativity, opens communication channels and harbours transparency — all of which adds up to people experiencing a heightened sense of ownership.</p><p><strong>Why does it matter?</strong></p><p>A plant that blossoms and bear fruits has been watered religiously and cared for. The more an organization invests in an individual’s growth and well-being, greater is the likelihood that the person will be self-motivated and work effectively without any supervision. Further, if openness and candid conversations are encouraged, challenging the status quo becomes second nature, leading to honest evaluation and eventually, evolution. This spills over to work and its many intricacies; approaching a problem not with a technology mindset but a solutioning mindset, having the support and freedom to try new things and discover the breadth of one’s potential.</p><p>It has been almost 2.5 years since I started working at Sahaj. I consider myself fortunate to have started my career here. At work, in addition to client projects, I have been involved in a host of activities that required a lot of decision-making and what seemed like a daunting task at first, has become second nature to me.</p><p>During the initial phase of the pandemic, I was amazed when everyone’s thoughts, including freshers, was taken into consideration for making a decision about pay hikes instead of simply imposing a decision on people. I felt an unprecedented sense of ownership. Recently, as part of a marketing campaign in Nagpur, I appeared on hoardings as the face of Sahaj, among other individuals. Even though I am surrounded by professionals in this company with over decades of experience, I have always felt equally valued — this sentiment right here is the legacy of Sahaj’s culture and it is irreplaceable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsWLUQWn80COVNgmdrtN_w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c76c3b3d64a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It's All About Your Priorities.]]></title>
            <link>https://medium.com/inspiredbrilliance/its-all-about-your-priorities-a3cdefea83cc?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3cdefea83cc</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 12:35:35 GMT</pubDate>
            <atom:updated>2021-11-29T07:22:38.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e39s_eUReD7h8nZQcIGdNg.png" /></figure><p>One day, as I was browsing through the profiles of my colleagues from the last 2 years, I began noticing with amazement the steps people had taken to arrive where they had in their careers. I concluded that there are broadly two kinds of people. One is the type who started their career with small companies and became part of the high-flying FAANG or should I say, MAANG. The other set of people who did get an opportunity to work with such big organizations early in their careers however, left them and are now part of other organizations that although are great places to work, are not as well established as the MAANGs. I was curious.</p><p>Why would an individual do that? Shouldn’t 100% of people in our industry belong to type one? I discussed this with folks at my current workplace Sahaj and my previous organization as well. After a few very long discussions with multiple folks, I started making sense of the situation. Here is what I have gathered.</p><p>When we talk about people, there is no one template to answer what an individual seeks from his/her career. Different people seek different things.</p><p>For a lot of us, a crucial factor is money. But there is another section, a smaller percentage, that seeks something different. I know people who prioritize other aspects of work over money. That is not to say that they are being paid very little. In addition to being paid a decent amount, they get other benefits that they value more. I will talk about them shortly.</p><p>After spending almost 2 years now at Sahaj and working with some of the most talented minds in our industry, I was curious — why don’t they switch to a better-paying company? So, I discovered some of the aspects that people prioritize over money and it had a profound effect on me as an individual. Let’s discuss each one by one:</p><p><strong>1. Working with a small, growing company:</strong></p><p>Some people prefer to be part of a growing organization as opposed to working with an established one. Being part of such an organization where you not only contribute to your project but other aspects of growth as well can be incredibly fulfilling. In such organizations, you not only discover your technical skills but other important softer professional skills as well and observe how an organization builds brick by brick.</p><p>In a small and growing organization, one can see how what they do is needed and creates an impact to achieve the larger purpose of the organization. This exposure is very limited and visible to only a handful of people in a big, established organization. The job is limited to a role. Very rarely, people get involved in other aspects relating to the company’s growth. If you are the kind of person who wants to mind his own business, meaning, you love the part of the job you do and don’t want to tinker in other things, this aspect does not apply to you. Simply put, some people want to work at a small firm and make a big difference rather than working in a big firm and making no/little difference.</p><p><strong>2. Nature and quality of exposure:</strong></p><p>When I say nature or quality of exposure, I mean the opportunity for you to interact with a rich variety of people — people who are doing totally different work and belong to very different functions than yours. Hierarchical and vertical structures in many big companies isolate people resulting in the deterioration of the quality of communication between people. I feel that for people new to the industry, these interactions can be vital in seeding and nurturing critical and holistic broader thinking. Even if hierarchies are to be maintained, they should not become barriers between individuals.</p><p><strong>3. Variety of technologies:</strong></p><p>Some people are very particular when it comes to brand vs technology. Some prefer the brand even if the technology they are working on is old. But some prefer the tech stack over the brand. Both have their pros and cons.</p><p><strong>4. The organizational culture:</strong></p><p>We all have different thoughts when we hear this term — “Organizational Culture”. After working in different companies over a period of time, we realize what kind of culture is conducive for us to grow professionally and personally. This surely does not relate to the company being a huge brand! I have already now seen and interacted with people who worked in big MNCs but now are working for much smaller organizations; one of the crucial reasons for them to make this choice was the organizational culture.</p><p><strong>5. Privilege to explore other opportunities:</strong></p><p>We are constantly exploring ourselves. After working in a certain role, we can understand if we want to continue on that path. But it is hard to assess which role would we enjoy the most. At this point, I would like to talk about Sahaj where you can explore different roles and take on different responsibilities as a solution consultant and hone your skills. Right from being an analyst, full-stack developer, tester, DevOps, etc. to product manager, you can be all of this every single day! This type of environment can be highly productive for people who want to work on projects end to end or for people seeking their core area of interest.</p><p><strong>6. Work-life balance:</strong></p><p>Isn’t this the most discussed aspect of our work/lives these days? Many of us hardly find time for anything other than work — time to pursue a hobby, for example. It should come as no surprise then that this is one of the major factors people take into consideration when choosing the company. But this also depends on our interests and aspirations — what exactly do we want to do in life?</p><p>While I have listed some of the reasons that I think play a crucial role in making career choices, I am sure there are many more. And most importantly, there is no right or wrong. Every individual has priorities in life and takes decisions accordingly. At the end of the day, getting what we really want is the key to satisfaction and happiness — the basic aim in life. My intention behind this blog was to make you think — what really matters to you and possibly help make some career choices a bit more wisely.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3cdefea83cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inspiredbrilliance/its-all-about-your-priorities-a3cdefea83cc">It&#39;s All About Your Priorities.</a> was originally published in <a href="https://medium.com/inspiredbrilliance">inspiringbrilliance</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Minimalist approach to Good health!]]></title>
            <link>https://saileerenapurkar.medium.com/a-minimalist-approach-to-good-health-aa83550f5875?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa83550f5875</guid>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[healthy]]></category>
            <category><![CDATA[healthy-living]]></category>
            <category><![CDATA[healthy-lifestyle]]></category>
            <category><![CDATA[health]]></category>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Tue, 28 Sep 2021 07:15:32 GMT</pubDate>
            <atom:updated>2021-09-28T07:15:32.706Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HvnvLDYv57jzbVyqKdTmYA.png" /><figcaption>Picture courtesy: againdrinks.com</figcaption></figure><p>I remember before the pandemic hit the world, most of us were engaged in at least a little physical activity. Maybe walking from parking to the office or climbing steps or going to the tea break during breaks. For most of us, since lockdown, everything is defined to our desks at home. We were suffering from anxiety, Insomnia, dizziness, being lethargic, unhappy…!</p><p>And for me, because of this lifestyle, I was not able to give my best in my job. After reading a lot about why this happens and ways to tackle it, I realized over a period of time, every action that we do, depends on our internal body condition. Our body needs some of the aspects that need to be done for the healthy working of it. In simple terms, our bodies are like a machine, if you don’t take care of it, issues will bubble up. After following some of the principles for quite a period of time, I have realized some ways to be a healthy and fitter individual. And hence, I thought of sharing with the people who are actually going through this. Let’s start with the Minimalist approach to Good health.</p><p>Disclaimer: I am neither a dietician nor a fitness expert, It’s all about my experience of how making small changes in my lifestyle I discovered better health and productivity.</p><p>I think that your health primarily depends on the following factors.</p><p><em>1. Movement throughout the day</em></p><p><em>2. Food that we consume</em></p><p><em>3. Water Intake throughout the day</em></p><p><em>4. Mental well being / Sleep</em></p><p>1. I cannot emphasize enough how important it is to move your body. When I say move, I mean at least walk, run, dance, anything that makes you happy. This not only helps in keeping your mind fresh but helps you in the smooth digestion of the food. I have indulged in a few activities that have helped me build a strong gut and stay energetic throughout the day.</p><p>a. Morning walk in the sunlight for 10–15 mins</p><p>b. Walk after your meals for 10 mins.</p><p>c. Try to walk as much as you can.</p><p>d. 20–30 mins Exercise /sport/dance any activity that you like, which involves movement.</p><p>We hear from multiple sources that walking 10000 steps a day keeps you fit! Sometimes these many steps can be discouraging. We can start with 5000 steps as compulsory and build on that.</p><p>This has helped me solve multiple problems that I suffered because of sitting at only one place for hours.</p><p>2. “We are what we eat”, this is rightly said.</p><p>As I mentioned earlier too, our body is like a machine.</p><p>For e.g if I keep feeding by bike with Kerosene and Petrol, what should I expect!!</p><p>Similarly, it is with our body. I am here not talking about any Fad diets or magic foods that need to be consumed. But something very simple.</p><p>a. 2 Fruits a day</p><p>b. 1 Green vegetable a day</p><p>c. Light food in the evening</p><p>d. Local and seasonal fruits and vegetables every day.</p><p>e. Dry Fruits like Walnuts and Almonds.</p><p>f. Say NO to packaged food.</p><p>g. Most Importantly, “Enjoy your Food”</p><p>I have been feeding myself a lot of junk food almost every day. I have experienced a lot of health issues because of this. I do not mean to stop eating food you like. Obviously, you can and you must. The secret behind this is “The Portion control”. Never Overeat. It disturbs our Gut and Our gut is the second brain of the human body. Think Twice before giving it anything. I loved Pizzas like anything. I used to have sometimes a complete Pizza. Now I have it once a month and 2 pieces of it. Another Fad going on in our society is to have shots that give you vitamins, minerals, proteins, etc. Instead, focusing on Local and Seasonal fruits and vegetables will give us much more than the packed items.</p><p>3. The amount of Water Intake you have throughout the day is very important to keep you fresh and energetic.</p><p>There were times when I had just a glass of water a day. Many of us confuse our thirst with “Hunger”. I did the same.</p><p>I used to open a packet of chips and have it. Frequent headaches and dullness were all I got. Here are a few tips for Water Intake.</p><p>a. 40: 90 min rule</p><p>b. 8–9 Glasses water every day.</p><p>c. First thing in the morning.</p><p>I have seen this happening right from my childhood. We used to drink a lot of water after meals. All it does is bring down the environment created in your stomach for digestion. Thus the poor digestion and problems like constipation, acidity. 40 mins prior to the meal and 90 mins after the meal, please avoid water. You can see the changes slowly.</p><p>4. Physical fitness is important, so is mental well-being. The first Key to have healthy mental health is sleep. A good sound sleep of 7–8 hours gives the body the total rest it needs for the next day. Another key that I have discovered is Pranayama/meditation/ yoga gives relaxation to your mind. It gives you clarity in your thought process. Practicing these activities 2–3 times a week has helped me to a great extent.</p><p>Finally, I would like to say that “Health Fit toh Sab Hit”. Why do we need to get into trouble to understand the importance of good health? Even if we are a lot busy with our lives, our careers, If we want to achieve something in our lives, the first step is your health. I have realized this with a lot of examples that I and people around me went through.</p><p>Very soon, when the world will go back to normal, these things will really benefit you in the long term. Even if you inculcate one habit a week, Congratulations, you have started on your fitness journey. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa83550f5875" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding your salary slip!]]></title>
            <link>https://saileerenapurkar.medium.com/understanding-your-salary-slip-f1f3900c8d4c?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1f3900c8d4c</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Wed, 30 Jun 2021 04:29:23 GMT</pubDate>
            <atom:updated>2021-07-01T04:17:30.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4WxBsOzC2P3pbGGQAx5vA.png" /></figure><p>The first thing after joining an organization, we all are excited about is our salary. But most of us do not understand why we got less than the CTC/12, why is my basic salary so less, which tax slab do I fall in? And many more such questions. For me, it really took some time to understand the “Contents” in my salary slip. I have tried keeping this explanation generic to the must components in the salary slip.</p><p>The “number ” that is present on your Offer Letter is the CTC. i.e the Cost to Company. It never happens that you get CTC/12 “in-hand”. CTC is the amount of money that it is spending on you directly or indirectly. CTC has various components other than taxes that most of us are unaware about initially viz PF, Gratuity, Basic Salary, lunch or snacks charges, etc according to the company.</p><pre>Employer Contribution to EPF + Gratuity + Gross = CTC [ In few companies variable pay/Bonus/Performance Incentive is also added ]</pre><p>Gross salary signifies the amount paid out to an individual before any voluntary or mandatory deductions are made from it. Therefore, it is the total pay that an employee receives before taxes and other deductions. Gross salary includes income from all sources and is not confined to only the income received in cash. Therefore, it also includes benefits or services received by an employee. On the other hand, the salary that an employee takes home is the net salary after all the deductions.</p><pre>Gross Salary = Basic Pay + Allowance [ HRA, LTA etc..] + Employees contribution to EPF</pre><pre>Net Pay [ Take home ] = Gross - Income tax and other deduction like professional tax</pre><p>I had felt very disappointed when I saw the basic salary on my payslip. But eventually, I understood, the less the basic salary the more tax-saving options you have. So, the basic salary is generally 30–40% of the gross salary and is “100% taxable”, which means you cannot use any tax saving options to save it. As per the new wage bill, this will be changed by the Govt of India, and basic pay will be 50% once the law is implemented.</p><p>The next one is the “HRA <em>(House Rent Allowance)</em>”. If you are a salaried employee, the government of India states that the money that you are paying as rent, can be claimed as income and you can get tax benefits on it. There are three ways of calculating the HRA and is minimum amongst the three value obtained from:</p><p>10% of basic OR 50% of basic if you live in a metropolitan city or 40% of basic in a non-metropolitan city.</p><p>At the start of the financial year, you need to declare the amount per month you are going to pay as rent and at the end of the financial year, you need to submit the proof consisting of the rental agreement or the receipt from the landlord signed statement that you have paid the rent for the claimed period.</p><p>The next one is the Medical allowance. This allowance is mostly fixed at Rs. 1,250 per month (Rs. 15,000 per year) — the maximum amount which you can claim as reimbursement if you submit bills incurred on medical expenses for self or dependents. If no bills are submitted, the entire amount is added to your taxable income.</p><p><strong>Deductions:</strong></p><p>The three types of deductions in a salary slip are</p><p><strong>Professional Tax:<br></strong>Professional tax is a small tax levied by state governments on earning professionals. It is payable only in a few states. Namely, Karnataka, West Bengal, Andhra Pradesh, Telangana, Maharashtra, Tamilnadu, Gujarat, Assam, Chhattisgarh, Kerala, Meghalaya, Orissa, Tripura, Jharkhand, Bihar, and Madhya Pradesh. This amount is deducted from the taxable income. Also, it usually amounts to just a few hundred rupees each month</p><p><strong>Income Tax:</strong><br>It is the amount deducted by the employer on behalf of the income tax department. It is based on the gross tax slab of the employee. One can reduce this amount by investing in tax-exempt investments like equity funds (ELSS), PPF, NPS, and tax-saving FDs. It appears on the deductions side of the salary slip. Hence, investing in section 80C instruments of the Income Tax Act increases your take-home salary. One can invest in mutual funds (ELSS), submit investment proof to the company, and claim TDS returns. You can find your tax slabs <a href="https://www.iciciprulife.com/insurance-library/income-tax/income-tax-slabs-rate-deductions.html">here</a>.</p><p><strong>Employee Provident Fund<br></strong>A provident fund is a compulsory, government-managed retirement savings scheme used in Singapore, India, and other developing countries. Workers give a portion of their salaries to the provident fund and employers must contribute on behalf of their employees. The money in the fund is then held and managed by the government and eventually withdrawn by retirees or, in certain countries, their surviving families. In some cases, the fund also pays out to the disabled who cannot work. Also, the fund pays to the folks that are going to pursue higher education.</p><p>There can be some variations in the structure company-wise. But I tried explaining the most generic terms in an easy way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1f3900c8d4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Essentials]]></title>
            <link>https://saileerenapurkar.medium.com/javascript-essentails-c6b29ee1a44e?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6b29ee1a44e</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Sat, 29 May 2021 10:23:08 GMT</pubDate>
            <atom:updated>2021-05-31T05:37:32.020Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started working on Javascript, I often used to get confused with callbacks, asynchronous functions, promises, async/await. These were the concepts that were almost used every day while development. Over time, I have understood the difference and thought of explaining those concepts in a very simple and easy-to-understand way for people who are new to this. This blog is about the basic understanding of these concepts and will help you dive deeper into them further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*W4IMRQe1RxNocB5sXyPfWQ.jpeg" /></figure><p><strong>Javascript Callbacks:</strong></p><p>A callback is a function passed as an argument to another function. This technique allows a function to call another function. A callback function can run after another function has finished.</p><p>In Javascript, functions are executed in the sequence in which they are called and not in the sequence they are defined. Let me explain this with an example</p><p>e.g</p><pre>function sayHi() {<br> display(“Hi”);<br>}</pre><pre>function sayBye() {<br> display(“Goodbye”);<br>}</pre><pre>sayBye();<br>sayHi();</pre><p>This will end up displaying<em> “Bye” and then“Hi”.</em></p><p>Sometimes we would like to have control over function as to when to execute it.</p><p>Consider a scenario where you want to display the file contents after the file has completely been loaded. Then this is the time to use a callback. As mentioned earlier, the callback is a function passed as an argument to another function.</p><p>Callbacks make sure that a function is not going to run before a task is completed but will run right after the task has been completed.</p><p>Let’s understand this with a simple example:</p><pre>const message = function() {<br> console.log(“This message is displayed after 3 seconds”);<br>}</pre><pre>setTimeout(message, 3000);</pre><p>the message function is being called after something happened (after 3 seconds passed for this example), but not before. So the message function is an example of a callback function.</p><p>Using a callback, you could call the calculator function with a callback, and let the calculator function run the callback after the calculation is finished</p><p>Remember, when you pass a function as an argument you don’t use the parenthesis.</p><p><strong>Asynchronous Javascript:</strong></p><p>The functions which do not block the execution thread are called asynchronous functions.</p><p>e.g Javascript setTimeOut()</p><pre>function display(result) {</pre><pre>document.getElementById(“demo”).innerHTML = result;</pre><pre>}</pre><pre>function getFile(myCallback) {</pre><pre>let request = new XMLHttpRequest();</pre><pre>request.open(‘GET’, “car.html”);</pre><pre>request.onload = function() {</pre><pre>if (request.status == 200) {</pre><pre>myCallback(this.responseText);</pre><pre>} else {</pre><pre>myCallback(“Error: “ + request.status);</pre><pre>}</pre><pre>}</pre><pre>request.send();</pre><pre>}</pre><pre>getFile(display);</pre><p>In the example above, a display is used as a callback.<br>Instead of passing the function reference as an argument, we can pass the whole function itself.</p><pre>setTimeout(function() { document.getElementById(“demo”).innerHTML = “Fun”; }, 1000);</pre><p><strong>Javascript Promises:</strong></p><p>Producing code is code that can take some time<br>Consuming code is code that must wait for the result</p><p>A Promise is a JavaScript object that links producing code and consuming code or we can say that A promise is an object that may produce a single value some time in the future: either a resolved value or a reason that it’s not resolved (e.g., a network error occurred).</p><p><em>Promise Syntax:</em></p><pre>let promise = new Promise(function(resolve, reject) {</pre><pre>// producing code (can take some time)</pre><pre>resolve(result value); // when successful</pre><pre>reject(error object); // when error</pre><pre>});</pre><pre>// consuming code (must wait for fulfilled promise)</pre><pre>myPromise.then(</pre><pre>function(value) {//todo when successful},</pre><pre>function(error) {//todo when failure }</pre><pre>);</pre><p>When the producing code obtains some results it should be one of the following callbacks based on the result.</p><ol><li>Success -&gt; resolve(result value)</li><li>Error -&gt; reject (error object)</li></ol><p>Promises allow us to associate actions to be executed after the eventually obtained success value or failure value.</p><p>A Promise is in one of these states:</p><ul><li>pending: initial state, neither fulfilled nor rejected.</li><li>fulfilled: meaning that the operation was completed successfully.</li><li>rejected: meaning that the operation failed.</li></ul><pre>function display(result) {<br>document.getElementById(“demo”).innerHTML = result;<br>}</pre><pre>let loadFile = new Promise(function(resolve, reject) {<br>let request = new XMLHttpRequest();<br>request.open(‘GET’, “flower.html”);<br>request.onload = function() {<br>if (request.status == 200) {<br> resolve(request.response);<br>}else{<br> reject(“File not Found”);<br> }};<br> request.send();<br>});</pre><pre>loadFile.then(<br>function(value) {display(value);},<br>function(error) {display(error);}<br>);</pre><p><strong>Javascript Async:</strong></p><p>async makes a function return a Promise.<br>await makes a function wait for a Promise.</p><p><strong><em>Async syntax:</em></strong></p><p>The keyword async before a function makes the function return a promise:</p><pre>async function myFunction() {<br>return Promise.resolve(“Hello”);<br>}</pre><p><strong><em>Await syntax:</em></strong></p><p>The keyword await before a function makes the function wait for a promise</p><pre>let value = await promise.</pre><p>The await keyword can only be used inside an async function.</p><p>E.g</p><pre>async function getFile() {<br>let myPromise = new Promise(function(myResolve, myReject) {<br>let req = new XMLHttpRequest();<br>req.open(‘GET’, “mycar.html”);<br>req.onload = function() {<br>if (req.status == 200) {myResolve(req.response);}<br>else {myResolve(“File not Found”);}<br> };<br>req.send();<br>});<br>document.getElementById(“demo”).innerHTML = await myPromise;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b29ee1a44e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step up your code with Clean code -2]]></title>
            <link>https://saileerenapurkar.medium.com/step-up-your-code-with-clean-code-2-15924007e61b?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/15924007e61b</guid>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Wed, 31 Mar 2021 16:38:03 GMT</pubDate>
            <atom:updated>2021-03-31T16:38:03.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-Hee8iEsDH3q_4T3hVLDg.png" /><figcaption>Picture Credits: Waverley Software</figcaption></figure><p>They say when you practice a skill, you start loving it! The same happened to me! Thankfully our team here at Sahaj follows practices of code review before merging it with the main branch. Initially, I used to get a lot of review comments for modification in the way I had written code. Understanding the “Why” behind each review comment gave me a better understanding of writing clean code. My aim nowadays is to minimize the number of review comments on my PR! If there is none, I am the happiest creature! As with every individual, I am also learning each day. After writing <a href="https://medium.com/inspiredbrilliance/step-up-your-code-with-clean-code-1f49aa9c983a">my first blog on Clean code</a>, I think now is the time, I want to share my learnings further on this. I thought of mentioning the learnings that I got through review comments or discussions.</p><ol><li><strong>Variable naming conventions:</strong></li></ol><ul><li>Never use short forms for the names of variables.<br>-&gt; Never use pm for perimeter</li><li>Never name variables just to satisfy the compiler.<br>-&gt; Never use variable names as length2, length2</li><li>Avoid using words with the same meanings for different variables.<br>-&gt; FileData and FileInfo both sound similar</li><li>Include units of a measurable entity to its variable name<br>-&gt; Use timeInSeconds as a variable name rather than developer figuring out that time is in seconds</li><li>Add sufficient context to the name rather than telling the detail about it through variable names.<br>-&gt; The name should be as as long as it makes it easily understandable</li><li>Have consistency when it comes to defining operations for a particular task.<br>-&gt; if we are using fetch as the term to get data, we need to be uniform with that through out the codebase.</li></ul><p><strong>2. All about functions:</strong></p><ul><li>Functions should be really smaller.</li><li>One function should do one task only. If your function is doing two or more tasks, you should probably split it into two functions.</li><li>The code inside the if / else blocks should be only one line long. If it’s more than two/ Three lines it should mostly be a function call.</li><li>The maximum number of arguments for a function should be 3 or 4. If there are being more than the limit, it probably can be a class of its own.</li><li>The function should never modify its input parameters.</li><li>Extract Try/Catch blocks into one function. Error handling Is one responsibility, hence should be one different function.</li></ul><p><strong>3. All about Classes:</strong></p><ul><li>Classes should maintain encapsulation.</li><li>Classes should follow the Single responsibility principle.</li><li>Name of Class should tell its responsibility</li></ul><p><strong>4. Code Formatting:</strong></p><p>I initially thought code formatting is not that important, but when you work on a large codebase, and if the code is not formatted well enough, it’s definitely going to be irritating.</p><p>Few of the things I noticed in this regards are:</p><ul><li>Follow the same indentation level throughout the codebase.</li><li>Variables should be declared as close as possible to their usage.</li><li>All the private methods should be at the lower level in the class.</li><li>A single line should not have more than 120 characters.</li><li>There should be spaces between commas, operators.</li><li>Have one same check style.xml for the entire project, so that for every change, good formatting rules are followed.</li><li>Remove the unused imports.</li></ul><p>I am still exploring and learning how to write clean code. I would definitely suggest reading <a href="https://github.com/dev-aritra/clean-code-developer-checklist">“Clean code developer checklist”</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15924007e61b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Starting your journey as a developer]]></title>
            <link>https://saileerenapurkar.medium.com/starting-your-journey-as-a-developer-332d591f6635?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/332d591f6635</guid>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Sun, 28 Feb 2021 13:00:06 GMT</pubDate>
            <atom:updated>2021-02-28T13:00:06.503Z</atom:updated>
            <content:encoded><![CDATA[<h3>Starting your journey as a developer!</h3><p>DEVDAY is a monthly informal event organized by Sahaj for developers to share their experiences, ideas, opinions &amp; perspectives about technology. I have attended many of the talks. I was so motivated by the speakers that I definitely had a thought in my mind of giving a talk in the near future. But I didn’t know I would get this opportunity at such a stage in my career. My friend and colleague Kirti and I got an opportunity to be the speakers for Devday in Jan 2021. Initially, we were hesitant as we were not sure what exactly we can talk about with a very limited experience of 1.5 years. At the same time, many of the students had started with their internships at various organizations. We realized that if we had got some guidance/tips basics before starting our journey as a developer, we would have focused on the things ahead then.</p><p>So we came up with an idea to give a talk where we discuss some things that we wish we knew before joining as a developer. We prepared for this talk for about a month. The outline, abstract, script, and presentation. Lots of late nights and early mornings to get the best content that will be useful to the freshers out there.</p><p>For those who missed the talk, I thought of writing a blog so that it will be helpful for the freshers in their journey ahead.</p><p>We joined Sahaj about a year ago. Being a fresher we didn’t have any idea about how things work, how to work on large codebases etc. We went through a program called <a href="https://medium.com/inspiredbrilliance/gurukul-sahaj-software-1aaa9066afe3">Gurukul</a>, which gave a kick start to the Journey of being a software developer. We were introduced to some of the best practices followed while project development. After completing Gurukul, we started applying those concepts by working on some of Sahaj’s internal projects that are being used by people here. After working for a significant amount of time, we started getting confident about the work. And the time came when we had to join the client project. It’s been quite a good time now working on these projects. The main intention behind the talk was to give the freshers some ideas/ tips that can help them in their journey. Some things that we wish, we knew before joining as a developer.</p><p><strong>Difference between perspectives while working on Academic project and Client projects</strong></p><p>We start working on projects in the second or third year. For sure, there is a vast difference in the complexities involved in academic projects vs client projects. But there are some practices if followed while working on academic projects we could have developed the project much better and we would have also learned some of those practices earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwuq-s_x4rtop39XxMxqoA.png" /></figure><p><strong>ABCs to understand while starting on a new project:</strong></p><ul><li><strong>Talk to people:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*lDjSgwdW5dN2zivj" /></figure><p>As a new joiner, it is important to understand the company culture and all the practices followed by the team you are working on. Learn about the journey of the people around, their working experiences, etc. We should start interacting and socializing with the team, may it be going for a tea break or playing games during breaks at the office.</p><ul><li><strong>Ask a lot of questions</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*0ua6wHcH7H66lgA7" /></figure><p>Ask, ask, ask. No doubt is a silly doubt. I used to keep questions to myself considering it might be very simple, I can search, or I can see the implementation and figure this out later but asking the questions will help you to understand the business quickly. Never assume anything. Sometimes there might be scenarios where some of the decisions are based on some assumptions and are known only to team members who were part of the team at that point in time and it’s important to talk to the team and understand this instead of assuming.</p><ul><li><strong>Attentive in Standup</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9biC9_fclVkB-BwT" /></figure><p>Standup is daily catchup among the team where we give our work update status. It is also known as a daily scrum, scrum meeting.</p><p>It includes:</p><ul><li>What things I have worked on yesterday</li><li>What is the plan for today?</li><li>Calling out blockers if any in the quickest and shortest way possible and asking for help if required</li></ul><p>Standups are very crucial. It helps me to understand what is going on in the different areas (simultaneous features, infra) of the project.</p><ul><li><strong>Learn about the business</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*YmrfWxquVdEYO_td" /></figure><p>Regardless of what you do in your organization, your ultimate job is to fix the problems of your customers. So, do what you can to learn about them as much as possible, as early as possible. See if you can listen in on some sales calls or speak directly with customers, so you have a clear understanding of their mindset and needs.</p><p>Sometimes it can also be possible that customers are not that clear about what they want. Having direct interaction will help your team to brainstorm and define them. Not only that but this can also help the team to suggest to customers how can they leverage the existing system for new possibilities.</p><ul><li><strong>Active participation in meetings</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*MvnDkSY6JZ-2vlJn" /></figure><p>It’s understandable that you’ll have a lot to catch up on in a new job and may not have insights and opinions to share right out of the gate. You should aim to strike a balance between listening carefully (which will be extremely important in getting oriented) and speaking up or asking smart questions.</p><p>If you have any thoughts feel free to put them in front of the team. Two things can happen. Either you get confidence when you have made the correct statement or else you learn the correct by hearing others’ opinions on your statement. This way your thought process will start evolving<br> You can note down unknown points and discuss them later with any of your colleagues. Slowly you’ll be able to connect these dots for the unknown points.</p><p><strong>Some Tech-tips!</strong></p><ol><li><strong>How to approach any problem<br>- </strong>Have enough context<br>- Identify unknowns, complexities, dependencies<br>- Break down into smaller tasks<br>- Solve it on paper first and then convert it to code<br>- Timebound the problem</li><li><strong>How to deal with blockers:<br>- </strong>Spend some time to find the root cause<br>- Don’t fall into an infinite loop to find the cause, <strong>ask for help<br>- </strong>Share your learnings via blogs, videos, meetings</li><li><strong>Ask the right questions:<br></strong>Why is this new feature needed?<br>What would happen if …<br>How does this feature add value?<br>What architectural changes will have to be made?</li></ol><p><strong><em>Some must-haves before starting your journey:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9MxSJ0r1l1bks9eb" /></figure><p>Git is very essential when it comes to working in projects. Most organizations use GIT as their version control system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*zmqWrAW_uXXO5MUl" /></figure><p>We should get used to using the command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JiRGvgHevSI3FreI" /></figure><p>Get used to using an IDE of your choice and its shortcuts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*0n0KtryETumPo1c9" /></figure><p>Get proficient in at least one programming language of your choice. This gives you a general idea of how other languages work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YhRn51H9duTFL9rM" /></figure><p>Join various communities like meetups and LinkedIn and coding forums like CodeChef, hackerrank, Leetcode.</p><p>Sometimes things can start getting overwhelming, but focusing on what is required and gradually getting to know all the things works. Kirti and I hope that this blog will help you gain the initial confidence that is required when we start working on projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=332d591f6635" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[That's how 2020 rolled for me!]]></title>
            <link>https://saileerenapurkar.medium.com/thats-how-2020-rolled-for-me-f09e136d310c?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/f09e136d310c</guid>
            <category><![CDATA[2020]]></category>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Tue, 05 Jan 2021 17:51:36 GMT</pubDate>
            <atom:updated>2021-01-05T17:51:36.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tlpM9wQPD3casBCP" /></figure><p>Finally one of the most challenging years of my life and I believe many other people the year 2020 is over. The year 2020 has been a roller coaster; it started well but kept taking dramatic turns throughout. This year has taught me a lot, right from staying fit to overcome the obstacles faced while working remotely. 2020 definitely felt like survival of the fittest. As days passed one after the other it became increasingly difficult for people to remain optimistic. Things were getting from bad to worse as the year progressed due to the pandemic.</p><p>I believe many folks out there had started losing hopes with all the resolutions they made for this year. Remaining with a positive mindset was very difficult. I guess the year 2020 is an example of the year that comes I guess once in a century. Before I realized it was Diwali time, I was literally shattered by the thought of how fast all the months went by. Now when I introspect, I also realized that this period did certainly a lot of good also to me and felt that I should appreciate all those things that happened well to me during this year. So, I am collating all my experiences and learnings from this year in this blog.</p><p><strong>1. Got familiar with the crux of Software development.</strong></p><p>2020 started for me with an awesome program called <a href="https://medium.com/inspiredbrilliance/gurukul-sahaj-software-1aaa9066afe3">Gurukul</a> @ Sahaj. It was fun and lots of excitement to learn and embrace new skills. After a period of 45 days of Gurukul, we all started working on Internal projects. This was a great start towards an awesome Journey. The main goal of the program is to introduce graduates to the world of software development, along with ways to increase their confidence, sense of discipline, self-reliance, empathy, creativity, and mindfulness.</p><p><strong>2. I started blogging!</strong></p><p>Meanwhile, I had the Graduation Ceremony at College and I became an Engineer officially. That’s when I started writing blogs which I never thought I would love this much. And by the end of 2020, I had written 15 blogs!! And learned a lot in the process. The more I write the more I am learning.</p><p><strong>3. Lots and Lots of Family Time!</strong></p><p>At the start of the pandemic, Pune was one of the most affected cities in India. I was stuck alone at home in Pune for 3 months. This sudden change of loss of connectivity with everyone and managing office work and household chores together was too frustrating and demotivating, I somehow managed to keep my head in the right space with the help of friends and family over calls(Thanks to all the technology we have) I wonder how it would have been during Spanish flu time. Fortunately, I got an e-pass and I traveled to my home town. I am still here, at home, with my family. And honestly, I wish I could be here forever. During my education and later work, I had been away from family and home for years, and after so long I got to live this again. I am thankful that everyone in my family is fit and fine.</p><p><strong>4. I corrected by broken undisciplined life</strong></p><p>Because of living away from home for a long time, I had become the laziest version of myself who lived a very unhealthy life. I struggled with many problems because of such a routine of staying awake late at night and eating junk food often. Honestly, I thank my parents for making my life disciplined again. I will do my best to keep this discipline going once I am back in Pune in near future.</p><p><strong>5. I have constantly kept taking on new challenges</strong></p><p>Even though the majority of the year has been WFH, there were a number of opportunities in which I could challenge myself and become a better person. I took lunch and learn sessions, participated in the hiring process, had an amazing session with some of the high school students from the USA, and even did a showcase to the Client. Thanks to the amazing workplace and Mentors, for giving me the chance to do these things.</p><p><strong>6. Saw a bigger side of things</strong></p><p>As a fresher, one rarely gets to know how is revenue generated by an organization, why certain decisions are made the way they are, and what goes behind making such decisions which impact almost everyone in the organization.<strong> </strong>During this year, we got to participate in many such discussions making events. From deciding if we should share the profit we made among ourselves and should we delay our hikes to deciding what should be the percentage hike we as an organization can afford in the upcoming year and how it impacts our business in different ways. We were equally involved in all the decision-making irrespective of our experience levels. Sometimes things became too overwhelming but it was really awesome to experience at such a young juncture my career as a professional It definitely helped me expand my thinking. I still have so much more to learn and I am glad that the beginning for such things has already happened and I am sure with time I will get better at this also.</p><p>Though 2020 was a year of ups and downs, I learned one thing. We are unstoppable. If we wish to do something and apply ourselves, we will definitely achieve it, overcoming all the problems around us. In the end, it’s just another experience and an opportunity to be better. Let us hope that 2021 and the years to come will bring lots of positive changes, good health, and lots of opportunities and success. For sure at the end of 2020 I know I can be a lot stronger and I can not only simply survive, but I can also flourish and grow as an individual.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f09e136d310c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Streams In Java]]></title>
            <link>https://saileerenapurkar.medium.com/getting-started-with-streams-in-java-7008b8a366e7?source=rss-d6cfbd35ba43------2</link>
            <guid isPermaLink="false">https://medium.com/p/7008b8a366e7</guid>
            <category><![CDATA[javastreams]]></category>
            <dc:creator><![CDATA[Sailee Renapurkar]]></dc:creator>
            <pubDate>Sat, 26 Dec 2020 14:17:48 GMT</pubDate>
            <atom:updated>2020-12-26T14:17:48.814Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wF4lj2i--mkak27fJza3Lg.png" /></figure><p>A few months back, I started to work on a client project. For any story I used to work on, I used to do it in a procedural way meaning using the loops, iterating, performing some operations, and then returning. Thank god we have a system of reviewing PR before pushing code to master. I started to get feedback on how to improve my code and to write it in a more functional way, using streams. I was very curious that a small piece of code, easily readable and understandable was much better than my bigger one. So I thought of writing this blog for the new engineering graduates to get familiar with the quite easy way of doing things. So let’s begin!</p><p>Before we start with all the concepts, let’s see how we used to iterate a list and calculate the sum of the numbers less than 50.</p><pre>List&lt;Integer&gt; list = Arrays.asList(11,122,33,41,58);</pre><pre>int sum = 0;</pre><pre>Iterator&lt;Integer&gt; iterator = list.iterator();</pre><pre>while (iterator.hasNext()) {</pre><pre>int number = iterator.next();</pre><pre>if (number&lt; 50) {</pre><pre>sum += number;</pre><pre>}</pre><pre>}</pre><p>The above piece of code works totally fine, but we can see some issues with the code.</p><p>1. It is a pretty big code for calculating just the sum of numbers.</p><p>2. We need to think about using the correct way of iterating through the list.</p><p>3. We are describing a lot of what the code is doing i.e this is the descriptive way.</p><p>4. It is Sequential, There is no way to parallelize tasks with this approach.</p><p>In order to avoid these issues, Stream API was introduced which takes care of iteration internally. The above line can be shortened down to this:</p><pre>int sum = list</pre><pre>.stream()</pre><pre>.filter(number -&gt; number &lt; 50)</pre><pre>.sum();</pre><p><strong><em>So what are Java Streams?</em></strong></p><p>A stream is an abstraction, it’s not a data structure. It’s not a collection where you can store elements. The most important difference between a stream and a structure is that a stream never holds the data. For example, we cannot point to the location in the stream where a certain element exists. We can only specify functions that can be used within the data in a stream in some order. A Stream is functional in nature, which means that it does not modify its source when producing the result. Many operations can be executed lazily promoting high performance.</p><p>So basically, java streams are nothing but a pipeline through which data flows and operates it. The stream API gives us the power to perform a sequence of operations on the data in a more declarative way, not a descriptive one. This is the beauty of functional programming that gives abstraction over data as well as functions. We do not need to worry about how to perform complex operations on data. To sum up, the pattern generally used while using the streams is :</p><p>1. Send a collection into a stream</p><p>2. Let the stream flow through different operations (i.e filter, map, etc).</p><p>3. Collect results back.</p><p>A stream can be obtained in many ways:</p><p>1. By calling stream() and parallelStream() methods on a collection.</p><p>2. Arrays.stream(Object[]) on an array etc.</p><p>Stream operations can be divided into two types:</p><p>1. Intermediate</p><p>2. Terminal</p><p><strong>1. Intermediate Operations:</strong></p><p>The intermediate operation returns a new stream, for e.g when we say filter(&lt;predicate&gt;), it doesn’t actually perform filtering, but it will create a new stream that will contain the elements of the initial stream that matches the given predicate.</p><p>Let’s see some of the examples of Intermediate operations.</p><p><strong><em>a. filter():</em></strong></p><p>Filter operation accepts a predicate to compute which elements should be returned in the new stream and removes the rest.</p><p>When doing it in a declarative way we need to write if and else. But in a functional way, we only work on the type of values we require i.e predicate.</p><p>e.g</p><pre>List names = Arrays.asList(“abc”, “abd”, “aa”, “”, “bcd”, “acd”);</pre><pre>List result = names</pre><pre>.stream()</pre><pre>.filter(s-&gt;s.startsWith(“ab”) )</pre><pre>.collect(Collectors.toList());</pre><p><strong><em>b. Map():</em></strong></p><p>Map operation allows you to transform stream elements into something else. It accepts a function to apply to every element in the stream and returns the stream of values the parameter function has produced. It basically allows you to do computation on data inside the stream.</p><p>e.g</p><pre>List&lt;Integer&gt; list = Arrays.asList(1,2,3,4,5,6,7,8);</pre><pre>List&lt;Integer&gt; result = list</pre><pre>.stream()</pre><pre>.filter(num -&gt; num % 2 == 0)</pre><pre>.map(num -&gt; num*2)</pre><pre>.collect(Collectors.toList());</pre><p>It is filtering the list for the even numbers and multiplying the resultant by 2.</p><p><strong>2. Terminal Operations:</strong></p><p>All operations that return something other than stream are called terminal operations.</p><p>Examples of some of Terminal Operations are:</p><p><strong><em>a. collect():</em></strong></p><p>collect() operation is simply used to collect the elements in a stream.</p><pre>List&lt;Integer&gt; list = Arrays.asList(1,2,3,4,5,6,7,8);</pre><pre>List&lt;Integer&gt; result = list</pre><pre>.stream()</pre><pre>.filter(num -&gt; num % 2 == 0)</pre><pre>.map(num -&gt; num*2)</pre><pre>.collect(Collectors.toList());</pre><p>Here we are collecting the resultant stream into a new collection result.</p><p><strong><em>b. anyMatch():</em></strong></p><p>anyMatch() operation takes a predicate as an argument and returns boolean.</p><pre>List&lt;Integer&gt; list = Arrays.asList(1,2,3);</pre><pre>Boolean evenExist = list</pre><pre>.stream()</pre><pre>.anyMatch(num -&gt; num % 2 == 0);</pre><p>evenExist will be true as there is an even number.</p><p>One of the best resources to dig deeper into the world of streams is the Javadoc of java. util.stream package.</p><p>Now that we understand what Streams are in Java 8, why should we use them instead of traditional loops? We should make an attempt to use streams wherever possible. The amount of clarity and simplicity of the syntax combined with ways for using powerful parallel reduction and a lot of other stream operations make them the better option in most of the cases compared to traditional loops.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7008b8a366e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>