<?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"><channel><title><![CDATA[Annshiv]]></title><description><![CDATA[Senior Software developer]]></description><link>https://annshiv.in</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 10:51:45 GMT</lastBuildDate><atom:link href="https://annshiv.in/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Essential Techniques for Drawing with Code on HTML Canvas]]></title><description><![CDATA[The HTML Canvas element is a powerful tool that enables developers to draw graphics, manipulate images, and create dynamic visual content directly on web pages. Whether it's basic shapes, complex paths, or intricate effects, canvas opens up a world o...]]></description><link>https://annshiv.in/essential-techniques-for-drawing-with-code-on-html-canvas</link><guid isPermaLink="true">https://annshiv.in/essential-techniques-for-drawing-with-code-on-html-canvas</guid><category><![CDATA[HTML5]]></category><category><![CDATA[HTML Canvas]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Mon, 14 Oct 2024 01:22:13 GMT</pubDate><content:encoded><![CDATA[<p>The HTML Canvas element is a powerful tool that enables developers to draw graphics, manipulate images, and create dynamic visual content directly on web pages. Whether it's basic shapes, complex paths, or intricate effects, canvas opens up a world of creative possibilities for both simple illustrations and advanced interactive applications. In this blog, I’ll walk you through the essential concepts I learned from my recent LinkedIn Learning course on HTML Canvas, covering everything from drawing techniques to transformations and compositing methods. Whether you’re just getting started or looking to enhance your canvas skills.</p>
<h3 id="heading-draw-rectangle">Draw rectangle</h3>
<hr />
<ul>
<li><p><strong>Rectangles are the basic shape</strong>: On the Canvas, rectangles are the simplest shape you can draw. Other shapes like circles are built from rectangles.</p>
</li>
<li><p><strong>Three main functions</strong>:</p>
<ol>
<li><p><strong>clearRect</strong>: This erases a rectangle area, making it transparent.</p>
</li>
<li><p><strong>strokeRect</strong>: This draws the outline of a rectangle with a specific color.</p>
</li>
<li><p><strong>fillRect</strong>: This fills the inside of a rectangle with a specific color.</p>
</li>
</ol>
</li>
<li><p>How it works :</p>
<ul>
<li><p><strong>Starting Point</strong>: You start drawing from the top-left corner of the rectangle.</p>
</li>
<li><p><strong>Dimensions</strong>: You define the width (how wide) and height (how tall) of the rectangle.</p>
</li>
</ul>
</li>
<li><p><strong>Combining both</strong>: You can also draw a rectangle that is both outlined and filled by using both <code>strokeRect</code> and <code>fillRect</code> with the same dimensions.</p>
</li>
</ul>
<p>Example:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/mdNrewV">https://codepen.io/Annamalai-Palani/pen/mdNrewV</a></div>
<p> </p>
<h3 id="heading-draw-line">Draw Line</h3>
<hr />
<ol>
<li><p><strong>Moving the Pen</strong>:</p>
<ul>
<li><p>Think of an invisible pen that moves around the canvas.</p>
</li>
<li><p><code>moveTo(x, y)</code>: Moves the pen to a specific spot but doesn't draw anything.</p>
</li>
<li><p><code>lineTo(x, y)</code>: Draws a line from the current pen position to the new spot.</p>
</li>
</ul>
</li>
<li><p><strong>Line Properties</strong>:</p>
<ul>
<li><p><code>lineWidth</code>: Sets how thick the line should be.</p>
</li>
<li><p><code>lineCap</code>: Decides how the ends of the line look (flat, rounded, or square).</p>
</li>
<li><p><code>lineJoin</code>: Determines how corners are drawn when lines meet (rounded, beveled, or sharp).</p>
</li>
</ul>
</li>
<li><p><strong>Drawing the Line</strong>:</p>
<ul>
<li><p><code>beginPath()</code>: Starts a new drawing path.</p>
</li>
<li><p><code>stroke()</code>: Actually draws the line based on the current path.</p>
</li>
</ul>
</li>
<li><p><strong>Dashed Lines</strong>:</p>
<ul>
<li><p><code>setLineDash([dash, gap])</code>: Creates dashed lines with specified lengths for dashes and gaps.</p>
</li>
<li><p><code>getLineDash()</code>: Retrieves the current dash settings.</p>
</li>
<li><p><code>lineDashOffset</code>: Adjusts where the dashes start.</p>
</li>
</ul>
</li>
</ol>
<hr />
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/mdNreMV">https://codepen.io/Annamalai-Palani/pen/mdNreMV</a></div>
<p> </p>
<hr />
<h3 id="heading-canvas-state-overview"><strong>Canvas State Overview</strong></h3>
<hr />
<ul>
<li><strong>Canvas State</strong>: Think of it as a snapshot of all the current settings for drawing on the canvas. This includes properties like line width, stroke style, fill style, and more.</li>
</ul>
<p><strong>Key Points</strong></p>
<ol>
<li><p><strong>Drawing State</strong>:</p>
<ul>
<li><p>The canvas keeps track of various properties such as <code>lineWidth</code>, <code>strokeStyle</code>, <code>fillStyle</code>, etc.</p>
</li>
<li><p>It also tracks advanced properties like the transformation matrix and clipping region.</p>
</li>
</ul>
</li>
<li><p><strong>Saving and Restoring State</strong>:</p>
<ul>
<li><p><strong>Why Save State?</strong>: Imagine you have a complex drawing with many settings. You might want to temporarily change a setting without losing the original ones. Saving the state helps you revert back easily.</p>
</li>
<li><p><strong>How to Save State?</strong>: Use <code>context.save()</code>. This pushes the current state onto a stack.</p>
</li>
<li><p><strong>How to Restore State?</strong>: Use <code>context.restore()</code>. This pops the top state from the stack and makes it the current state.</p>
</li>
</ul>
</li>
</ol>
<p><strong>Analogy</strong></p>
<ul>
<li><strong>Stack of Papers</strong>: Think of the canvas state as a stack of papers. Each paper represents a different set of drawing settings. When you save the state, you add a new paper to the stack. When you restore the state, you remove the top paper and go back to the previous one.</li>
</ul>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/XWvjmEo">https://codepen.io/Annamalai-Palani/pen/XWvjmEo</a></div>
<p> </p>
<h3 id="heading-drawing-arcs"><strong>Drawing Arcs</strong></h3>
<hr />
<ul>
<li><p>The <code>arc()</code> function requires parameters like center point (x, y), radius, start angle, end angle, and direction (clockwise or counterclockwise).</p>
</li>
<li><p>Angles are measured in radians, not degrees.</p>
</li>
</ul>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/qBeaOMW">https://codepen.io/Annamalai-Palani/pen/qBeaOMW</a></div>
<p> </p>
<h3 id="heading-paths-overview"><strong>Paths Overview</strong></h3>
<hr />
<ul>
<li><strong>Path</strong>: A path is a series of connected points on the canvas. It can be open (not connected back to the starting point) or closed (connected back to the starting point).</li>
</ul>
<p><strong>Key Functions</strong></p>
<ol>
<li><p><strong>Begin a Path</strong>:</p>
<ul>
<li><code>ctx.beginPath()</code>: This function starts a new path. Think of it as picking up a pen and getting ready to draw.</li>
</ul>
</li>
<li><p><strong>Move the Pen</strong>:</p>
<ul>
<li><code>ctx.moveTo(x, y)</code>: Moves the pen to a specific point (x, y) on the canvas without drawing anything.</li>
</ul>
</li>
<li><p><strong>Draw Lines</strong>:</p>
<ul>
<li><code>ctx.lineTo(x, y)</code>: Draws a line from the current pen position to the new point (x, y).</li>
</ul>
</li>
<li><p><strong>Stroke the Path</strong>:</p>
<ul>
<li><code>ctx.stroke()</code>: Actually draws the lines you've defined in the path.</li>
</ul>
</li>
<li><p><strong>Close the Path</strong>:</p>
<ul>
<li><code>ctx.closePath()</code>: Closes the path by drawing a line back to the starting point.</li>
</ul>
</li>
<li><p><strong>Fill the Path</strong>:</p>
<ul>
<li><code>ctx.fill()</code>: Fills the area enclosed by the path with the current fill style.</li>
</ul>
</li>
</ol>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/MWNjazP">https://codepen.io/Annamalai-Palani/pen/MWNjazP</a></div>
<p> </p>
<p><strong>Bezier Curves</strong></p>
<hr />
<ul>
<li><p><strong>Definition</strong>: A Bezier curve is a smooth curve defined by four points: a starting point, an ending point, and two control points.</p>
</li>
<li><p><strong>How It Works</strong>:</p>
<ul>
<li><p>The control points determine the shape of the curve.</p>
</li>
<li><p>Imagine pulling a string from the start to the end point, with the control points acting like hands that pull the string to shape it.</p>
</li>
</ul>
</li>
</ul>
<p><strong>Quadratic Curves</strong></p>
<hr />
<ul>
<li><p><strong>Definition</strong>: A quadratic curve is similar to a Bezier curve but simpler. It has a starting point, an ending point, and only one control point.</p>
</li>
<li><p><strong>How It Works</strong>:</p>
<ul>
<li><p>The single control point shapes the curve.</p>
</li>
<li><p>Think of it as a string pulled from the start to the end point, with one hand (control point) shaping the curve.</p>
</li>
</ul>
</li>
</ul>
<p><strong>Drawing These Curves</strong></p>
<ol>
<li><p><strong>Bezier Curve</strong>:</p>
<ul>
<li><p>Use <code>moveTo(x, y)</code> to move the pen to the starting point.</p>
</li>
<li><p>Use <code>bezierCurveTo(cp1x, cp1y, cp2x, cp2y, endX, endY)</code> to draw the curve with two control points.</p>
</li>
</ul>
</li>
<li><p><strong>Quadratic Curve</strong>:</p>
<ul>
<li><p>Use <code>moveTo(x, y)</code> to move the pen to the starting point.</p>
</li>
<li><p>Use <code>quadraticCurveTo(cpx, cpy, endX, endY)</code> to draw the curve with one control point.</p>
</li>
</ul>
</li>
</ol>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/ExqgPKa">https://codepen.io/Annamalai-Palani/pen/ExqgPKa</a></div>
<p> </p>
<h3 id="heading-drawing-text"><strong>Drawing Text</strong></h3>
<hr />
<ol>
<li><p><strong>Basics of Drawing Text</strong>:</p>
<ul>
<li><p><strong>Text Functions</strong>:</p>
<ul>
<li><p><code>fillText(text, x, y, [maxWidth])</code>: Draws filled text at the specified (x, y) position.</p>
</li>
<li><p><code>strokeText(text, x, y, [maxWidth])</code>: Draws text with an outline (stroke) at the specified (x, y) position.</p>
</li>
</ul>
</li>
<li><p><strong>Text Measurement</strong>:</p>
<ul>
<li><code>measureText(text)</code>: Returns the width of the specified text using the current font settings.</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>Text Properties</strong></p>
<ul>
<li><p><strong>Font</strong>:</p>
<ul>
<li>Set using <code>ctx.font = "25px Georgia"</code>. This is similar to setting font properties in CSS.</li>
</ul>
</li>
<li><p><strong>Text Alignment</strong>:</p>
<ul>
<li><code>ctx.textAlign</code>: Aligns text relative to the (x, y) position. Options include <code>start</code>, <code>end</code>, <code>left</code>, <code>right</code>, and <code>center</code>.</li>
</ul>
</li>
<li><p><strong>Text Baseline</strong>:</p>
<ul>
<li><code>ctx.textBaseline</code>: Sets the baseline alignment of the text. Options include <code>top</code>, <code>hanging</code>, <code>middle</code>, <code>alphabetic</code>, <code>ideographic</code>, and <code>bottom</code>.</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>Drawing and Styling Text</strong></p>
<ul>
<li><p><strong>Fill and Stroke Styles</strong>:</p>
<ul>
<li><p>Use <code>ctx.fillStyle</code> to set the color for filled text.</p>
</li>
<li><p>Use <code>ctx.strokeStyle</code> to set the color for stroked text.</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>Accessibility Considerations</strong></p>
<ul>
<li><strong>Screen Readers</strong>: Text drawn on the canvas is not accessible to screen readers. Avoid using canvas text as a replacement for regular HTML text elements like <code>&lt;h1&gt;</code> or <code>&lt;p&gt;</code>.</li>
</ul>
</li>
</ol>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/wvVzMoX">https://codepen.io/Annamalai-Palani/pen/wvVzMoX</a></div>
<p> </p>
<h3 id="heading-drawing-shadows">Drawing Shadows</h3>
<ul>
<li><p><strong>Shadow Properties</strong>: The canvas drawing context has four properties for shadows: <code>shadowColor</code>, <code>shadowOffsetX</code>, <code>shadowOffsetY</code>, and <code>shadowBlur</code>.</p>
</li>
<li><p><strong>Drawing Shadows</strong>: Shadows can be applied to various drawing operations like paths, images, text, and lines. You can control the color, offset, and blur of the shadows.</p>
</li>
<li><p><strong>Practical Examples</strong>: The video demonstrates how to draw shadows for rectangles, text, and lines, showing how different shadow settings affect the appearance.</p>
</li>
</ul>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/OJKpLZo">https://codepen.io/Annamalai-Palani/pen/OJKpLZo</a></div>
<p> </p>
<h3 id="heading-drawing-patterns">Drawing patterns</h3>
<hr />
<ul>
<li><p><strong>Creating Patterns</strong>: Patterns can be created from images, video frames, or even another canvas element using the <code>createPattern</code> function.</p>
</li>
<li><p><strong>Pattern Repetition</strong>: Patterns can be set to repeat in the x-axis, y-axis, or both.</p>
</li>
<li><p><strong>Practical Examples</strong>: The video demonstrates creating patterns from an image, a video frame, and another canvas, showing how to apply these patterns to fill or stroke shapes on the canvas.</p>
</li>
</ul>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/YzmZKjY">https://codepen.io/Annamalai-Palani/pen/YzmZKjY</a></div>
<p> </p>
<h3 id="heading-drawing-gradients">Drawing gradients</h3>
<hr />
<p>Types of Gradients</p>
<ol>
<li><p><strong>Linear Gradients</strong>:</p>
<ul>
<li><p>Defined along a straight path between two points.</p>
</li>
<li><p>You specify the starting and ending points (e.g., from <code>(x0, y0)</code> to <code>(x1, y1)</code>).</p>
</li>
<li><p>Colors transition smoothly along this line.</p>
</li>
</ul>
</li>
<li><p><strong>Radial Gradients</strong>:</p>
<ul>
<li><p>Defined by two circles: a starting circle and an ending circle.</p>
</li>
<li><p>The gradient transitions from the edge of the inner circle to the edge of the outer circle.</p>
</li>
<li><p>You specify the center and radius for both circles.</p>
</li>
</ul>
</li>
</ol>
<p>Steps to Create a Gradient</p>
<ol>
<li><p><strong>Create the Gradient</strong>:</p>
<ul>
<li><p>Use <code>createLinearGradient(x0, y0, x1, y1)</code> for linear gradients.</p>
</li>
<li><p>Use <code>createRadialGradient(x0, y0, r0, x1, y1, r1)</code> for radial gradients.</p>
</li>
</ul>
</li>
<li><p><strong>Add Color Stops</strong>:</p>
<ul>
<li><p>Use <code>addColorStop(position, color)</code> to define colors at specific points.</p>
</li>
<li><p>The <code>position</code> is a floating-point number between <code>0</code> and <code>1</code>, representing the percentage along the gradient line or circle.</p>
</li>
</ul>
</li>
</ol>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/XWvMrxd">https://codepen.io/Annamalai-Palani/pen/XWvMrxd</a></div>
<p> </p>
<h3 id="heading-drawing-images-and-videos-on-canvas">Drawing Images and Videos on Canvas</h3>
<hr />
<ol>
<li><p><strong>Source of Images and Videos</strong>:</p>
<ul>
<li>You can draw content from an image element, a video element, or another canvas.</li>
</ul>
</li>
<li><p><strong>Using</strong> <code>drawImage</code> Function:</p>
<ul>
<li><p><strong>Basic Usage</strong>:javascriptctx.drawImage(source, x, y);</p>
<ul>
<li>Draws the source image/video at the specified <code>(x, y)</code> position on the canvas.</li>
</ul>
</li>
<li><p><strong>Scaling the Image</strong>:javascriptctx.drawImage(source, x, y, width, height);</p>
<ul>
<li>Draws and scales the source to fit within the specified <code>width</code> and <code>height</code>.</li>
</ul>
</li>
<li><p><strong>Cropping the Image</strong>:javascriptctx.drawImage(source, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);</p>
<ul>
<li>Draws a portion of the source image defined by <code>(sx, sy, sWidth, sHeight)</code> onto the destination canvas at <code>(dx, dy)</code> with the size <code>(dWidth, dHeight)</code>.</li>
</ul>
</li>
</ul>
</li>
</ol>
<h3 id="heading-clipping-paths">Clipping Paths</h3>
<hr />
<ul>
<li><p><strong>What is a Clipping Path?</strong></p>
<ul>
<li>Think of a clipping path like a mask. It defines an area where drawing can happen. Anything drawn outside this area won't be visible.</li>
</ul>
</li>
<li><p><strong>Default Behavior</strong>:</p>
<ul>
<li>By default, the entire canvas is the clipping path, meaning you can draw anywhere on it.</li>
</ul>
</li>
<li><p><strong>Creating a Clipping Path</strong>:</p>
<ol>
<li><p><strong>Draw a Path</strong>: First, you draw a shape (like a circle or a trapezoid).</p>
</li>
<li><p><strong>Apply the Clip</strong>: Use the <code>clip</code> function to make this shape the new clipping path.</p>
</li>
</ol>
</li>
</ul>
<h3 id="heading-using-translate">Using translate</h3>
<hr />
<ul>
<li><p><strong>What is Translate?</strong></p>
<ul>
<li>Translate is like moving a piece of paper around on your desk. It shifts the starting point (origin) of where you draw on the canvas.</li>
</ul>
</li>
<li><p><strong>How It Works</strong>:</p>
<ul>
<li><p>Imagine your canvas has a starting point at the top-left corner (0, 0).</p>
</li>
<li><p>Using the <code>translate</code> function, you can move this starting point to a new location.</p>
</li>
<li><p>For example, if you translate by <code>(50, 50)</code>, the new starting point becomes 50 pixels right and 50 pixels down from the original.</p>
</li>
</ul>
</li>
<li><p><strong>Why Use It?</strong></p>
<ul>
<li>It helps when you have multiple objects to draw, especially if they need to be rotated or scaled. Moving the origin to each object's location can make drawing easier.</li>
</ul>
</li>
</ul>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/xxvqKBd">https://codepen.io/Annamalai-Palani/pen/xxvqKBd</a></div>
<p> </p>
<h3 id="heading-scaling-transformation">Scaling Transformation</h3>
<hr />
<p><strong>What is Scaling?</strong></p>
<ul>
<li><p>Scaling changes the size of your drawings on the canvas. It multiplies the dimensions of shapes by a scale factor.</p>
</li>
<li><p>For example, if you scale by a factor of 2, a shape will be twice as large. If you scale by 0.5, it will be half the size.</p>
</li>
</ul>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/NWQpKJV">https://codepen.io/Annamalai-Palani/pen/NWQpKJV</a></div>
<p> </p>
<h3 id="heading-using-rotation">Using Rotation</h3>
<hr />
<ol>
<li><p><strong>Rotation in Radians</strong>:</p>
<ul>
<li><p>The canvas uses radians, not degrees, for rotation.</p>
</li>
<li><p><strong>Conversion</strong>: To convert degrees to radians, use the formula: <code>radians = degrees * (Math.PI / 180)</code>.</p>
</li>
</ul>
</li>
<li><p><strong>Rotation Around the Origin</strong>:</p>
<ul>
<li><p>By default, rotation happens around the canvas's origin (top-left corner).</p>
</li>
<li><p>If you rotate a shape, it will rotate around this point unless you change the origin.</p>
</li>
</ul>
</li>
<li><p><strong>Using</strong> <code>rotate</code> Function:</p>
<ul>
<li>The <code>rotate</code> function takes one argument: the angle in radians.</li>
</ul>
</li>
</ol>
<p>Example :</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/dyxvbEJ">https://codepen.io/Annamalai-Palani/pen/dyxvbEJ</a></div>
<p> </p>
<h3 id="heading-custom-transformations">Custom transformations</h3>
<hr />
<ul>
<li><p><strong>Custom Transformation Matrices</strong>:</p>
<ul>
<li><p>Custom transforms are defined using a matrix of six values.</p>
</li>
<li><p>These matrices allow you to create transformations not built into the canvas, like skewing.</p>
</li>
</ul>
</li>
<li><p><strong>Transform vs. SetTransform</strong>:</p>
<ul>
<li><p><code>transform()</code>: Adds the custom transform to the current canvas transform.</p>
</li>
<li><p><code>setTransform()</code>: Resets the canvas to the identity transform before applying the custom transform.</p>
</li>
</ul>
</li>
<li><p><strong>Practical Examples</strong>:</p>
<ul>
<li><p><strong>Translate</strong>: Recreate the built-in translate function using a custom matrix.</p>
</li>
<li><p><strong>Skew</strong>: Create a skew (shear) transform to skew objects along the x or y axis.</p>
</li>
</ul>
</li>
</ul>
<p>Example:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/Annamalai-Palani/pen/VwopZJX">https://codepen.io/Annamalai-Palani/pen/VwopZJX</a></div>
<p> </p>
<h3 id="heading-compositing-and-global-alpha">Compositing and Global Alpha</h3>
<hr />
<ul>
<li><p><strong>Global Alpha</strong>:</p>
<ul>
<li><p>Controls the opacity of all drawing operations on the canvas.</p>
</li>
<li><p>Ranges from 0 (fully transparent) to 1 (fully opaque).</p>
</li>
</ul>
</li>
<li><p><strong>Compositing Methods</strong>:</p>
<ul>
<li><p>There are 12 different methods that determine how new content interacts with existing content on the canvas.</p>
</li>
<li><p><strong>Source-over</strong>: Default method where new content is drawn over existing content.</p>
</li>
<li><p><strong>Source-in, Source-out, Source-atop</strong>: Control drawing based on intersections with existing content.</p>
</li>
<li><p><strong>Destination-over, Destination-in, Destination-out, Destination-atop</strong>: Similar to source methods but affect existing content differently.</p>
</li>
<li><p><strong>Lighter, Darker, Copy, XOR</strong>: Apply various effects like lightening, darkening, or exclusive OR operations.</p>
</li>
</ul>
</li>
</ul>
<p>From the basics of drawing shapes and paths to exploring the more advanced concepts of transformations and compositing, this course has given me the confidence to incorporate more dynamic and visually appealing content into my projects. Whether you're building games, interactive graphics, or data visualizations, HTML Canvas is an essential tool to have in your developer toolkit. I’m excited to continue experimenting with these techniques and to see how far I can push the limits of what’s possible with canvas. Stay tuned for more projects and insights!</p>
]]></content:encoded></item><item><title><![CDATA[Building a Simple Form with Express.js]]></title><description><![CDATA[Express.js is a popular Node.js framework used for building web applications and APIs. Our form will allow users to input their first name and submit it to the server.
Setting Up the Project
Let's start by creating a new directory for our project and...]]></description><link>https://annshiv.in/building-a-simple-form-with-expressjs</link><guid isPermaLink="true">https://annshiv.in/building-a-simple-form-with-expressjs</guid><category><![CDATA[Express]]></category><category><![CDATA[Developer]]></category><category><![CDATA[Frontend Development]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Thu, 29 Feb 2024 02:30:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/tYvZUVEve6s/upload/11be6b8306bc0fa4eb97dae3a591f19e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Express.js is a popular Node.js framework used for building web applications and APIs. Our form will allow users to input their first name and submit it to the server.</p>
<h3 id="heading-setting-up-the-project">Setting Up the Project</h3>
<p>Let's start by creating a new directory for our project and initializing a new Node.js project. Open your terminal and run the following commands:</p>
<pre><code class="lang-bash">mkdir express-form-example
<span class="hljs-built_in">cd</span> express-form-example
npm init -y
</code></pre>
<p>Next, install Express.js and EJS (Embedded JavaScript) as dependencies:</p>
<pre><code class="lang-bash">npm install express ejs
</code></pre>
<h3 id="heading-creating-the-server">Creating the Server</h3>
<p>First, let's set up our Express server in server.js:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// server.js</span>
<span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">"express"</span>);
<span class="hljs-keyword">const</span> app = express();

<span class="hljs-comment">// Middleware and configuration</span>
app.use(express.static(<span class="hljs-string">"public"</span>));
app.use(express.urlencoded({ <span class="hljs-attr">extended</span>: <span class="hljs-literal">true</span> }));
app.use(express.json());
app.set(<span class="hljs-string">"view engine"</span>, <span class="hljs-string">"ejs"</span>);

<span class="hljs-comment">// Define routes</span>
<span class="hljs-keyword">const</span> userRouter = <span class="hljs-built_in">require</span>(<span class="hljs-string">"./routes/users"</span>);
app.use(<span class="hljs-string">"/users"</span>, userRouter);

<span class="hljs-comment">// Start the server</span>
app.listen(<span class="hljs-number">3000</span>, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Server is running on port 3000"</span>);
});
</code></pre>
<h3 id="heading-setting-up-the-user-routes">Setting Up the User Routes</h3>
<p>Now, let's define the user routes in routes/users.js:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// routes/users.js</span>
<span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">"express"</span>);
<span class="hljs-keyword">const</span> router = express.Router();

<span class="hljs-comment">// Middleware function for logging</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">logger</span>(<span class="hljs-params">req, res, next</span>) </span>{
  <span class="hljs-built_in">console</span>.log(req.originalUrl);
  next();
}

