<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Asela Priyadarshana on Medium]]></title>
        <description><![CDATA[Stories by Asela Priyadarshana on Medium]]></description>
        <link>https://medium.com/@zaselalk?source=rss-f462ac5cc2dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oKWMF0uu5_foNYiMKTTUag.jpeg</url>
            <title>Stories by Asela Priyadarshana on Medium</title>
            <link>https://medium.com/@zaselalk?source=rss-f462ac5cc2dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 10:15:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zaselalk/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is OOP ? — A Quick Guide to Start]]></title>
            <link>https://zaselalk.medium.com/what-is-oop-a-quick-guide-to-start-8cd61738938?source=rss-f462ac5cc2dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cd61738938</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <category><![CDATA[oop]]></category>
            <dc:creator><![CDATA[Asela Priyadarshana]]></dc:creator>
            <pubDate>Thu, 01 Dec 2022 08:28:09 GMT</pubDate>
            <atom:updated>2022-12-01T14:07:44.301Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is OOP ? — A Quick Guide to Start</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*B3z7Z_WDo9Dp7wIf" /><figcaption>Photo by <a href="https://unsplash.com/@goshua13?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joshua Aragon</a> on <a href="https://unsplash.com/collections/38540963/object-oriented-programming?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Object-oriented programming (OOP) is a software design methodology that emerged in the early 1970s and has since become a popular and important approach in many software development languages. OOP is based on the concept of objects, which are data structures that contain both data and methods for manipulating the data. By combining objects and their related methods, OOP allows developers to create complex systems in an efficient and organized fashion.</p><p>It uses the DRY principle “Don’t Repeat Yourself” which makes code easy to maintain modify and debug.</p><h3>The advantages of OOP</h3><ul><li>It allows developers to create reusable code in a modular fashion.</li><li>It easier to maintain and extend over time.</li><li>It also encourages developers to think in terms of objects,</li><li>Allowing Developer to better understand the structure of their code and how the different objects interact with each other.</li><li>It enables developers to create robust and extensible applications, making them able to adapt to any changes in the environment.</li></ul><p>Even though OOP gives lot of advantages, Sometimes OOP can be difficult to learn, especially for those with little to no experience in software development. Developers need to understand the fundamentals of OOP, such as encapsulation, inheritance, polymorphism, and abstraction.</p><p>Additionally, developers need to be familiar with the various design patterns and best practices associated with OOP. Without this knowledge, developers may not be able to correctly apply the concepts of OOP to their projects.</p><p>If you are intereted in learning OOP step by step try to follow <a href="https://www.geeksforgeeks.org/a-step-by-step-approach-to-learn-object-oriented-programming/">the guide in geek for geeks.</a></p><h3><strong>Difference between Procedural and Object-Oriented Programming?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qYVEKdlgItPC1u59" /><figcaption>Photo by <a href="https://unsplash.com/@thejohnnyme?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Nikola Johnny Mirkovic</a> on <a href="https://unsplash.com/s/photos/difference?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>The difference between procedural and object-oriented programming is often debated among developers and computer scientists.</p><p>Both approaches can yield powerful programs, but they differ in several important ways. Understanding these differences is essential for choosing the right approach for a given project.</p><p>Procedural programming, sometimes called imperative programming, is a programming approach that focuses on providing instructions for computers to execute in a linear fashion. It’s built around a series of functions, or procedures, which are invoked in sequence to complete tasks. Each procedure consists of a set of code statements, or instructions, which are executed from top to bottom.</p><p>This kind of programming is often used for low-level tasks, such as operating system and driver development.</p><p>Object-oriented programming (OOP) is a programming paradigm that centers on working with objects. Objects are self-contained, reusable components that can be easily combined to create larger applications. Each object contains its own data and code, and is capable of interacting with other objects.</p><p>This approach is often used for larger, more complex applications where the user can interact with the objects. One of the major differences between procedural and object-oriented programming is the way code is organized.</p><p>In procedural programming, code is organized into a series of functions, while in object-oriented programming, code is organized into objects.</p><p>This makes OOP better suited for tasks that involve a lot of data and logic, such as database programming, graphical user interface design, and simulations.</p><p>On the other hand, procedural programming is better for tasks that require a lot of linear logic and mathematical calculations, such as scientific computing and embedded systems. It’s also more efficient in terms of memory usage and can be easier to debug.</p><p>Another major difference between the two approaches is the way data is handled. In procedural programming, data is typically stored in global variables and accessed directly from the code. This can lead to spaghetti code and difficulty in debugging. In contrast, object-oriented programming encourages the use of classes and objects, which store data internally and allow for better organization.</p><p>In summary, OOP is an important approach in many software development languages. It can be a powerful tool when used correctly, but it is important for developers to have a strong understanding of the fundamentals of OOP before applying it to their projects. With the help of online courses, tutorials, books, communities, and conferences, developers can gain the skills needed to apply OOP effectively.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cd61738938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Create Chess Pattern With HTML, CSS And a Little bit of JS]]></title>
            <link>https://zaselalk.medium.com/how-to-create-chess-pattern-with-html-css-and-a-little-bit-of-js-5efe881944f4?source=rss-f462ac5cc2dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/5efe881944f4</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Asela Priyadarshana]]></dc:creator>
            <pubDate>Sat, 21 Aug 2021 16:04:14 GMT</pubDate>
            <atom:updated>2022-12-07T12:34:36.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Y70HW975M8J6kls9.PNG" /></figure><p>Hello everyone, Today I’ll tell you how to create a simple 8 X 8 chess pattern using HTML, CSS and a little JS.</p><p>Complete Source Code: <a href="https://github.com/zaselalk/Chess-Pattern-CSS-JS">https://github.com/zaselalk/Chess-Pattern-CSS-JS</a></p><p>First things first, Here’s my little piece of HTML code.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Chess-Pattern-CSS-JS &lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div id=&quot;board&quot;&gt;<br>    &lt;/div&gt;   <br>    &lt;script src=&quot;script.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>What Next?</strong></p><p>Now Let’s add some styles for our chessboard pattern,</p><pre>#board{<br>    display: flex;<br>    flex-wrap: wrap;<br>    width: 640px;<br>    height: 640px;<br>    border:1px solid black;<br>    background-color: #fff;<br><br>  }</pre><p><strong>Explain</strong></p><ul><li>Use #board Element as a Flex-Container and Add display:flex property to it.</li><li>Add flex-warp property to make sure that your square warp to lines.</li><li>Define our chess board width and height.</li><li>use 1px border and white as `background-color&#39; to make sure your chess board more decent.</li></ul><p>Next, We’re going to Style small square on a chessboard, in this Code there’re Two types of squares,<br> Which are,<br> *.esquare - Square that in even line<br> *.osquare - Sqaure in odd line</p><p><strong>Two Types? But Why?</strong></p><p>That’s because chessboard have 64 squares and there’re 8 squares in one line. There’re 8 lines on board. But these lines are not in the same pattern.</p><p>As an example, If we select black squares and numbered them. Look you can see they are changing as odd and even pattern.</p><p>Now let’s Back to our code.</p><pre>.esquare, .osquare{<br>    width: 80px;<br>    height: 80px;<br>    border:1px solid black;<br>    box-sizing:border-box;<br>  }</pre><p>Nice! We Finished most of CSS Codes and finally we have to style our Black Squares like chess pattern. Let’s achieve this.</p><p>more on CSS</p><pre>.esquare:nth-of-type(2n){<br>    background-color: #000;<br>  }<br>  .osquare:nth-of-type(2n+1){<br>    background-color: #000;<br>  }</pre><p><strong>Explain</strong></p><p>As I said this is the final part of our CSS code. Within this part , We’re going to design pattern of black squares in our chessboard.</p><p>As I mention before, We group squares as esqaures and osqaures to style our chessboard.</p><p>Now you are end of line and final one is our js file.</p><p><strong>But Why JS?</strong></p><p>The truth is normally JS isn’t use for the simple codes like this, But to have a more clean code I added little JS code to multiply .square elements.</p><pre>const board = document.getElementById(&#39;board&#39;);<br>let patterneven = &quot; &lt;div class=&#39;esquare&#39;&gt;&lt;/div&gt;&quot; ;<br>let patternodd = &quot; &lt;div class=&#39;osquare&#39;&gt;&lt;/div&gt;&quot; ;<br><br>for(i=0;i&lt;4;i++){<br>    board.innerHTML += patterneven.repeat(8);<br>    board.innerHTML += patternodd.repeat(8);<br>}</pre><p>Using JS to create a loop so that we could easily make our code more clear and Easy to enhanced.</p><p>Mission complete !, Now you have Chess Pattern 😎</p><p>Would you like to try Live demo ? Then click the link below.</p><p>Live Demo: <a href="https://zaselalk.github.io/Chess-Pattern-CSS-JS/">https://zaselalk.github.io/Chess-Pattern-CSS-JS</a></p><p><em>Originally published at </em><a href="https://dev.to/zaselalk/how-to-create-chess-pattern-with-html-and-css-little-bit-of-js-1gpa"><em>https://dev.to</em></a><em> on August 21, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5efe881944f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>