<?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 Ethem   on Medium]]></title>
        <description><![CDATA[Stories by Ethem   on Medium]]></description>
        <link>https://medium.com/@ethemm?source=rss-2f9850e132b1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_LK7xOCJwCpDFpZ1tVf9CA.jpeg</url>
            <title>Stories by Ethem   on Medium</title>
            <link>https://medium.com/@ethemm?source=rss-2f9850e132b1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:00:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ethemm/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[Load Balancers Explained]]></title>
            <link>https://medium.com/@ethemm/load-balancers-explained-and-basic-setup-guide-8b2d3ef38bd6?source=rss-2f9850e132b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b2d3ef38bd6</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Ethem  ]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 16:58:58 GMT</pubDate>
            <atom:updated>2023-08-24T16:59:31.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYdKGBG3li0V8H4KNo4itw.png" /><figcaption>source: <a href="https://avinetworks.com/glossary/hardware-load-balancer/">https://avinetworks.com/glossary/hardware-load-balancer/</a></figcaption></figure><p>Hello everyone! Today, we’ll talk about something that quietly powers your online adventures: Load Balancers. They’re like traffic managers, making sure websites run super smooth. I’ll walk you through the basics, break down jargon, and show you how Nginx gets the job done.</p><p><strong><em>Load Balancer</em></strong> is a networking component that improves system performance by distributing network traffic evenly among multiple servers. This is used to respond faster to requests, provide high availability, and share the load fairly.</p><p>Load Balancers are located between the server and the client and control traffic bi-directionally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-7W6KksH8GLCJh4gMwnKg.png" /><figcaption>source: <a href="https://www.cloud4u.com/blog/what-is-a-load-balancer-and-its-types/">https://www.cloud4u.com/blog/what-is-a-load-balancer-and-its-types/</a></figcaption></figure><h3>How Does It Work?</h3><p>Load Balancers route incoming requests <strong>to different servers according to certain algorithms</strong>. Here’s how they work, step by step:</p><ol><li><strong><em>Request Reception: </em></strong>The Client’s request goes directly to the Load Balancer.</li><li><strong><em>Server Selection:</em></strong> Load Balancer decides which server to direct the request to in accordance to the algorithm it uses (we will talk about these algorithms in the following part of the article).</li><li><strong><em>Request Routing:</em></strong> The request is routed to the decided server.</li><li><strong><em>Server Response:</em></strong> The Load Balancer forwards the response from the server back to the client that sent the request.</li></ol><figure><img alt="source: https://blog.bytebytego.com/p/ep47-common-load-balancing-algorithms" src="https://cdn-images-1.medium.com/max/1024/1*lq2pTlRblS9A12pqa2T4kA.jpeg" /><figcaption>source: <a href="https://blog.bytebytego.com/p/ep47-common-load-balancing-algorithms">https://blog.bytebytego.com/p/ep47-common-load-balancing-algorithms</a></figcaption></figure><h3><strong>Basic Load Balancing Algorithms:</strong></h3><ol><li><strong><em>Round-Robin (RR): </em></strong>Distributes requests to servers in order.</li><li><strong><em>Least Connections: </em></strong>Distributes load by prioritizing the server with the fewest connections. In this way, the request is directed to whichever server has the least load at that time.</li><li><strong><em>Weighted Round-Robin: Weights </em></strong>are assigned according to the capacity of the servers. Requests are distributed sequentially but balanced according to the weights of the servers (2 requests gets sent to a server with 2x capacity, 1 request gets sent to a server with x capacity. The cycle simply proceeds like this)</li><li><strong><em>IP Hash:</em></strong> Distributes based on IP address. A client’s data is sent to the same server each time. This comes in handy for the situations where the server needs to keep a session.</li><li><strong><em>Least Response Time: </em></strong>The request is forwarded to the server with the shortest response time. Response times are monitored dynamically and distribution is prioritized accordingly.</li><li><strong><em>Random: </em></strong>Randomly distributed, equality is not guaranteed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*Suj4_Hy5GaVwVV2Lddf9dg.png" /><figcaption>source: <a href="https://www.linkedin.com/pulse/replication-sharding-pratima-upadhyay/">https://www.linkedin.com/pulse/replication-sharding-pratima-upadhyay/</a></figcaption></figure><h3><strong>How to Handle Databases when Using a Load Balancer?</strong></h3><ol><li><strong><em>Central Database: </em></strong>All servers use a single database. With this method, data consistency is achieved with minimal effort, but it is not a scalable choice.</li><li><strong><em>Sharding: </em></strong>The data is divided into different servers (shards). Scalable choice, but it can introduce problems with data consistency.</li><li><strong><em>Replication: </em></strong>The same database is copied to different servers and each server works with its own database. It provides high availability and ease of backup, but some synchronization problems may arise.</li><li><strong><em>Data Storage Services: </em></strong>Provides developers with tools to store, access, update data, etc. For example; Amazon S3, Google Cloud Storage, Azure Blob, MongoDB Atlas…</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6-CcPu8F_R7nS6lNur09A.jpeg" /></figure><h3><strong>Load Balancer Setup Steps:</strong></h3><ol><li><strong><em>Needs Analysis: </em></strong>Estimating values such as how many clients will send data, average and maximum traffic.</li><li><strong><em>Load Balancer Selection: </em></strong>Examining different services, and selecting a Load Balancer that’s most suitable for the characteristics of the incoming request.</li><li><strong><em>Preparing the Servers: </em></strong>Before implementing the Load Balancer, the servers that will work must be established and located within the same network (or virtual network).</li><li><strong><em>Load Balancer Setup: </em></strong>The selected Load Balancer is installed according to the documentation. Then, the configurations such as algorithms, ports, and protocols are done.</li><li><strong><em>Configurations of Servers: </em></strong>Ensure that the servers are configured to provide the same service and that the servers are seen by the Load Balancer.</li><li><strong><em>Health Checks and Backups: </em></strong>Health check mechanisms are deployed in order to monitor the health of servers (this step should be investigated separately), and it is helpful to keep backup servers ready in case of failures.</li><li><strong><em>Test: </em></strong>The<strong><em> </em></strong>Load Balancer is tested according to different scenarios (heavy traffic, average traffic, monitoring of the system when new devices are added, etc.)</li><li><strong><em>Maintenance, Security: </em></strong>The behavior of the system should be monitored, and if necessary, intervention systems can be deployed. Various measures are taken to ensure the security of the servers.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nASEoxwbOkUO7wQYeHjjVA.jpeg" /></figure><h3><strong>Load Balancer Basic Setup for Nginx:</strong></h3><h4><strong>Detailed installation documentation can be found here: </strong><a href="https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/">https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/</a></h4><p>Below, I’ve listed the steps to follow for a simple setup. Later on, more efficient configurations can be deployed by Nginx’s more complex Load Balancing and health check features. For this, the official Nginx documentation above should be examined:</p><h4><strong>Creating the load balancer block:</strong></h4><p>Add a new configuration file to Nginx to create the load balancer configuration. This file is usually in:</p><pre>/etc/nginx/conf.d/</pre><p>Example file name: <em>my_load_balancer.conf</em></p><h4><strong>Setting the Load Balancer Configuration:</strong></h4><p>In the configuration file that you created, you can set up the load balancer using a structure such as the following:</p><pre>upstream backend {<br>  server backend_server_1;<br>  server backend_server_2;<br>  # Add other servers here<br>}<br><br>server {<br>  listen 80;<br>  server_name load_balancer_domain.com;<br>  location / {<br>    proxy_pass http://backend;<br>    proxy_set_header Host $host;<br>    proxy_set_header X-Real-IP $remote_addr;<br>    # Other proxy settings<br>  }<br>}</pre><p>In the<strong> upstream </strong>block, you specify the backend servers. These are the servers that the load balancer will route to.</p><p>The<strong> server </strong>block contains the configuration of the load balancer server. With<strong> proxy_pass</strong>, requests are routed to servers on the upstream side.</p><p><strong>Proxy_set_header</strong> passes client headers to the server.</p><h4><strong>Checking Configuration and Debugging:</strong></h4><p>You can use the nginx -t command to check if the configuration file is valid.</p><p>If there is an error, carefully review the error messages and correct the configuration.</p><p>After correcting the configuration, restart Nginx with:</p><pre>sudo service nginx restart</pre><p>or</p><pre>sudo systemctl restart nginx</pre><p>Once the steps are complete, you can check the log files to examine how Nginx is routing requests.</p><p>Load Balancers might be quiet, but they’re the backstage champions of a hassle-free online world. Now that you’ve got the basics on what they do and how to set them up, you’re all set to make your online stuff work like a breeze.</p><p>Thank you for your time and have a nice day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2d3ef38bd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Core Concepts of Object-Oriented Programming ( Simplified )]]></title>
            <link>https://medium.com/@ethemm/4-core-concepts-of-object-oriented-programming-simplified-f6da90727f7?source=rss-2f9850e132b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6da90727f7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ethem  ]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 18:40:42 GMT</pubDate>
            <atom:updated>2023-06-26T18:40:42.723Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7Sclir5kKGLBLx2F5N9Ww.png" /></figure><p>Hello and welcome! In this blog, I’ll explain 4 Core Concepts of Object-Oriented Programming as simply as possible. If you are a beginner in OOP or just want a quick refresher, this post is for you. I tried my best to explain everything in a way that’s easy to understand and tried to keep it as little technical as possible.</p><p>First, let&#39;s go over what Object-Oriented Programming is.</p><p><strong>What is OOP?</strong></p><p>Object-Oriented Programming (OOP) is a programming paradigm that organizes code into objects and interactions between objects. At its core, the OOP paradigm is designed around the concept of objects, which are instances of classes. Unlike functional programming, where code is structured as a sequence of instructions, OOP focuses on modeling real-life problems as interactions happening between objects. Each object is formed of relevant data fields and functionality and by that, allows us to model real-world problems by designing classes that generate objects with relevant behaviors. This approach helps us to solve complex real-life problems by bringing the programming logic down to real-life logic as much as possible. Also, OOP promotes code reusability by pushing the developers to design generic and reusable classes and functionality throughout their designs and creating a reusable code base for the project/company. A good and clean code base is crucial for large-scale projects in terms of maintenance, scalability, feature additions, collaboration between developers, etc.</p><p>The four concepts we will explore — encapsulation, abstraction, inheritance, and polymorphism — form the foundation of OOP and are essential concepts for creating efficient, reusable, and scalable code. Now, let’s explore each concept in detail and see how they together form the OOP approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vhf0TIXfjpdkjlevejK_tA.png" /></figure><h4>Encapsulation:</h4><p>In OOP, objects <strong>encapsulate </strong>their data by declaring their access levels as <strong>private</strong> <strong>or protected</strong>. This prevents direct access to the data from outside the object. This provides a level of protection.</p><p>Instead of direct access, the data of the object can be accessed through public methods known as <strong>getters and setters</strong>, which provide controlled access and <strong>protect the integrity of the object</strong>’s current state.</p><p>Encapsulation also promotes <strong>information hiding</strong>. That means the internal implementation of details of the class are hidden from the outside and only the necessary methods/fields are exposed. This system protects the integrity of the data by protecting it from accidental/unauthorized modifications.</p><p>By that, encapsulation improves code reusability, modularity and maintainability.</p><pre>public class Person {<br><br>    // The name and age variables are set private<br><br>    private String name;<br>    private int age;<br>    <br>    // We can observe the usage of setters and getters for accessing age<br>    // and name.<br><br>    public String getName() {<br>        return name;<br>    }<br><br>    public void setName(String newName) {<br>        name = newName;<br>    }<br><br>    public int getAge() {<br>        return age;<br>    }<br><br>    public void setAge(int newAge) {<br>        age = newAge;<br>    }<br>}</pre><p><em>In this example, the </em><em>Person class encapsulates the data fields </em><em>name and </em><em>age by declaring them as private. This prevents direct access to these fields from outside the class. Instead, public getter and setter methods (</em><em>getName(), </em><em>setName(), </em><em>getAge(), and </em><em>setAge()) are provided to control access to the data.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*bKvL2phbnPwwBWwBYGnp2A.png" /></figure><h4>Abstraction:</h4><p>Abstraction helps in managing complexity by <strong>breaking down</strong> large designs into smaller, manageable parts. By focusing on the essential aspects of an object or system and <strong>hiding unnecessary implementation details</strong>, abstraction promotes code flexibility, maintainability, and adaptability.</p><p>By abstracting complex systems or entities, programmers can focus on the high-level functionalities and concepts that are relevant to the problem domain, therefore they can be <strong>focused on solving the problem</strong> more rather than <strong>dealing with underlying technical details</strong>.</p><p>Through abstraction, programmers can build scalable, modular, and adaptable software systems that can evolve with changing requirements and technologies.</p><pre>public abstract class Shape {<br>    public abstract double calculateArea();<br>    public abstract double calculatePerimeter();<br>}<br><br>public class Circle extends Shape {<br>    private double radius;<br><br>    public Circle(double radius) {<br>        this.radius = radius;<br>    }<br><br>    @Override<br>    public double calculateArea() {<br>        return Math.PI * radius * radius;<br>    }<br><br>    @Override<br>    public double calculatePerimeter() {<br>        return 2 * Math.PI * radius;<br>    }<br>}</pre><p><em>In this example, the </em><em>Shape class represents an abstraction of a geometric shape. It is defined as an abstract class with two abstract methods: </em><em>calculateArea() and </em><em>calculatePerimeter(). These methods define the essential aspects of a shape without specifying the actual implementation details.</em></p><p><em>The </em><em>Circle class extends the </em><em>Shape class and provides the specific implementation for the </em><em>calculateArea() and </em><em>calculatePerimeter() methods for a circle. The </em><em>radius field is encapsulated within the </em><em>Circle class, and the calculations are performed based on this field.</em></p><p><em>Also, this example code contains Override operations and inheritance, those concepts will be explained below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u65mEVSIYMOvqZQ85CMmyw.png" /></figure><h4>Inheritance:</h4><p>Inheritance is a fundamental concept in Object-Oriented Programming (OOP) that allows for the creation of new classes based on existing classes.</p><p>It enables the sharing of attributes and behaviors from a base class (referred to as the superclass or parent class) to derived classes (referred to as subclasses or child classes). Inheritance eliminates rewriting code as subclasses inherit the characteristics of their superclass, including it’s data fields and methods, promoting code reuse.</p><p>This relationship is called an <strong>“is-a” relationship</strong> where the newly created subclass is a more specialized version of the superclass. Subclasses extend superclasses, this means they are new classes that have additional features plus the superclass.</p><p>They can obtain new functionality also by <strong>overriding </strong>(overriding is further explained in the Polymorphism section) the existing methods of the superclass. This also creates a <strong>hierarchical structure</strong> between classes, therefore forming an organized design.</p><p>The organized design is beneficial in a lot of ways like code readability, maintainability, scalability, debugging, etc. as changes made to a parent class also change all of the subclasses so the developer does not need to change all of the classes if something goes wrong or a new feature needs to be applied.</p><pre>public class Animal {<br>    protected String name;<br><br>    public Animal(String name) {<br>        this.name = name;<br>    }<br><br>    public void makeSound() {<br>        System.out.println(&quot;The animal makes a sound&quot;);<br>    }<br>}<br><br>public class Dog extends Animal {<br>    public Dog(String name) {<br>        super(name);<br>    }<br><br>    @Override<br>    public void makeSound() {<br>        System.out.println(&quot;The dog barks&quot;);<br>    }<br><br>    public void wagTail() {<br>        System.out.println(&quot;The dog wags its tail&quot;);<br>    }<br>}</pre><p><em>This one may be the most popular example of inheritance and it is very easy to understand. In this example, the </em><em>Animal class serves as the superclass, defining a common attribute </em><em>name and a generic </em><em>makeSound() method. The </em><em>Dog class extends the </em><em>Animal class, inheriting its attributes and methods. It also overrides the </em><em>makeSound() method with a specialized implementation for a dog&#39;s sound.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHp4Rsk_7NXkAiEUFhKhIg.png" /></figure><h4>Polymorphism:</h4><p><strong>Polymorphism </strong>is typically achieved through method <strong>overriding </strong>and method <strong>overloading</strong>.</p><p>Method overriding occurs when a subclass defines its own implementation for a method that it inherited from a superclass. So, the functionality of the same method can <strong>differ based on the object type</strong> that calls the method.</p><p>Method overloading, on the other hand, occurs when multiple methods with the same name act differently<strong> based on the parameter list</strong> (the parameters the method takes). The appropriate method is selected based on the arguments provided when the method is called.</p><p>Polymorphism promotes code flexibility by allowing objects of different types to be treated uniformly based on their shared interfaces or superclass.</p><pre>class Shape {<br>    public void draw() {<br>        System.out.println(&quot;Drawing a shape&quot;);<br>    }<br>}<br><br>class Circle extends Shape {<br>    @Override<br>    public void draw() {<br>        System.out.println(&quot;Drawing a circle&quot;);<br>    }<br>}<br><br>class Rectangle extends Shape {<br>    @Override<br>    public void draw() {<br>        System.out.println(&quot;Drawing a rectangle&quot;);<br>    }<br><br>    public void draw(int width, int height) {<br>        System.out.println(&quot;Drawing a rectangle with width &quot; + width + &quot; and height &quot; + height);<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        Shape shape1 = new Circle();<br>        shape1.draw(); // Output: Drawing a circle<br><br>        Shape shape2 = new Rectangle();<br>        shape2.draw(); // Output: Drawing a rectangle<br><br>        Rectangle rectangle = new Rectangle();<br>        rectangle.draw(10, 5); // Output: Drawing a rectangle with width 10 and height 5<br>    }<br>}</pre><p><em>In this example, we have a base class </em><em>Shape and two subclasses </em><em>Circle and </em><em>Rectangle. Both subclasses override the </em><em>draw() method inherited from the </em><em>Shape class, providing their own implementations. This is an example of </em><strong><em>method overriding.</em></strong></p><p><em>Additionally, the </em><em>Rectangle class introduces an overloaded version of the </em><em>draw() method, which takes parameters for the width and height of the rectangle. This is an example of</em><strong><em> method overloading.</em></strong></p><h4>BONUS SECTION:</h4><h4><strong>Abstract Class vs Interface:</strong></h4><p>To understand the 4 Core Concepts I have explained, you should also understand Abstract Class and Interface terms. I’ll try to explain them as short and simply as possible, and I suggest you study them further if you are new to these concepts. First, let’s look at them separately:</p><p><strong>Abstract Class:</strong></p><p>An <strong>Abstract Class</strong> is a class that can not be instantiated and is designed to be used as a parent class to form subclasses. An Abstract Class can contain both<strong> concrete and abstract methods</strong>.</p><p><em>Abstract Class Example:</em></p><pre>abstract class Animal {<br>    private String name;<br>    // Contains both concrete and abstract methods.<br>    public Animal(String name) {<br>        this.name = name;<br>    }<br>    <br>    public abstract void sound();<br>    <br>    public void eat() {<br>        System.out.println(name + &quot; is eating.&quot;);<br>    }<br>}<br><br>class Dog extends Animal {<br>    public Dog(String name) {<br>        super(name);<br>    }<br>    <br>    @Override<br>    public void sound() {<br>        System.out.println(&quot;Dog barks.&quot;);<br>    }<br>}<br><br>class Cat extends Animal {<br>    public Cat(String name) {<br>        super(name);<br>    }<br>    <br>    @Override<br>    public void sound() {<br>        System.out.println(&quot;Cat meows.&quot;);<br>    }<br>}</pre><p><strong>Interface:</strong></p><p>An <strong>Interface</strong> is a contract that sets a list of methods for the class that implements that interface must implement. It only contains <strong>method signatures</strong>.</p><p><em>Interface Example:</em></p><pre>interface Vehicle {<br>    // Contains only signatures of methods.<br>    void start();<br>    void stop();<br>}<br><br>class Car implements Vehicle {<br>    @Override<br>    public void start() {<br>        System.out.println(&quot;Car started.&quot;);<br>    }<br>    <br>    @Override<br>    public void stop() {<br>        System.out.println(&quot;Car stopped.&quot;);<br>    }<br>}<br><br>class Motorcycle implements Vehicle {<br>    @Override<br>    public void start() {<br>        System.out.println(&quot;Motorcycle started.&quot;);<br>    }<br>    <br>    @Override<br>    public void stop() {<br>        System.out.println(&quot;Motorcycle stopped.&quot;);<br>    }<br>}</pre><p>A class can have only one parent class, on the other hand, it can implement multiple interfaces.</p><p><strong>In Conclusion, the difference between Abstract Classes and Interfaces can be summed up as the following:</strong></p><p>Abstract classes are commonly used when you want to provide a common base implementation and share code among related classes throughout your project. They are useful for creating a clean class hierarchy. Interfaces, on the other hand, are used for defining contracts that can be implemented by any class without the need of being related to each other. They are useful when you want to have polymorphism in your code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6da90727f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Structures and Algorithms: 10 Tips on Study Strategies for Effective Learning]]></title>
            <link>https://medium.com/@ethemm/data-structures-and-algorithms-10-tips-on-study-strategies-for-effective-learning-15205b3152a1?source=rss-2f9850e132b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/15205b3152a1</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ethem  ]]></dc:creator>
            <pubDate>Sat, 17 Jun 2023 15:04:50 GMT</pubDate>
            <atom:updated>2023-06-19T12:11:21.039Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*g-5RyKXZc9eX2EcPJaFpWw.jpeg" /></figure><p>Are you a student currently enrolled in a Computer Science degree and will take DSA the next semester? Or are you in the middle of DSA and feeling lost? Don’t worry, I got you.</p><blockquote>P.S.: This is not a guide on how to prepare for DSA interviews, it’s for people who are new to DSA and want to build a strong foundation.</blockquote><p>DSA is arguably the most important course you will take in your CS degree. And it’s essential for having a solid background. After this class, you’ll likely to gain a deeper understanding of data structures and fundamental algorithms which will serve as building blocks on every project/problem you’ll work on in the future. Also, you’ll have the ability to analyze time and space complexity of algorithms and create relations between certain algorithms, certain data structures, and their time and space complexities, being able to produce more professional output as a developer.</p><p>Also, nowadays, DSA is the most common way to test a candidate’s programming skills, so you’ll need these skills in your internship/job interviews. Long story short, you better take your time and study as much and effectively as possible to master this class.</p><p>Now let’s talk about how to study with the minimum amount of just “memorizing stuff” and the maximum amount of understanding things in a way that you can produce creative outputs by yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*eYscJYftl26NJo03BKb8AQ.png" /></figure><p>1.<strong> Get familiar with The Prerequisites: </strong>Get comfortable with a programming language. If you are new to programming, learn basic programming, and then I suggest you get comfortable with object-oriented programming. Don’t just dive into DSA without knowing the basics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*rg6NtohqH7JrORCANxj4Rw.jpeg" /></figure><p>2.<strong> Choose High-quality Resources: </strong>Seriously, you need to stop learning from low-quality quick-fix content and dive into a good-quality textbook! I’m not saying youtube tutorials are bad, but watch them after you study directly from a textbook or from a good lecture from a good university. Textbooks often provide comprehensive coverage of the subject matter, include exercises for practice, and offer detailed explanations that may be lacking in shorter video tutorials. I recommend “Data Structures: Abstraction and Design Using Java” by Elliot Koffman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*9ob4bvi7_asZLxJap37QAQ.png" /></figure><p>3. <strong>Build Time and Space Complexity Awareness: </strong>To develop time and space complexity awareness, firstly understand the common notations like Big O, Big Theta, and Big Omega. Study various algorithms, focusing on sort or search algorithms as they are better at revealing differences related to data structures, making them easier to compare. Compare their efficiencies and understand how they perform under different scenarios and input sizes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*PBC4Z8EfP2VGg31G9sFKHA.png" /></figure><p>4. <strong>Build Data Structures Awareness: </strong>Do you think the whole web is a linear linked list? Would it make sense? Try to ask yourself questions like this and get a new vision about this. What happens when you do CTRL+Z (undo shortcut), how are your actions stored in the computer? You’ll see it’s a LIFO ( last in first out ) logic, therefore a Stack is used. Or when you are searching for something in your folders, you’ll see it has a hierarchical structure and realize that it’s a Tree implementation. Or when you add some music to your queue on your favorite music app, the first song you added to the queue is played before the others and so on, so it’s a FIFO ( first in first out ) logic and therefore a queue implementation. Try to think about the systems around you and keep your brain active. Be aware of the data structures used around you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*My2xwCgthGPsimU7j3kwWQ.png" /></figure><p>5. <strong>Learn Through Visuals: </strong>So, DSA is a complicated and challenging course. The implementations of both the data structures and the algorithms seem complicated at first. So I don’t suggest that you dive straight into the code. First, learn by schemes and visuals, animations, etc. Learn to a level that you can draw those schemes by yourself and teach it to a friend as simply as possible. If you completely understand the running mechanism of the algorithm or the data structure, you are ready to dive into the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*RM-0IFo8XITfxA5kNPNzVg.png" /></figure><p>6. <strong>Practice by Drawing Schemes: </strong>You can forget the implementation, but you are likely to remember the visuals for a long time. It’s not that hard to remember the implementation details when you are familiar with the underlying logic and mechanics of a specific algorithm or a data structure, and it’s a lot easier to memorize the visuals than the code itself. So, shoutout to those youtube channels who make animations for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*d33y489NQdt_HfFdUzPoow.png" /></figure><p>7.<strong> Read Code: </strong>Nothing much to explain about it. Read code. Read good code. Read implementations in your textbook, and also from other resources. Read and understand. Copy-paste the parts you can’t understand to an AI like ChatGPT or Bard and let them explain to you line by line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*GDbKL5dE8zuxXAlO2px2Tg.png" /></figure><p>8. <strong>Implement from Scratch: </strong>Practice data structures by trying to code them from scratch after you get comfortable with them studying from visuals and reading code. Implementing a data structure or algorithm from scratch also provides the advantages of strengthening memory and boosting creativity. Also, get help in a way that also boosts your learning when you are stuck rather than just copying the code and pasting it on your implementation. My suggestion is to first try to generate the code by drawing the data structure or the algorithm on paper, taking notes about it, etc. If you can’t figure it out, ask an AI to give you pseudo code. If you still can’t write the code, then go back to studying the code. Also, don’t only read and study from one source when it comes to reading data structure implementations. There may be some differences between implementations and it’s important not to memorize the code but to understand it. So, read a lot. Also, you can watch videos like “Implement xxx From Scratch”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*n4pRAsuqacjkQGbTxm2gcQ.jpeg" /></figure><p>9.<strong> Do Your Coding Studies in a Balanced Way: </strong>Don’t only solve algorithm questions, or don’t only build simple projects that have use cases for certain data structures. Do both of them. Learn to think in both micro algorithm design levels and wider project design levels when it comes to learning to use different Data Structures to overall enhance the quality of your programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*3R2fjtAV61LMFClLT0cYvQ.png" /></figure><p>10. <strong>Stay Persistent: </strong>DSA is a challenging topic, so, know when to take a little break. Give your brain some time to rest. It’s not more important than your mental health. Don’t let a specific topic make you give up the rest of the whole course just because you can’t understand a tiny piece of a huge course. I don’t want to fill here with general cliché suggestions like establish a study routine, break tasks into manageable chunks, avoiding procrastination, collaborate with others, (do all of these stuff lol), etc. Just keep studying and trust the process and you’ll be fine.</p><p>So, that’s pretty much it! Thanks for reading my blog, and good luck on your studies. Also, don’t forget to enjoy life!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15205b3152a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Iterators in Java]]></title>
            <link>https://medium.com/@ethemm/iterators-in-java-96e0403834c0?source=rss-2f9850e132b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e0403834c0</guid>
            <category><![CDATA[c-programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ethem  ]]></dc:creator>
            <pubDate>Thu, 18 May 2023 21:27:55 GMT</pubDate>
            <atom:updated>2023-05-18T21:38:48.825Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fO8PgmEQO52-IbPAeUzj0w.gif" /></figure><p>In Java, an iterator is an object that provides a way to i<strong>terate over a collection of elements</strong>, such as a LinkedList or a HashSet. An iterator lets you iterate (every step of a loop is called an iteration) over the elements and access each element one by one without needing to know the underlying implementation of the collection being used to store the elements.</p><p>Many collections in Java, by default, implement the Iterator interface, so it means that they are compatible with iterators by default. Here is a list of some of the commonly used collections in Java that implement Iterator interface:</p><ul><li>ArrayList</li><li>LinkedList</li><li>Vector</li><li>Stack</li><li>Queue</li><li>HashSet</li><li>TreeSet</li><li>HashMap</li><li>TreeMap</li></ul><p>The Iterator interface defines three main methods that are used to traverse through a collection. These methods are like the following:</p><p>1. <strong>hasNext()</strong>: Returns true if the current element has a next element, which corresponds to the current element not being the last element of the collection.</p><p>2. <strong>next()</strong>: Returns the <strong>next </strong>element in the collection.</p><p>3. <strong>remove()</strong>: Removes the <strong>last element returned</strong> by the iterator. This is useful since it can simply remove the element without the developer using the related collection’s methods to remove the element. The iterator’s remove() method calls the necessary methods and gets the job done for you.</p><p>To use the remove() method, since it removes the lastly returned element by the iterator, you must first call the next() method to retrieve the element you want to remove from the collection. If you call remove() method without calling next() beforehand, you will get an IllegalStateException.</p><blockquote>Below is a code snippet that shows how iteration is done through iterators.</blockquote><pre><br>        ArrayList&lt;String&gt; fruits = new ArrayList&lt;&gt;();<br>        fruits.add(&quot;Apple&quot;);<br>        fruits.add(&quot;Banana&quot;);<br>        fruits.add(&quot;Orange&quot;);<br><br>        Iterator&lt;String&gt; iterator = fruits.iterator();<br>        while (iterator.hasNext()) {<br>            String fruit = iterator.next();<br>            System.out.println(fruit);<br>        }<br>    <br></pre><blockquote>Below is a code snippet that shows how to remove an item from a collection using iterators.</blockquote><pre>        ArrayList&lt;Integer&gt; numbers = new ArrayList&lt;&gt;();<br>        numbers.add(10);<br>        numbers.add(20);<br>        numbers.add(30);<br><br>        Iterator&lt;Integer&gt; iterator = numbers.iterator();<br>        while (iterator.hasNext()) {<br>            int number = iterator.next();<br>            if (number &gt; 20) {<br>                iterator.remove();<br>            }<br>        }<br><br>        System.out.println(numbers); // Output: [10, 20]</pre><p><strong>Why Use Iterators in Your Java Code?</strong></p><p>There are lots of advantages to using Iterators, here are some of the advantages I find most important:</p><p><strong><em>Simplicity and Readability:</em></strong> Iterators abstract the underlying functionality when accessing or removing an element from a collection. If you work with multiple collections/data types, you can use iterators to create generic and reusable methods for working with the elements from different collections.</p><p><strong><em>Safety:</em></strong> Iterators create a clear separation between the iteration process and the underlying data structure, therefore preventing any accidental modifications, indexing errors, and other issues which may cause unpleasant surprises.</p><p><strong><em>Customization:</em></strong> You can create custom iterators for different purposes to traverse a collection in a specified way to meet the needs of your program, and avoid code duplication. Check “lazy deletion” as a simple use case of this aspect.</p><p><strong><em>Exception Handling: </em></strong>Most of the time, iterators come with built-in exception handling. So, if an error occurs during the traversal, the iterator will throw an exception, helping you debug your code in a more efficient way.</p><p><strong>Conclusion:</strong></p><p>In conclusion, Iterators are powerful tools in the journey of writing clean and reusable code, by providing a standardized way for traversing through the elements of collections without the need to know the functionality of the underlying data structure. By using iterators in their programs, developers can craft cleaner and more maintainable code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e0403834c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why C is the Perfect Starting Language for Beginner Programmers]]></title>
            <link>https://medium.com/@ethemm/why-c-is-the-perfect-starting-language-for-beginner-programmers-d59796494ccf?source=rss-2f9850e132b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d59796494ccf</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[c-programming]]></category>
            <dc:creator><![CDATA[Ethem  ]]></dc:creator>
            <pubDate>Fri, 07 Apr 2023 06:51:27 GMT</pubDate>
            <atom:updated>2023-04-07T06:55:41.978Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings! In this article, I am going to discuss the advantages of starting your programming journey with C, a low-level programming language, as opposed to higher-level languages like Python, Java, and others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*xYzSG4DP3zrB3ydxq6gOow.png" /></figure><p>When I began my programming journey, I initially started with Python, which was effective to some extent. However, I found myself merely memorizing syntax and unable to comprehend why certain code worked. I perceived that everything had numerous exceptions, and it appeared as though I was merely reproducing code and algorithms from tutorials without truly understanding them. However, after transitioning to C, I realized it was the most advantageous decision I’ve ever made. In this article, I will explain the reasons why.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*V3OGccUczWO_r9spkrvjmA.png" /></figure><blockquote><strong>The Fundamentals.</strong></blockquote><p>C is often considered a “low-level” programming language, which means it provides direct access to hardware and memory, and allows for greater control over system resources. While this can make C more challenging to learn than some higher-level languages, such as Python or Ruby, it also has a significant advantage: mastering C can make learning other languages much easier. Because C is so close to the hardware, it forces programmers to develop a deeper understanding of how computers work at a fundamental level. This understanding can then be applied to other languages, making it easier to understand their inner workings and write more efficient, effective code. In addition, many modern programming languages, such as Python and Java, have been heavily influenced by C, so learning C can provide a solid foundation for mastering these languages as well. By starting with C, you can gain a deeper understanding of how computers work and build a strong foundation for your future programming endeavors.</p><p>While it may be tempting to start with a high-level language that provides a more user-friendly programming environment, this approach can actually make things more difficult in the long run. High-level languages often abstract away many of the details of the underlying hardware and system architecture, which can limit your ability to think creatively and design truly innovative software. In addition, starting with a high-level language can create a “dependency” on the language’s built-in features and libraries, which can make it difficult to transition to other languages or adapt to different programming environments. By starting with a low-level language like C, you can gain a deeper understanding of how computers work and develop the ability to think creatively about how to solve complex problems. This will serve you well as you progress in your programming journey and encounter more challenging projects and programming environments.</p><blockquote><strong>Easy to learn, hard to master.</strong></blockquote><p>One of the reasons why C is a great language to start with is that it doesn’t have too many features, which makes it relatively easy to learn. Unlike some other languages, which have a vast array of built-in functions and libraries, C provides a relatively small set of tools that you can use to build complex programs. This simplicity can be a real advantage for beginners, as it allows you to focus on the fundamentals of programming, such as algorithm design and data structures. By starting with a language like C, you can develop strong algorithmic thinking skills that will serve you well in your future programming endeavors. C forces you to think carefully about how to structure your code and manage memory effectively, which can be challenging at first, but ultimately leads to a deeper understanding of how software works. By pushing your algorithmic thinking abilities to the limit, C can help you become a more effective and creative programmer.</p><blockquote><strong>Functional Programming.</strong></blockquote><p>Another advantage of starting with C as your first programming language is that it will give you a solid foundation in functional programming. C provides powerful tools for working with functions and pointers, which are key concepts in functional programming. By mastering these concepts in C, you will gain a deep understanding of how functions work and how to use them effectively to solve complex problems. This understanding will serve you well when you move on to more advanced programming concepts, such as object-oriented programming. In fact, many of the principles of functional programming, such as code modularity and data abstraction, are also central to object-oriented programming. By learning functional programming first, you will be well-prepared to tackle these more advanced concepts when the time comes. In addition, a solid grounding in functional programming will help you become a more versatile programmer overall, as you will have a deeper understanding of how to use functions to solve problems in a variety of programming contexts.</p><blockquote><strong>Freedom!</strong></blockquote><p>Another exciting fact about having C as your first programming language is the freedom it provides. Unlike some other languages, which have strict rules and conventions, C allows you to be creative and experiment with different programming styles and techniques. Because C provides such direct access to the hardware and system resources, you have the ability to build complex programs from the ground up, without relying on pre-built libraries or tools. This can be a real advantage for programmers who want to develop software that is optimized for their specific needs and goals. In addition, the freedom of C allows you to think more deeply about how your code works and how to optimize it for performance. By starting with a language that provides so much freedom, you will develop a deeper understanding of programming concepts and gain the skills you need to build truly innovative software. Whether you are interested in building applications, games, or other types of software, the freedom of C will give you the tools you need to achieve your programming goals.</p><p>While the freedom provided by C can be exciting, it’s important to keep in mind that it also comes with a certain degree of risk. Because C provides direct access to the hardware and system resources, it’s possible for programmers to inadvertently introduce errors and vulnerabilities into their code. However, this risk can actually be beneficial for beginner programmers. By making mistakes and encountering errors in their code, programmers can learn valuable lessons about the importance of proper programming practices, such as testing, debugging, and code review. This iterative learning process can be incredibly valuable, as it allows programmers to develop their skills and become more proficient in their craft. Ultimately, the freedom of C can be a double-edged sword, but with proper care and attention, it can be a powerful tool for developing innovative and effective software.</p><h4><strong>Conclusion:</strong></h4><p>In conclusion, C is an excellent language for building a foundation in computer programming, and it doesn’t require years of study to learn its fundamentals. By learning the basics of data types, pointers, functions, and algorithms, you can develop a deep understanding of programming concepts that will serve you well as you move on to more advanced languages. However, it’s important to keep in mind that C is a low-level language, and it may not be suitable for all programming tasks. As you gain more experience and confidence in your programming skills, you can gradually transition to higher-level languages like C++, Java, or Python, which offer greater flexibility and ease of use. Ultimately, the key to success in programming is to focus on developing a strong foundation in the basics and to continue building your skills through practice and experimentation. Whether you’re interested in building software applications, games, or other types of programs, learning C is an excellent way to get started on your programming journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d59796494ccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>