<span class="hljs-comment">// Dummy data for users</span>
<span class="hljs-keyword">const</span> users = [{ <span class="hljs-attr">name</span>: <span class="hljs-string">"Kyle"</span> }, { <span class="hljs-attr">name</span>: <span class="hljs-string">"Sally"</span> }];

<span class="hljs-comment">// Route to render the user creation form</span>
router.get(<span class="hljs-string">"/new"</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  res.render(<span class="hljs-string">"users/new"</span>);
});

<span class="hljs-comment">// Route to handle form submission</span>
router.post(<span class="hljs-string">"/"</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> isValid = <span class="hljs-literal">false</span>;
  <span class="hljs-keyword">if</span> (isValid) {
    <span class="hljs-comment">// Logic for valid submission (not implemented)</span>
    res.redirect(<span class="hljs-string">`/users/<span class="hljs-subst">${users.length - <span class="hljs-number">1</span>}</span>`</span>);
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-comment">// Logic for invalid submission</span>
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Error"</span>);
    res.render(<span class="hljs-string">"users/new"</span>, { <span class="hljs-attr">firstName</span>: req.body.firstName });
  }
});

<span class="hljs-comment">// Route parameters for user ID</span>
router
  .route(<span class="hljs-string">"/:id"</span>)
  .get(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
    <span class="hljs-built_in">console</span>.log(req.user);
    res.send(<span class="hljs-string">`Get User With ID <span class="hljs-subst">${req.params.id}</span>`</span>);
  })
  .put(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
    res.send(<span class="hljs-string">`Update User With ID <span class="hljs-subst">${req.params.id}</span>`</span>);
  })
  .delete(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
    res.send(<span class="hljs-string">`Delete User With ID <span class="hljs-subst">${req.params.id}</span>`</span>);
  });

<span class="hljs-comment">// Middleware function to handle user ID parameter</span>
router.param(<span class="hljs-string">"id"</span>, <span class="hljs-function">(<span class="hljs-params">req, res, next, id</span>) =&gt;</span> {
  req.user = users[id];
  next();
});

<span class="hljs-comment">// Apply logger middleware to all routes</span>
router.use(logger);

<span class="hljs-built_in">module</span>.exports = router;
</code></pre>
<h3 id="heading-creating-the-user-interface">Creating the User Interface</h3>
<p>In the views/users/new.ejs file, let's create a form for user input:</p>
<pre><code class="lang-xml"><span class="hljs-comment">&lt;!-- views/users/new.ejs --&gt;</span>
<span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"IE=edge"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>User Form<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">action</span>=<span class="hljs-string">"/users"</span> <span class="hljs-attr">method</span>=<span class="hljs-string">"POST"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">label</span>&gt;</span>First Name
      <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"firstName"</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"submit"</span>&gt;</span>Submit<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>We can expand upon this example by adding validation, storing user data, or integrating additional features. Express.js provides a powerful and flexible framework for building web applications and APIs, making it an excellent choice for a wide range of projects.</p>
<p>Special thanks to the "Web Dev Simplified" YouTube channel for their insightful tutorials.</p>
<p>If you'd like to dive deeper into the code or contribute to its improvement, you can find the complete code repository on GitHub at <a target="_blank" href="https://github.com/annshiv/expressJs">annshiv/expressJs</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Creating Reusable Modal Components in React]]></title><description><![CDATA[Modal components are pop-up windows that overlay the current page, allowing users to interact with content or controls without leaving the context of the application. They are commonly used for tasks such as displaying alerts, confirming actions, or ...]]></description><link>https://annshiv.in/creating-reusable-modal-components-in-react</link><guid isPermaLink="true">https://annshiv.in/creating-reusable-modal-components-in-react</guid><category><![CDATA[design patterns]]></category><category><![CDATA[architecture]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Wed, 28 Feb 2024 02:30:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/tZc3vjPCk-Q/upload/8091999d2b56f3f1b198ccb96e00758b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Modal components are pop-up windows that overlay the current page, allowing users to interact with content or controls without leaving the context of the application. They are commonly used for tasks such as displaying alerts, confirming actions, or presenting additional information.</p>
<p><strong>Creating the Modal Component</strong></p>
<p>We'll start by creating a new file named <code>Modal.jsx</code> inside the src/components directory. This file will contain the logic and styles for our modal component. Here's the code for <code>Modal.jsx</code></p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { useState } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> styled <span class="hljs-keyword">from</span> <span class="hljs-string">"styled-components"</span>;

<span class="hljs-keyword">const</span> ModalBackground = styled.div<span class="hljs-string">`
  position: fixed;
  left: 0;
  top: 0;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
`</span>;

<span class="hljs-keyword">const</span> ModalContent = styled.div<span class="hljs-string">`
  background-color: white;
  padding: 20px;
  border-radius: 5px;
`</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> Modal = <span class="hljs-function">(<span class="hljs-params">{ children }</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> [show, setShow] = useState(<span class="hljs-literal">false</span>);

  <span class="hljs-keyword">return</span> (
    &lt;&gt;
      &lt;button onClick={<span class="hljs-function">() =&gt;</span> setShow(<span class="hljs-literal">true</span>)}&gt;Open Modal&lt;/button&gt;
      {show &amp;&amp; (
        &lt;ModalBackground onClick={<span class="hljs-function">() =&gt;</span> setShow(<span class="hljs-literal">false</span>)}&gt;
          &lt;ModalContent onClick={<span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> e.stopPropagation()}&gt;
            &lt;button onClick={<span class="hljs-function">() =&gt;</span> setShow(<span class="hljs-literal">false</span>)}&gt;Close Modal&lt;/button&gt;
            {children}
          &lt;/ModalContent&gt;
        &lt;/ModalBackground&gt;
      )}
    &lt;/&gt;
  );
};
</code></pre>
<p><strong>Using the Modal Component</strong></p>
<p>Now that we've created our modal component, let's use it in our main application. Open the App.js file in the src directory and replace its content with the following code:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;
<span class="hljs-keyword">import</span> { Modal } <span class="hljs-keyword">from</span> <span class="hljs-string">"./components/Modal"</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    &lt;div className=<span class="hljs-string">"App"</span>&gt;
      &lt;Modal&gt;
        &lt;h2&gt;Hello, Modal!&lt;/h2&gt;
        &lt;p&gt;This is a simple modal component created <span class="hljs-keyword">in</span> React.&lt;/p&gt;
      &lt;/Modal&gt;
    &lt;/div&gt;
  );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<hr />
<p>Modals are versatile elements that can enhance the user experience by providing contextually relevant information or actions. You can further customize the modal component by adding animations, additional styling, or functionality to suit your application's needs. Feel free to experiment and expand upon the concepts covered in this tutorial to create unique and engaging modal experiences for your applications.</p>
]]></content:encoded></item><item><title><![CDATA[Building Reusable List Components in React]]></title><description><![CDATA[In React development, it's common to encounter scenarios where you need to display lists of similar components with varying styles or content. For instance, you might have a list of authors, each with different information like name, age, country, an...]]></description><link>https://annshiv.in/building-reusable-list-components-in-react</link><guid isPermaLink="true">https://annshiv.in/building-reusable-list-components-in-react</guid><category><![CDATA[React]]></category><category><![CDATA[software development]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Tue, 27 Feb 2024 02:30:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UYsBCu9RP3Y/upload/777b151afc68e4d998348758b01f1811.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In React development, it's common to encounter scenarios where you need to display lists of similar components with varying styles or content. For instance, you might have a list of authors, each with different information like name, age, country, and books authored. To efficiently handle such cases, we can leverage React's component composition and props passing.</p>
<p>Let's consider a scenario where we have an array of authors, each represented by an object containing their details like name, age, country, and books they've written. We want to create two distinct styles for displaying these authors: a large card displaying all details including their books, and a smaller card with just the name and age.</p>
<p>Firstly, we define our array of authors:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> authors = [
  {
    name: <span class="hljs-string">"Sarah Waters"</span>,
    age: <span class="hljs-number">55</span>,
    country: <span class="hljs-string">"United Kingdom"</span>,
    books: [<span class="hljs-string">"Fingersmith"</span>, <span class="hljs-string">"The Night Watch"</span>],
  },
  {
    name: <span class="hljs-string">"Haruki Murakami"</span>,
    age: <span class="hljs-number">71</span>,
    country: <span class="hljs-string">"Japan"</span>,
    books: [<span class="hljs-string">"Norwegian Wood"</span>, <span class="hljs-string">"Kafka on the Shore"</span>],
  },
  {
    name: <span class="hljs-string">"Chimamanda Ngozi Adichie"</span>,
    age: <span class="hljs-number">43</span>,
    country: <span class="hljs-string">"Nigeria"</span>,
    books: [<span class="hljs-string">"Half of a Yellow Sun"</span>, <span class="hljs-string">"Americanah"</span>],
  },
];
</code></pre>
<p>Next, we create our two different styles of author list items: LargeAuthorListItem and SmallAuthorListItem. The former displays all details including books, while the latter only shows name and age.</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> LargeAuthorListItem = <span class="hljs-function">(<span class="hljs-params">{ author }</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> { name, age, country, books } = author;
  <span class="hljs-keyword">return</span> (
    &lt;&gt;
      &lt;h2&gt;{name}&lt;/h2&gt;
      &lt;p&gt;Age: {age}&lt;/p&gt;
      &lt;p&gt;Country: {country}&lt;/p&gt;
      &lt;p&gt;
        Books:{<span class="hljs-string">" "</span>}
        {books.map(<span class="hljs-function">(<span class="hljs-params">book, index</span>) =&gt;</span> (
          &lt;span key={index}&gt;{book}&lt;/span&gt;
        ))}
      &lt;/p&gt;
    &lt;/&gt;
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> SmallAuthorListItem = <span class="hljs-function">(<span class="hljs-params">{ author }</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> { name, age } = author;
  <span class="hljs-keyword">return</span> (
    &lt;&gt;
      &lt;h2&gt;{name}&lt;/h2&gt;
      &lt;p&gt;Age: {age}&lt;/p&gt;
    &lt;/&gt;
  );
};
</code></pre>
<p>Now, to make these components reusable and versatile, we create a RegularList component. This component takes in an array of items, a prop specifying the source of data (in our case, "author"), and the type of item component to render.</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> RegularList = <span class="hljs-function">(<span class="hljs-params">{ items, sourceName, ItemComponent }</span>) =&gt;</span> {
  <span class="hljs-keyword">return</span> (
    &lt;&gt;
      {items.map(<span class="hljs-function">(<span class="hljs-params">item, index</span>) =&gt;</span> (
        &lt;ItemComponent key={index} {...{ [sourceName]: item }} /&gt;
      ))}
    &lt;/&gt;
  );
};
</code></pre>
<p>With RegularList, we can easily render lists of authors in different styles by passing in the appropriate item component and data source name. For example:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { authors, RegularList, LargeAuthorListItem, SmallAuthorListItem } <span class="hljs-keyword">from</span> <span class="hljs-string">'./components'</span>;

<span class="hljs-keyword">const</span> App = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">return</span> (
    &lt;div&gt;
      &lt;h1&gt;Authors&lt;/h1&gt;
      &lt;h2&gt;Large Cards&lt;/h2&gt;
      &lt;RegularList items={authors} sourceName=<span class="hljs-string">"author"</span> ItemComponent={LargeAuthorListItem} /&gt;
      &lt;h2&gt;Small Cards&lt;/h2&gt;
      &lt;RegularList items={authors} sourceName=<span class="hljs-string">"author"</span> ItemComponent={SmallAuthorListItem} /&gt;
    &lt;/div&gt;
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<hr />
<p>By utilizing these components, we can easily create and maintain lists of objects with different styles across our application. This approach promotes code reusability and maintainability, making our React application more efficient and scalable.</p>
]]></content:encoded></item><item><title><![CDATA[Building Reusable Split Screen Layouts in React]]></title><description><![CDATA[Split screen layouts are commonly used in web applications to display content side by side. Whether it's comparing two pieces of information or simply organizing content more efficiently, split screen layouts can improve the user experience.
Basic Sp...]]></description><link>https://annshiv.in/building-reusable-split-screen-layouts-in-react</link><guid isPermaLink="true">https://annshiv.in/building-reusable-split-screen-layouts-in-react</guid><category><![CDATA[TypeScript]]></category><category><![CDATA[React]]></category><category><![CDATA[software development]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Mon, 26 Feb 2024 02:30:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/aI4RJ--Mw4I/upload/69f5467d6444f11aed62f488d2accaa4.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Split screen layouts are commonly used in web applications to display content side by side. Whether it's comparing two pieces of information or simply organizing content more efficiently, split screen layouts can improve the user experience.</p>
<h3 id="heading-basic-split-screen-component">Basic Split Screen Component</h3>
<p>Let's begin by creating a basic version of the SplitScreen component:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> styled <span class="hljs-keyword">from</span> <span class="hljs-string">'styled-components'</span>;

<span class="hljs-keyword">const</span> Container = styled.div<span class="hljs-string">`
  display: flex;
`</span>;

<span class="hljs-keyword">const</span> Panel = styled.div<span class="hljs-string">`
  flex: <span class="hljs-subst">${props =&gt; props.flex}</span>;
`</span>;

<span class="hljs-keyword">const</span> SplitScreen = <span class="hljs-function">(<span class="hljs-params">{ Left, Right }</span>) =&gt;</span> {
  <span class="hljs-keyword">return</span> (
    &lt;Container&gt;
      &lt;Panel flex={<span class="hljs-number">1</span>}&gt;
        {Left}
      &lt;/Panel&gt;
      &lt;Panel flex={<span class="hljs-number">1</span>}&gt;
        {Right}
      &lt;/Panel&gt;
    &lt;/Container&gt;
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> SplitScreen;
</code></pre>
<p>In this component:</p>
<ul>
<li><p>We define a Container styled component to hold our split screen layout.</p>
</li>
<li><p>Two Panel styled components are used to represent the left and right sections of the split screen.</p>
</li>
<li><p>The SplitScreen component takes Left and Right props, which are components to be displayed in the left and right sections respectively.</p>
</li>
</ul>
<h3 id="heading-enhanced-split-screen-component">Enhanced Split Screen Component</h3>
<p>Now, let's enhance our SplitScreen component to make it more flexible by allowing custom widths for the left and right sections:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> styled <span class="hljs-keyword">from</span> <span class="hljs-string">'styled-components'</span>;

<span class="hljs-keyword">const</span> Container = styled.div<span class="hljs-string">`
  display: flex;
`</span>;

<span class="hljs-keyword">const</span> Panel = styled.div<span class="hljs-string">`
  flex: <span class="hljs-subst">${props =&gt; props.flex}</span>;
`</span>;

<span class="hljs-keyword">const</span> SplitScreen = <span class="hljs-function">(<span class="hljs-params">{ children, leftWidth, rightWidth }</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> [left, right] = children;

  <span class="hljs-keyword">return</span> (
    &lt;Container&gt;
      &lt;Panel flex={leftWidth}&gt;
        {left}
      &lt;/Panel&gt;
      &lt;Panel flex={rightWidth}&gt;
        {right}
      &lt;/Panel&gt;
    &lt;/Container&gt;
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> SplitScreen;
</code></pre>
<p>In this enhanced version:</p>
<ul>
<li><p>We modify the SplitScreen component to accept children, leftWidth, and rightWidth props.</p>
</li>
<li><p>The children prop allows us to pass components directly as children to the SplitScreen component.</p>
</li>
<li><p>leftWidth and rightWidth props determine the widths of the left and right sections respectively.</p>
</li>
</ul>
<h3 id="heading-example-usage">Example Usage</h3>
<p>Now, let's see how we can use our SplitScreen component in a React application:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> SplitScreen <span class="hljs-keyword">from</span> <span class="hljs-string">'./SplitScreen'</span>;

<span class="hljs-keyword">const</span> LeftComponent = <span class="hljs-function">(<span class="hljs-params">{ title }</span>) =&gt;</span> {
  <span class="hljs-keyword">return</span> &lt;h2&gt;{title}&lt;/h2&gt;;
};

<span class="hljs-keyword">const</span> RightComponent = <span class="hljs-function">(<span class="hljs-params">{ title }</span>) =&gt;</span> {
  <span class="hljs-keyword">return</span> &lt;h2&gt;{title}&lt;/h2&gt;;
};

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">return</span> (
    &lt;SplitScreen leftWidth={<span class="hljs-number">1</span>} rightWidth={<span class="hljs-number">3</span>}&gt;
      &lt;LeftComponent title={<span class="hljs-string">"Left"</span>} /&gt;
      &lt;RightComponent title={<span class="hljs-string">"Right"</span>} /&gt;
    &lt;/SplitScreen&gt;
  );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<p>In this example:</p>
<ul>
<li><p>We import the SplitScreen component.</p>
</li>
<li><p>We define LeftComponent and RightComponent as functional components to be displayed in the left and right sections respectively.</p>
</li>
<li><p>Inside the App component, we use the SplitScreen component and pass LeftComponent and RightComponent as children. We also specify custom widths for the left and right sections.</p>
</li>
</ul>
<hr />
<p>By following this approach, you can easily incorporate split screen layouts into your React applications, making them more structured and user-friendly. Feel free to customize the component further to suit your specific needs and styling preferences. Always expecting your support and suggestions ! Thanks in advance</p>
]]></content:encoded></item><item><title><![CDATA[My coding journey from 100 days of coding challenge]]></title><description><![CDATA[Hi. I am Annshiv. First of all, I need to say apologies for my English mistakes. Welcome to my first blog post. This post will cover my coding journey from the #100daysofcode challenge to my job.

Why I took this challenge ?
I did my 100 days coding ...]]></description><link>https://annshiv.in/my-coding-journey-from-100-days-of-coding-challenge</link><guid isPermaLink="true">https://annshiv.in/my-coding-journey-from-100-days-of-coding-challenge</guid><category><![CDATA[journey]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Sun, 25 Feb 2024 02:30:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/tPKQwYHy8q4/upload/10f18cb5c95cf19100eec37741d1c528.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi. I am Annshiv. First of all, I need to say apologies for my English mistakes. Welcome to my first blog post. This post will cover my coding journey from the #100daysofcode challenge to my job.</p>
<p><a target="_blank" href="https://res.cloudinary.com/practicaldev/image/fetch/s--F9Lh-Q5w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsks9yw6l2bo305q8e7p.jpeg"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F9Lh-Q5w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsks9yw6l2bo305q8e7p.jpeg" alt="Annshiv" /></a></p>
<p><strong>Why I took this challenge ?</strong></p>
<p>I did my 100 days coding challenge on mid of 2020. Before this challenge also, I am able to write code and solve coding problems. I am not a computer science student. I chose electronics engineering. Because I thought electronics engineers are whose writing programming to electronic devices. After a one-year completion of my college. I felt that that was wrong. Then I started to learn programming by myself.</p>
<p>I started to learn with YouTube and hacker Rank. At the start of 2020 literally, I am good at solving problems. In March 2020, amid pandemic lockdown implemented all over India, during this time, I need to move to my hometown. I felt I am good at programming. Then I thought "Ok now, we are good at programming so we will create projects using those learned programming languages". Then I started to make a tic tac toe game using python. During that project, I struggled a lot. Then I realized this knowledge is not enough to make the project. we need to revise all those things that I learned and need to learn more as well. At that time I saw one person's #100daysCodingChallenge post on LinkedIn. That was really inspired me. I started to think about "why I can't do that". Then I started #100DaysOfCode.</p>
<h2 id="heading-things-that-i-got-from-this-challenge">Things that I got from this challenge</h2>
<p>I started with basic python to revise my knowledge. I planned to learn and practice python. Daily I learned python and practice those topics on hackerrank and CodeChef. Then I will share those things with my LinkedIn family. Each day I started to spend more than 10+ hours learning to program.</p>
<p>You just imagine how it would be if a man have spent his entire time infront of a computer for this one year journey with minimal social interaction,with high mental pressure to keep up with the schedule. Inspite of I have managed to preserve, there would be many difficulties I faced. The combined of my exhaustive routine of learning programming and doing projects outside of my college campus did not provide me leisure time enough to do other activities in my life because I was fully tied up with it. I got few followers. They are motivated me to complete this challenge. Some of them directly messaged me to give their appreciation. During this challenge, I learned data structures and algorithms, completed 20+ python projects and some web-related projects. Day by day my confidence level and programming skill were improved gradually. I attended hackathons(I won nothing).</p>
<p><a target="_blank" href="https://res.cloudinary.com/practicaldev/image/fetch/s--JrpxgqQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vbgnekz20yy8tbqiijc.jpeg"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JrpxgqQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vbgnekz20yy8tbqiijc.jpeg" alt="#100daysofcode" /></a></p>
<p>Successfully I completed 100daysofcode challenge. This consistentcy made me to become smarter as well as more self confident person. This made a huge positive impact in my life. It really enhanced my social life. I am sure, this challenge helped me a lot in my interview rounds. end of this challenge, My confidence level was high. After that challenge, I took the #50daysCoding challenge (web development projects). Then I learned Django, react, javascript SQL and etc...!</p>
<p>At the start of 2021, Still colleges are closed. I was full busy with the learning program. In February, I and my friend signed a freelancing project. That time was also a learning period for me. Because that project is based on angular which I didn't learn yet. simultaneously I was Learning and working on that project. Successfully we completed that project. This is my first earning as a software developer. In June 2022, I joined <a target="_blank" href="https://lumel.com/">LUMEL technologies</a> as a software developer. LUMEL makes me feel more satisfied with my position and more confident in my programming-related skills.</p>
<p>It seemed quite trivial at the beginning of the day I started to learn.The challenge of learning within a hundred days has gone beyond that and this went on for 365 days.Even though this journey was electrified and exhilarated throughout the learning, it was definitely no easy feat.</p>
<p><a target="_blank" href="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFhMJCi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwwmh99ixn9xv028awbn.jpeg"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XuFhMJCi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwwmh99ixn9xv028awbn.jpeg" alt="365daysofcode" /></a></p>
<p>My journey was never ended to this date. At least daily I learned or wrote one concept is related to programming. My journey will continue and I hope it will never end. This challenge gave me everything that I want and need.</p>
<p>At last, below picture speaks about me lot  </p>
<p>LinkedIN : <a target="_blank" href="https://www.linkedin.com/in/annamalai923/">https://www.linkedin.com/in/annamalai923/</a><br />GitHub : <a target="_blank" href="https://github.com/annshiv">https://github.com/annshiv</a></p>
<p>Please give your support and suggestions. Thank you for reading this.</p>
]]></content:encoded></item><item><title><![CDATA[Move Your Node.js App to Bun: A Beginner's Guide]]></title><description><![CDATA[Node.js has been a popular choice for beginners and startups in web development. But since September 2023, Bun has been gaining attention for its lightning-fast performance.
What's Node.js?
Node.js lets you run JavaScript outside of web browsers, mak...]]></description><link>https://annshiv.in/move-your-nodejs-app-to-bun-a-beginners-guide</link><guid isPermaLink="true">https://annshiv.in/move-your-nodejs-app-to-bun-a-beginners-guide</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Sat, 24 Feb 2024 07:45:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/i25aqE_YUZs/upload/c52a7014e0a580ad78f516f15280e69b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Node.js has been a popular choice for beginners and startups in web development. But since September 2023, Bun has been gaining attention for its lightning-fast performance.</p>
<h3 id="heading-whats-nodejs"><strong>What's Node.js?</strong></h3>
<p>Node.js lets you run JavaScript outside of web browsers, making server-side programming easy. It's fast and has a wide range of tools (like NPM packages) for developers.</p>
<h3 id="heading-whats-bun"><strong>What's Bun?</strong></h3>
<p>Bun is a toolkit for JavaScript and TypeScript apps, boasting incredible speed. It's built using the JavaScript Core Engine, making it faster than Node.js. Plus, Bun serves as a package manager, bundler, test runner, and runtime environment.</p>
<h3 id="heading-why-switch-to-bun"><strong>Why Switch to Bun?</strong></h3>
<ol>
<li><p><strong>Adaptability:</strong> Bun works seamlessly with existing Node.js apps and packages.</p>
</li>
<li><p><strong>Bun APIs:</strong> Bun offers faster and easier alternatives to Node.js APIs.</p>
</li>
<li><p><strong>TypeScript Support:</strong> Setting up TypeScript is simpler with Bun.</p>
</li>
<li><p><strong>Path Mapping:</strong> Bun's unique approach makes imports cleaner.</p>
</li>
<li><p><strong>Hot Reloading:</strong> Bun comes with built-in hot reloading for faster development.</p>
</li>
<li><p><strong>Package Management:</strong> Bun installs dependencies much faster than other package managers.</p>
</li>
<li><p><strong>Test Case Execution:</strong> Bun includes Jest for easy testing.</p>
</li>
<li><p><strong>Application Bundling:</strong> Bun's bundler is significantly faster than others like Webpack.</p>
</li>
</ol>
<h3 id="heading-sounds-convincing-doesnt-it-lets-migrate-an-app-from-nodejs-to-bun"><strong>Sounds convincing doesn’t it? Let’s migrate an app from Node.js to Bun</strong></h3>
<p>First things first, you’ll want to install Bun on your PC. To do so, run the command:</p>
<pre><code class="lang-bash">curl -fsSL https://bun.sh/install | bash
</code></pre>
<p>If you’ve successfully installed Bun, you should get the output:</p>
<pre><code class="lang-bash"><span class="hljs-comment">######################################################################## 100.0%</span>
bun was installed successfully to ~/.bun/bin/bun
Run <span class="hljs-string">'bun --help'</span> to get started
</code></pre>
<p>Next, launch a terminal in your project directory and install Bun using the command:</p>
<pre><code class="lang-bash">bun install
</code></pre>
<p>This command installs the BUN, but it gives the below error.</p>
<pre><code class="lang-bash">bun install v1.0.14 (d8be3e51)
error: Please upgrade package-lock.json to lockfileVersion 3
</code></pre>
<p>This error occurs when there’s a mismatch between the version specified in your package-lock.json file (lockfileVersion) and the expected version.</p>
<p>So the given command will upgrade the lockfile to version 3 without altering the existing dependencies.</p>
<p>Next, go ahead and remove all TypeScript related libraries from your package.json as Bun comes with pre-built support for TypeScript. This can be done using the command:</p>
<pre><code class="lang-bash">bun remove ts-node
bun remove typescript
bun remove @types/node
</code></pre>
<p>You should see the output:</p>
<pre><code class="lang-bash">bun remove v1.0.14 (d8be3e51)
 - ts-node
 1 package removed [204.00ms]
bun remove v1.0.14 (d8be3e51)
 - typescript
 1 package removed [23.00ms]
bun remove v1.0.14 (d8be3e51)
 - @types/node
 1 package removed [23.00ms]
</code></pre>
<p>Next, go ahead and add the types offered by Bun itself for better TypeScript performance, using the command:</p>
<pre><code class="lang-bash">bun add bun-types
</code></pre>
<p>This should display the output:</p>
<pre><code class="lang-bash">bun add v1.0.14 (d8be3e51)
 installed bun-types@1.0.14
[620.00ms] <span class="hljs-keyword">done</span>
</code></pre>
<p>Next, open your <strong>tsconfig.json</strong> and ensure that you’re using the <strong>bun-types</strong>.</p>
<pre><code class="lang-typescript">{
  <span class="hljs-string">"compilerOptions"</span>: {
    <span class="hljs-string">"lib"</span>: [<span class="hljs-string">"ESNext"</span>],
    <span class="hljs-string">"module"</span>: <span class="hljs-string">"esnext"</span>,
    <span class="hljs-string">"target"</span>: <span class="hljs-string">"esnext"</span>,
    <span class="hljs-comment">// "bun-types" is the important part</span>
    <span class="hljs-string">"types"</span>: [<span class="hljs-string">"bun-types"</span>]
  }
}
</code></pre>
<p>Next, alter your <strong>NPM Start</strong> command to use Bun, as shown below:</p>
<pre><code class="lang-typescript"><span class="hljs-string">"start"</span>: <span class="hljs-string">"bun app.tsx"</span>
</code></pre>
<p>And, that’s it! You’ve successfully migrated your app from Node.js to Bun. To launch your app with Bun, use the command:</p>
<pre><code class="lang-bash">bun start
</code></pre>
<p>This will launch your app you normally do!</p>
<h1 id="heading-conclusion"><strong>Conclusion</strong></h1>
<p>Bun is taking the world by storm with its immense features and performance. If you’re one of the developers that love building high performing apps with minimal effort, you’re better off working with Bun!</p>
<p>I hope you found this article helpful.</p>
]]></content:encoded></item><item><title><![CDATA[Reflecting on 2023: A Year of Missed Opportunities]]></title><description><![CDATA[It’s 2 AM on December 10, 2023, and I just ordered chicken rice on Swiggy. I realise that I’ve wasted the entire year. I’ve been drained and procrastinated. At the start of every year, I plan my goals for finance, career, and personal development. Bu...]]></description><link>https://annshiv.in/reflecting-on-2023-a-year-of-missed-opportunities</link><guid isPermaLink="true">https://annshiv.in/reflecting-on-2023-a-year-of-missed-opportunities</guid><category><![CDATA[2023]]></category><category><![CDATA[opportunities]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Sat, 24 Feb 2024 02:30:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/9kbNYzo1XtQ/upload/3e0672f973052b8692122f9a8398318b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It’s 2 AM on December 10, 2023, and I just ordered chicken rice on Swiggy. I realise that I’ve wasted the entire year. I’ve been drained and procrastinated. At the start of every year, I plan my goals for finance, career, and personal development. But unfortunately, this year I couldn’t focus on those things. I made so many wrong decisions this year. Usually, I’m the kind of person who takes every step with clear and cautious moves. I research everything extensively before trying anything new. I think about the best way to do it, how it will affect me, and what to do if my decision goes wrong. But this year, I made mistakes. Here are my mistakes of 2023 and how I plan to correct them in 2024.</p>
<h2 id="heading-failed-to-read-books"><strong>Failed to read books</strong></h2>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*OWANl72PxhQzteMs" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@aaronburden?utm_source=medium&amp;utm_medium=referral">Aaron Burden</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<p>The first mistake was not reading enough books. From my childhood to this day, I’ve read lots of books. In my school days, I lived in the library. There was no television at home, no neighbors nearby, and my family lived in the garden, far from my village. Books were my only entertainment and I read lots of comics, history books, and even tried to learn computer basics there. I tried as much as I could and did many mini-inventions with those learnings. Books helped me improve my creativity and knowledge. At some point, I even tried to write books myself, but I didn’t get a chance to improve that. After college, I didn’t focus on reading that much, which made me think negatively about myself. Books provide a visual representation of the things we’re reading, giving us a different perspective on the author’s creativity and ideas. With books, I was able to gain knowledge about finance, personal development, and leadership quality, and learned from the experiences of different people. With these learnings, I helped many people make correct decisions. Although I have many books to read, I failed to do so. Instead, I gained content from videos and podcasts, but books are far better than these sources. This mistake made me doubt myself, which is the worst feeling. In 2024, I plan to start reading new comics related to books to gain a little bit of confidence about myself. I need to give more time to reading books and gaining knowledge.</p>
<h2 id="heading-procrastinating-on-completing-courses"><strong>Procrastinating on completing courses</strong></h2>
<p>Unfortunately, I failed to complete the courses related to my career this year. Do courses or certifications showcase your knowledge? Not necessarily, but courses provide a structured way to learn important topics about a subject. They often tell where we can learn more about a topic. In my case, courses helped me in various areas. As a software developer who primarily codes in Javascript, I was able to find my previous coding mistakes during a course. Next year, I plan to allocate a few hours a day to improving my knowledge in development.</p>
<h2 id="heading-poor-time-allocation"><strong>Poor Time allocation</strong></h2>
<p>Being a software developer in a product-based company, I have to allocate tasks to my team members, work on architecture, code quality, logic improvements, code reviews, and collaborate with the product UI and management teams for requirements. Alongside all these responsibilities, I still have my own work to do. It’s my responsibility to manage everything, but due to poor time management, I failed to effectively prioritize my tasks. This led to inefficiency and stress. I acknowledge this mistake and am determined to correct it. Currently, I’m exploring time management tools to help me resolve this issue, and I plan to read “Productivity” by Ali Abdaal. I believe that by implementing better time management strategies in 2024, I can avoid repeating this mistake.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*OPfSujqoL7Jehg0l" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@villxsmil?utm_source=medium&amp;utm_medium=referral">Luis Villasmil</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<h2 id="heading-failed-to-create-content"><strong>Failed to Create Content</strong></h2>
<p>My biggest goal currently is content creation. At the start of 2023, I set a goal to publish at least one blog every two weeks and create a single YouTube video per month. In 2022, I experimented with YouTube videos and now I want to revamp my approach. However, despite my intentions, I only managed to publish 2 or 3 blogs and didn’t create a single video. Nevertheless, I am determined to create at least one video before the end of this year. Additionally, I will make sure to provide reviews of courses and books that I’ll be learning in 2024. I guarantee that I will follow through on this commitment. Similarly, I will focus on improving my video creation skills. I’m determined to get back on track.</p>
<p>I understand that this may seem boring, but it truly upsets me. While I acknowledge that there have been some significant achievements this year, I still feel disappointed about the unfinished tasks. It’s crucial for me to focus on completing them. If you have any suggestions or advice, I would greatly appreciate your input and support. Learning is key for me to get back on track. I am determined to correct my mistakes in 2024. Please feel free to share any suggestions you may have. Your help and encouragement mean a lot to me. Lastly, I wish you all the best in overcoming your own mistakes from 2023. Cheers!</p>
]]></content:encoded></item><item><title><![CDATA[How I learned to code]]></title><description><![CDATA[I vividly recall the day when I hit an all-time low in terms of self-confidence. My academic performance had been slipping, and I had accumulated several backlogs. I felt like I was losing control of everything. From the very first day of college, I ...]]></description><link>https://annshiv.in/how-i-learned-to-code</link><guid isPermaLink="true">https://annshiv.in/how-i-learned-to-code</guid><category><![CDATA[development]]></category><category><![CDATA[growth]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Fri, 23 Feb 2024 03:30:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/O5EMzfdxedg/upload/57a079dbfc8131dbe90480b1a32dd5bc.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I vividly recall the day when I hit an all-time low in terms of self-confidence. My academic performance had been slipping, and I had accumulated several backlogs. I felt like I was losing control of everything. From the very first day of college, I had been eager to learn coding, but by the end of the fourth semester, I still hadn’t made any progress. I realized that I knew very little about the subject, and this realization hit me hard. At that time I know only,</p>
<pre><code class="lang-plaintext">print("hello world")
</code></pre>
<p>Back in March 2019, I began exploring ways to boost my productivity and manage my time better. Thanks to the inspiring videos by <a target="_blank" href="https://www.youtube.com/@aliabdaal">Ali Abdaal</a> and <a target="_blank" href="https://www.youtube.com/@mattdavella">Matt D’Avella</a>, I gained a new perspective on how to pursue my dreams. Their videos guided me to strike a balance between my academic studies and my passion for programming. Initially, I started learning Python in my native language, but soon I realized that I needed to switch to English channels to expand my knowledge. That’s when I discovered some fantastic resources, such as <a target="_blank" href="https://www.youtube.com/@CleverProgrammer">Clever Programmer</a>, <a target="_blank" href="https://www.youtube.com/@TechWithTim">Tech with Tim</a>, and <a target="_blank" href="https://www.youtube.com/@DennisIvy">Dennis Ivy</a>. With their help, I learned the programming basics and honed my skills to a whole new level.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*szqc9-NzOKgw1kht" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@johnschno?utm_source=medium&amp;utm_medium=referral">John Schnobrich</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<p>At first, I dedicated only two hours a day to learning programming, which involved watching tutorials and practicing coding exercises. My daily routine involved attending college, returning to the hostel, spending a few hours playing games, and then coding. I followed this routine for about a month or two, during which I worked on creating a Tic Tac Toe game with Python. However, as I delved deeper into the project, I realized how challenging it was to make it work. This realization led to a sense of fear and frustration, as I struggled to put the pieces together. Despite feeling disheartened, I realized that I needed to continue learning and practicing to improve my skills. I knew that with more effort and dedication, I could overcome the challenges and achieve my goals.</p>
<p>To improve my programming skills, I turned to online resources like <a target="_blank" href="https://www.hackerrank.com/annshiv">HackerRank</a> and <a target="_blank" href="https://www.codechef.com/users/annshiv">Codechef</a> for practice. Gradually, I increased the amount of time I spent on programming and eventually completed the <a target="_blank" href="https://github.com/annshiv/tic-tac-toe">Tic Tac Toe</a> game project in Python. I also took a data structures and algorithms course in Python to further enhance my knowledge. As days went by, I continued practicing and working on various <a target="_blank" href="https://github.com/annshiv/python-projects">Python projects</a>. When the Covid-19 lockdown was imposed, I returned to my hometown and used this opportunity to focus more on improving my programming skills. I dedicated 14–16 hours per day to programming, and this commitment is reflected in my GitHub streak, which spans from September 2020 to September 2021.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/1*B_98wNefT3oQdX6D1C7-pA.png" alt /></p>
<p>During that time, it was recommended by many to complete NPTEL certification courses. Personally, I completed the Programming, Data-Structures, and Algorithms using Python as well as the Joy of Computing using Python courses. These courses have helped me tremendously in developing numerous <a target="_blank" href="https://github.com/annshiv/joy-of-computing-projects">Python projects</a> that involve database and front-end technologies. However, I faced some difficulties with front-end development, which prompted me to start learning more about it with the help of <a target="_blank" href="https://www.youtube.com/@TraversyMedia">Brad Traversy</a> and <a target="_blank" href="https://www.youtube.com/@programmingwithmosh">Programming with Mosh</a>. I completed several CSS and HTML courses on Udemy and have successfully completed various projects using only HTML and CSS.</p>
<p>JavaScript is a highly popular programming language, known for its versatility and user-friendly nature. Its significance is further highlighted by its crucial role in improving front-end projects. Having completed a JavaScript certification on Udemy, I undertook a challenging project where I completed over <a target="_blank" href="https://github.com/annshiv/50-days-50-projects">50 projects</a> (#50days50Projects) using JavaScript, HTML, and CSS, which were recorded and posted on my YouTube channel, “<a target="_blank" href="https://www.youtube.com/@freakyprogrammer3555">Freaky Programmer</a>” — don’t forget to subscribe! As my knowledge and experience grew, I took on a freelance project with a friend, which required me to learn Angular 😁. Overcoming any challenges faced during the project with my newfound learnings, we completed the Angular project successfully. In June 2021, I joined <a target="_blank" href="https://lumel.com/"><strong>Lumel Technologies</strong></a> ❤️ as a product developer, which required me to learn React 😁. Thanks to my past experiences and learnings, I overcame obstacles and achieved my goal of becoming a software developer.</p>
<blockquote>
<p><em>Don’t let problems intimidate you, let them motivate you</em></p>
</blockquote>
<p>I welcome any comments or feedback on my paragraph and am always looking for ways to improve my writing skills. If you have any suggestions, please feel free to share them with me here or on my <a target="_blank" href="https://annshiv.me/"><strong>personal portfolio</strong></a>. I appreciate any constructive criticism and am eager to learn and grow. Thank you for taking the time to provide feedback.</p>
]]></content:encoded></item><item><title><![CDATA[The most important 100 days of this year]]></title><description><![CDATA[On this year beginning I set some boundaries(goal) for myself. Almost nearly 9 months completed now. Till now I fulfilled only few of my goals. In this blog, I am going to explain my plan for next 100 days to achieve my remaining goals with my daily ...]]></description><link>https://annshiv.in/the-most-important-100-days-of-this-year</link><guid isPermaLink="true">https://annshiv.in/the-most-important-100-days-of-this-year</guid><category><![CDATA[consistency]]></category><category><![CDATA[personal development]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Thu, 22 Feb 2024 03:00:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/OxU08SFhPbI/upload/f4ddbb5057788799f10801eb2c302c07.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On this year beginning I set some boundaries(goal) for myself. Almost nearly 9 months completed now. Till now I fulfilled only few of my goals. In this blog, I am going to explain my plan for next 100 days to achieve my remaining goals with my daily routine.</p>
<p>Here is my goals,</p>
<p><img src="https://miro.medium.com/v2/resize:fit:590/1*ByiyzlHb1dJoHWmDRmu9YA.png" alt /></p>
<p>Goals to complete</p>
<p>Here is my completed goals,</p>
<p><img src="https://miro.medium.com/v2/resize:fit:572/1*naTVhT0M5IWI4quoQdSuzA.png" alt /></p>
<p>Completed goals</p>
<p><strong>Goal 1</strong> : For this goal, I am going to record my whole day from my wake up to sleep for next 100 days. Seems like 100 days coding challenge. I will have to discontinue this society and social media for next 100 days. On this challenge I need to focus my other goals as well (note : some goals are related my profession).</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*CfSSx1joKlmzgrBt" alt /></p>
<p><strong>Goal 2 :</strong> why I chose <a target="_blank" href="https://www.udemy.com/share/101WcY3@-2x0kgcJ2XxQ9PBspPJ8NTgyq1Q0k2yWBTUs0Z6irNUxVkpClS_WNQdIsSGAZwNk/">React</a> and <a target="_blank" href="https://www.udemy.com/share/101Wfe3@eMzyUHSzvdJWaQAmyLti9GwkI9hSilXJVt8e9GdNh6aRDdfiBwhvjyuhlwYgLgo8/">JavaScript</a> ? I am currently working react with typescript. Typescript(syntactical superset of JavaScript) is totally new for myself and before this I know python. That python knowledge helped me to speed up my JS learning journey. I partially completed that course and react course as well. But I lose my consistency during this course completion. I need to keep my consistency to complete these courses.</p>
<p><strong>Goal 3 :</strong> From my learnings, I always believe in practical knowledge. Usually, If learned something new I have to practice that and get output for that. Obviously I will done this goal during my learning goal.</p>
<p><strong>Goal 4 :</strong> <a target="_blank" href="https://www.talkingyak.com/">Talking Yak</a> is an Android-based English teaching system. Always I want to improve my communication and my language. This application helped me in many ways to improve Grammar, Phonics, Vocabulary and Speech. I completed 67 percentage on this. Need to complete remaining.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*UDTSB10SL2h5J_3N" alt /></p>
<p><strong>Goal 5 :</strong> Planning to end my day with reading books, Currently reading “Psychology of Money”. This is my second book of this year</p>
<p><strong>Goal 6 :</strong> ”Try to fit myself” I didn’t have any source to complete this goal. I am going to fit myself without any equipments. we will see how it’s going.</p>
<blockquote>
<p><em>You can track all my activity on this platform and as well my</em> <a target="_blank" href="https://www.youtube.com/channel/UCVgcm6xK8WEZNwtLzpxfL-w/featured"><em>Youtube</em></a> <em>channel.</em></p>
</blockquote>
<p>Show your support and Sent your sugegstions.</p>
]]></content:encoded></item><item><title><![CDATA[TypeScript Narrowing: Powerful Techniques for Precise Type Checking]]></title><description><![CDATA[TypeScript is a powerful and popular programming language that brings static typing to JavaScript. One of its key features is its strong type inference and type checking capabilities, which help catch bugs and improve code quality. One powerful techn...]]></description><link>https://annshiv.in/typescript-narrowing-powerful-techniques-for-precise-type-checking</link><guid isPermaLink="true">https://annshiv.in/typescript-narrowing-powerful-techniques-for-precise-type-checking</guid><category><![CDATA[TypeScript]]></category><category><![CDATA[React]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Wed, 21 Feb 2024 13:59:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/VPmMy8YA_cU/upload/c8a1e3fe69181e4e7c187609cf9d37f6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>TypeScript is a powerful and popular programming language that brings static typing to JavaScript. One of its key features is its strong type inference and type checking capabilities, which help catch bugs and improve code quality. One powerful technique in TypeScript is “narrowing,” which allows developers to precisely narrow down the types of variables or expressions based on certain conditions, leading to more accurate and reliable type checking. In this blog post, we will explore different techniques for mastering TypeScript narrowing and leverage its benefits to write robust and error-free code.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*G1Ier7MADpOiOCUJ" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@cookiethepom?utm_source=medium&amp;utm_medium=referral">Cookie the Pom</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<ol>
<li><strong>Type Guards:</strong></li>
</ol>
<p>Type guards are functions or conditions that allow TypeScript to narrow down the type of a variable based on a runtime check. For example, using the typeof operator, we can create a type guard to differentiate between different types of variables, such as strings, numbers, or booleans. We can also use instance-of to narrow down the type of an object based on its constructor.</p>
<p>Example:</p>
<pre><code class="lang-typescript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">printLength</span>(<span class="hljs-params">value: <span class="hljs-built_in">string</span> | <span class="hljs-built_in">number</span></span>): <span class="hljs-title">void</span> </span>{
  <span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> value === <span class="hljs-string">'string'</span>) {
    <span class="hljs-built_in">console</span>.log(value.length); <span class="hljs-comment">// TypeScript knows that value is a string, so length is valid</span>
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-built_in">console</span>.log(value); <span class="hljs-comment">// TypeScript knows that value is a number</span>
  }
}
</code></pre>
<p><strong>2. Discriminated Unions:</strong></p>
<p>Discriminated Unions, also known as tagged unions or algebraic data types, are a powerful pattern in TypeScript for narrowing down types based on a common discriminator property. By using a shared property with a unique value across all variants of a union, we can create a type guard that narrows down the type based on that property.</p>
<p>Example:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">interface</span> Circle {
  kind: <span class="hljs-string">'circle'</span>;
  radius: <span class="hljs-built_in">number</span>;
}

<span class="hljs-keyword">interface</span> Square {
  kind: <span class="hljs-string">'square'</span>;
  sideLength: <span class="hljs-built_in">number</span>;
}

<span class="hljs-keyword">type</span> Shape = Circle | Square;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">printArea</span>(<span class="hljs-params">shape: Shape</span>): <span class="hljs-title">void</span> </span>{
  <span class="hljs-keyword">if</span> (shape.kind === <span class="hljs-string">'circle'</span>) {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-built_in">Math</span>.PI * shape.radius * shape.radius); <span class="hljs-comment">// TypeScript knows that shape is a circle</span>
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-built_in">console</span>.log(shape.sideLength * shape.sideLength); <span class="hljs-comment">// TypeScript knows that shape is a square</span>
  }
}
</code></pre>
<p><strong>3. Nullish Coalescing Operator:</strong></p>
<p>The nullish coalescing operator (<code>??</code>) is a handy tool for narrowing down types when dealing with potentially nullable or undefined values. It allows us to provide a default value when the variable is null or undefined, and TypeScript can accurately narrow down the type based on the result.</p>
<p>Example:</p>
<pre><code class="lang-typescript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">printUsername</span>(<span class="hljs-params">username: <span class="hljs-built_in">string</span> | <span class="hljs-literal">null</span></span>): <span class="hljs-title">void</span> </span>{
  <span class="hljs-keyword">const</span> name = username ?? <span class="hljs-string">'Guest'</span>; <span class="hljs-comment">// TypeScript knows that name is a string, even if username is null</span>
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Hello, <span class="hljs-subst">${name}</span>!`</span>);
}
</code></pre>
<p><strong>4. Custom Type Predicates:</strong></p>
<p>TypeScript also allows developers to create their own custom type predicates, which are functions that return a boolean value and can be used as type guards. Custom type predicates can be helpful when dealing with complex data structures or custom validation logic.</p>
<p>Example:</p>
<pre><code class="lang-typescript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">isPerson</span>(<span class="hljs-params">obj: <span class="hljs-built_in">any</span></span>): <span class="hljs-title">obj</span> <span class="hljs-title">is</span> <span class="hljs-title">Person</span> </span>{
  <span class="hljs-keyword">return</span> obj &amp;&amp; <span class="hljs-keyword">typeof</span> obj === <span class="hljs-string">'object'</span> &amp;&amp; <span class="hljs-string">'name'</span> <span class="hljs-keyword">in</span> obj &amp;&amp; <span class="hljs-string">'age'</span> <span class="hljs-keyword">in</span> obj;
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">printPersonDetails</span>(<span class="hljs-params">person: Person | <span class="hljs-built_in">string</span></span>): <span class="hljs-title">void</span> </span>{
  <span class="hljs-keyword">if</span> (isPerson(person)) {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`Name: <span class="hljs-subst">${person.name}</span>, Age: <span class="hljs-subst">${person.age}</span>`</span>); <span class="hljs-comment">// TypeScript knows that person is a Person object</span>
  } <span class="hljs-keyword">else</span> {
    <span class="hljs-built_in">console</span>.log(person); <span class="hljs-comment">// TypeScript knows that person is a string</span>
  }
}
</code></pre>
<p>In conclusion, TypeScript narrowing is a powerful technique that allows developers to write more precise and reliable type checking in their code.</p>
]]></content:encoded></item><item><title><![CDATA[My journey as a self-taught developer]]></title><description><![CDATA[Hello my name is Annamalai and I am working as software developer at lumel
I am writing this article with hopes that self-taught developers like myself might be employed as the rate of unemployment is pretty high. I graduated in electronics engineeri...]]></description><link>https://annshiv.in/my-journey-as-a-self-taught-developer</link><guid isPermaLink="true">https://annshiv.in/my-journey-as-a-self-taught-developer</guid><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Self Improvement ]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Wed, 21 Feb 2024 13:35:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/FCHlYvR5gJI/upload/2893423566fb5b47ef4578221980d1d0.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello my name is Annamalai and I am working as software developer at lumel</p>
<p>I am writing this article with hopes that self-taught developers like myself might be employed as the rate of unemployment is pretty high. I graduated in electronics engineering. Then you may think like this <em>“why did he choose to program as a career ?”</em>. I have some basic C programming knowledge from my 10th standard. I thought, “programming languages are working with help of electronics. So electronics were doing a major role in software development”. So I chose electronics engineering for my graduation. after one year only I realized my thought was totally wrong.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*4nYsWqoKVm5Iz9Q4" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@dsamatkulov?utm_source=medium&amp;utm_medium=referral">Damir Samatkulov</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<p>I started my programming journey in my second year, I started with python. Literally, I spend all my time with python (programming language). Each and every day I returned to the hostel after my college hours, I start to learn python. Initially, I learned programming language from my native language(Tamil) and YouTubers(<a target="_blank" href="https://www.youtube.com/c/TamilHacks20">Tamil Hacks 2.0</a>). Then I started with english youtubers (<a target="_blank" href="https://www.youtube.com/c/TechWithTim">Tech with tim</a>, <a target="_blank" href="https://www.youtube.com/c/CleverProgrammer">Clever Programmer</a>, <a target="_blank" href="https://www.youtube.com/c/programmingwithmosh">Programming with Mosh</a>). These days I can code a little bit still I am not able to solve problematic questions.</p>
<p>Then I solved 3 problematic questions for each day. During those times my daily goal was to learn some concepts and need to solve some problems from those concepts. I solved problems from (<a target="_blank" href="https://www.hackerrank.com/">HackerRank</a>, <a target="_blank" href="https://www.guvi.in/code-kata">Quvi</a>). Days passed, and the pandemic came. then I started my 100 days coding challenge. I have written a specific <a target="_blank" href="https://dev.to/annshiv/my-100-days-of-coding-journey-3ege">blog</a> for that. I completed almost nearly 25+ projects. At that time I could able to write code for some intermediate-level problems.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*-jMUocJZDmp1u00A" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@edwardhowellphotography?utm_source=medium&amp;utm_medium=referral">Edward Howell</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<p>Python is a general purpose language and all general purpose languages can be used at both the front end and back end. But it doesn’t have a popular framework like react or angular. so I need to learn to react or angular to continue my developer journey. I started HTML and CSS with the help of one <a target="_blank" href="https://www.udemy.com/share/1013eA3@Q9YL9ZeikONZ63OEMhMWCTAgXLr0G5tOgemZ8USJQDnGRTD9RtlwTb58Uu4_qit2/">course</a>. I completed more than 5 projects only with these. Here is another crucial situation for me, I need JavaScript because most of the frontend frameworks work with JavaScript. I started Javascript from one <a target="_blank" href="https://www.udemy.com/share/101Wfe3@YrwJCESWQyJuJxXZg7q0zwIy126LqWEJCwHnV7YW7R4bidohVnRWblWY_psRQ9Zd/">udemy course</a>. I completed some projects with these. Then I learned angular along with one freelancing project. meanwhile, I landed a software developer job which I expected.</p>
<blockquote>
<p><em>Research shows that you begin learning in the womb and go right on learning until the moment you pass on. Your brain has a capacity for learning that is virtually limitless, which makes every human a potential genius</em></p>
</blockquote>
<p>I can proudly say that I can do software developer work as I have learned JavaScript, React, Angular, Python, Node.js, Git, Collaboration, Pair Programming, Team work as well as HTML/CSS.</p>
]]></content:encoded></item><item><title><![CDATA[My learnings from my one-year software developer experience]]></title><description><![CDATA[I am 22 years old. I have been working for LUMEL technologies as a full-time Software Developer for 1 year now.

Photo by Carl Jorgensen on Unsplash
Communication is important
Clear communication is important when you work with a team. Usually, you n...]]></description><link>https://annshiv.in/my-learnings-from-my-one-year-software-developer-experience</link><guid isPermaLink="true">https://annshiv.in/my-learnings-from-my-one-year-software-developer-experience</guid><category><![CDATA[Developer]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[hardwork]]></category><dc:creator><![CDATA[Annamalai Palani]]></dc:creator><pubDate>Tue, 20 Feb 2024 17:02:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/4-EeTnaC1S4/upload/771d183705259d3978106e77403d79ef.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I am 22 years old. I have been working for LUMEL technologies as a full-time Software Developer for 1 year now.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*wdLYmsaKEFBsbB8x" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@scamartist?utm_source=medium&amp;utm_medium=referral">Carl Jorgensen</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<h2 id="heading-communication-is-important"><strong>Communication is important</strong></h2>
<p>Clear communication is important when you work with a team. Usually, you need to speak or discuss with your teammates any new requirements, or bug fixes. Most of the time you are working under the plans, When you cannot keep up with the plan, report it to your supervisor or managers so they can adjust their plan. It is very important to be transparent about what you do. After all, better communication leads to better results.</p>
<blockquote>
<p><em>No one knows what you need except for you so don’t wait for your managers to read your mind. Need more support? Ask for it. Have some ideas? Discuss.</em></p>
</blockquote>
<p>I am not good at language. But I always try to tell my opinion or my ideas to my colleagues or managers. It helped me in many cases.</p>
<h2 id="heading-organize-your-day"><strong>Organize your day</strong></h2>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*aou2K-tPjdOiX_NN" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@glenncarstenspeters?utm_source=medium&amp;utm_medium=referral">Glenn Carstens-Peters</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<p>By keeping organized, you will save time looking for things and will have more time to work on important tasks. Organizing your tasks help you track your work and pending tasks. Part of that stress relief comes in the form of more flexibility and organization of your time. Where there are so many deadlines to follow, knowing what’s coming up in advance can help you plan better.</p>
<h2 id="heading-be-open"><strong>Be open</strong></h2>
<p>Listen to other words and suggestions. If your colleagues give feedback or suggestions on your work, Kindly listen to their words. For example, A code review from your teammate can teach you something new to improve your code.</p>
<h2 id="heading-ask-help"><strong>Ask help</strong></h2>
<p>Asking for help to speed up your completion speed because you may be struck by unknown things. Also, while it is good to ask, sometimes it might be better to try finding the answer on your own first. but it took some time to complete that. As I said we are working under the plan and deadlines, So we need to complete tasks before the given time. You are not working alone. your teammates are there to help. It is no one’s sole responsibility to work alone. When you are stuck, it is totally OK to ask for help.</p>
<h2 id="heading-learn-new-things-every-day"><strong>Learn new things every day</strong></h2>
<p><img src="https://miro.medium.com/v2/resize:fit:1400/0*rH8OZIwMQLTpwx6f" alt /></p>
<p>Photo by <a target="_blank" href="https://unsplash.com/@windows?utm_source=medium&amp;utm_medium=referral">Windows</a> on <a target="_blank" href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></p>
<blockquote>
<p><em>I’m improving my technical skill from my job because, In every day, I am creating something new, so I learn something new for my technical knowledge from my work.</em></p>
</blockquote>
<p>Every new day will teach you new things. A bug teaches you an interesting concept. A newsletter can teach you something new. A video or movie will give some new ideas. From my experience, I usually follow social media and youtube influencers. They really teach me a lot of new things like investment, productivity, and coding. Each blog post improves my vocabulary and design of the blog post. Literally, I am learning new things every day from new people and new content.</p>
]]></content:encoded></item></channel></rss>