<?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 Beyza Kalenderoglu on Medium]]></title>
        <description><![CDATA[Stories by Beyza Kalenderoglu on Medium]]></description>
        <link>https://medium.com/@bkalenderoglu?source=rss-13520e30d0f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cIz9M4z5pj4Gx-gx.jpg</url>
            <title>Stories by Beyza Kalenderoglu on Medium</title>
            <link>https://medium.com/@bkalenderoglu?source=rss-13520e30d0f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:07:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bkalenderoglu/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[var-let-const in JS Scope — JS Series #1]]></title>
            <link>https://bkalenderoglu.medium.com/var-let-const-in-js-scope-js-series-1-8270e9f88639?source=rss-13520e30d0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8270e9f88639</guid>
            <category><![CDATA[javascript-scope]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-variable]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Beyza Kalenderoglu]]></dc:creator>
            <pubDate>Mon, 27 Dec 2021 11:59:09 GMT</pubDate>
            <atom:updated>2021-12-27T11:59:09.335Z</atom:updated>
            <content:encoded><![CDATA[<h3>var-let-const in JS Scope — JS Series #1</h3><p>Let’s discuss some basic keywords to initialize variables in JS which are var, let and const. All of the three keywords will lead to us “scope of variables”.</p><ul><li><strong>Global scoped variables</strong> — declared <strong>globally</strong> (outside any function) and can be accessed from anywhere in a program.</li><li><strong>Function scoped variable</strong> — available anywhere inside of the function that is declared in</li><li><strong>Block scoped variable</strong> — only available inside of the block that is declared in (if statement, loop)</li></ul><p>JS used to only have one keyword to declare variables which is “var” keyword. This keyword allows us to declare variables that are <strong>function scoped</strong>. Later that, with the ES6 “let” and “const” keyword were created to declare <strong>block scoped</strong> variables because people started to run into problems with having function scoped variables.</p><p>Let’s clearify it with some examples..</p><pre>if(true) {<br>    var varVariable = &quot;I am var variable&quot;; <br>}</pre><pre>console.log(varVariable);</pre><pre>if(true) {<br>    let letVariable = &quot;I am let variable&quot;; <br>}</pre><pre>console.log(letVariable);</pre><p>The output on the console will be..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*232s-fd6EuNliztIyPuL2Q.jpeg" /></figure><ul><li>As expected varVariable returns “I am var variable” because this varVariable is function scoped and if there is no function that it’s inside, it is just globally scoped. So it’s available outside of the block.</li><li>When we get to the letVariable, we simply get a error saying that it can’t find the “letVariable” that is because the letVariable only defined within the block that is created. It works exactly the same with “const” keyword.</li></ul><p>Another thing that is unique to var keyword is that variables can be reassigned multiple times by redeclaring them.</p><pre>if(true) {<br>   var varVariable = &quot;I am var variable&quot;;<br>   console.log(varVariable); <br>}  </pre><pre>var varVariable = &quot;I am the REAL varVariable&quot;;<br>console.log(varVariable);</pre><p>It will redefine the varVariable and the output will be..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*pR8cJUo63SpBovHS9Ks7dA.jpeg" /></figure><h3>What’s the problem with the var keyword?</h3><p>Redeclaring variables, because it allows us to accidentally overwrite variables that we don’t intend to. Rather than the var keyword, let and const keyword does not allow redeclaring variables and save us from making small mistakes.</p><p>Let’s try the same approachfor let and const keyword ⇒</p><pre>let letVariable = &quot;I am the letVariable&quot;;<br>let letVariable = &quot;I am the REAL letvariable&quot;;</pre><pre>const constVariable = &quot;I am the constVariable&quot;;<br>const constVariable = &quot;I am the REAL constVariable&quot;;</pre><p>In this case let and const keyword take care of the problem and we’ll get the error shown below..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*zMFjzn58S953zZ1tGJ6KvA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*uvnwtyG14laMfj4-gtn7Nw.jpeg" /></figure><h3>So, how the let keyword differ from the const keyword?</h3><p>The const and let works exactly the same in every single way except const does not allow you to reassign variable. <strong>It means that const is for values that never change.</strong></p><pre>let age = 24;<br>const eyeColor = &quot;brown&quot;;</pre><pre>age = 25;<br>eyeColor = &quot;blue&quot;;</pre><p>We’ll get the error of..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*7QUX4MEmTNSZ2UoXYRL7CQ.jpeg" /></figure><p>As you can see from the above example, const prevents us from changing eyeColor value to different one.</p><h3>But wait…</h3><p>Actually, const does allow us to change the properties of the object. Also same for the array!</p><p>For example,</p><pre>const constVar = { age: 24 };<br>constVar.age = 25;</pre><pre>console.log(constVar);</pre><p>The console shows…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*66G1_NiCiUTjD5kmFn_1lw.jpeg" /></figure><p>There is no error in the console. So, const keyword only prevents us from changing the actual value of reassigning the variable to a different value but not actually changing the different properties in that value.</p><p>Lastly, it is recommended to use const over let unless you need the change the value of the variable and that way you make sure that you don’t accidentally change the value if you don’t want to.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8270e9f88639" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Single Responsibility Prensibi — SOLID]]></title>
            <link>https://bkalenderoglu.medium.com/single-responsibility-prensibi-solid-f43067ef9a11?source=rss-13520e30d0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f43067ef9a11</guid>
            <dc:creator><![CDATA[Beyza Kalenderoglu]]></dc:creator>
            <pubDate>Sat, 05 Jun 2021 17:45:32 GMT</pubDate>
            <atom:updated>2021-06-05T17:55:27.296Z</atom:updated>
            <content:encoded><![CDATA[<h3>Single Responsibility Prensibi — SOLID</h3><p>Herkese merhabalar! İlk makalemde daha etkili kod yazmaya yardımcı olan SOLID prensiplerinden Single Responsibility Principle (Tek Sorumluluk Prensibi’ ne) yer vereceğim. Başlamadan önce, akıllarda oluşabilecek bir soruya açıklık getirelim.</p><blockquote>SOLID nedir ve daha etkili kod yazmamıza nasıl yardımcı olur?</blockquote><p>2000&#39;li yılların başında Michael Feathers tarafından hayatımıza giren S.O.L.I.D. nesneye yönelik programlama prensipleri, OOP geliştiren her yazılımcının bilmesi gereken temel prensipler olarak kabul edilmektedir. Robert C. Martin tarafından “Nesne yönelimli programlama ve tasarımın ilk beş prensibi” olarak derlenmiş ve prensiplerin baş harflerinin birleştirilmesi ile S.O.L.I.D. olarak adlandırılmıştır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzwARbvHUg1RlZ7LYyLCrg.png" /></figure><p>SOLID prensipleri geliştirilen yazılımın anlaşılır , daha okunabilir, geliştirilebilir ve yeniden kullanılabilir, sürdürülebilir ve esnek olmasını sağlayan, kod tekrarını engelleyen yaklaşımlar ve ilkeler bütünüdür.</p><p>SOLID prensiplerinin ilk harfini temsil eden, Single Responsibility Principle (Tek Sorumluluk Prensibi) ile devam edelim…</p><p>Tekli Sorumluluk Prensibinin temel amaçları şu şekildedir:</p><ul><li>Bir sınıfın, bir metodun, her bir iş yapan yapının tek bir görevi olması gerektiğini savunur.</li><li>Bir metot sadece kendi görevini yapmalı, bir sınıf sadece o sınıfla ilgili metotları, alanları, özellikleri barındırmalıdır.</li><li>Birden fazla işle veya katman ile ilişkilendirilmemeli, her bir yapının tek bir sorumluluğu olmalıdır.</li></ul><p>Örnek ile ilerlemek gerekirse, bir youtuber’ı düşünelim. Bu youtuber’ın popülerliği ile birlikte işbirliklerinin de arttığını varsayalım. İçerik üretmek, prodüksiyonu oluşturmak , video düzenlemek, işbirliği tekliflerini değerlendirmek, diğer sosyal medya platformlarını etkili kullanmak gibi tüm görevlerin bu youtuber’ ın sorumluluğunda olduğunu varsayalım. Bir süre sonra işler planlandığı gibi gitmeyecek ve yönetmesi zor bir hal alacaktır. Peki, her bir sorumluluğu yerine getiren farklı kişiler olsaydı ve her birinin sorumluluğu birbirinden ayrılmış olsaydı, yönetmek ve yeni gelecek talepleri uygulamak daha kolay olurdu değil mi? İşte! Tekli Sorumluluk Prensibi tam olarak bunu savunuyor.</p><p>Benzer bir senaryoyu koda dökelim ve daha yakından inceleyelim. Kötü bir örnekle başlayalım ve Video sınıfı oluşturalım.</p><pre>public class Video{</pre><pre>   private string VideoBaslıgı{get; set;}<br>   private string VideoKategorisi{get; set;}<br>   private string VideoKonusu{get; set;}</pre><pre>   public void videoCek() {<br>       Console.WriteLine(&quot;Video cekildi...&quot;);<br>   }</pre><pre>   public void videoDuzenle() {<br>       Console.WriteLine(&quot;Video düzenlemesi yapıldı...&quot;);<br>   }</pre><pre>   public void videoYukle() {<br>       Console.WriteLine(&quot;Video yuklendi...&quot;);<br>   }</pre><pre>   public void produksiyonHazırla() {<br>       Console.WriteLine(&quot;Prodüksiyon hazırlandı...&quot;);<br>   }<br>}</pre><p>Gördüğünüz gibi, Video sınıfına bütün sorumluluğu yükledik. Fakat, video düzenlemek, prodüksiyonu hazırlamak gibi metotlar Video sınıfının sorumluluğunda olmamalıdır. Tek Sorumluluk Prensibi ne diyordu ? Bir sınıf sadece o sınıfla ilgili metotları, alanları, özellikleri barındırmalıdır. Prensibe uymak için bir düzenleme yapalım ve Video sınıfına ait olmayan metotlar için Kameraman, VideoEditoru ve Produktor olmak üzere üç ayrı sınıf oluşturalım.</p><pre>public class Kameraman{  <br> <br>    public void videoCek() {<br>       Console.WriteLine(&quot;Video cekildi...&quot;);<br>    }<br>}</pre><pre>public class VideoEditoru{</pre><pre>    public void VideoDüzenle() {<br>        Console.WriteLine(&quot;Video düzenlendi...&quot;);<br>    }<br>    public void videoYukle() {<br>        Console.WriteLine(&quot;Video yüklendi...&quot;);<br>    }<br>}</pre><p>Kameraman ve VideoEditor için sınıflarımız hazır. Aynı işlemi Produktor için de yapalım.</p><pre>public class Produktor{</pre><pre>    public void ProduksiyonHazırla() {<br>        Console.WriteLine(&quot;Prodüksiyon hazırlandı...&quot;);<br>    }<br><br>}</pre><p>Ve son olarak Video sınıfına bakalım.</p><pre>public class Video {<br>   <br>   private string VideoBaslıgı{get; set;}<br>   private string VideoKategorisi{get; set;}<br>   private string VideoKonusu{get; set;}<br>}</pre><p>Gördüğünüz gibi, görevleri farklı sınıflara ayırarak, her sınıfın kendi sorumluluğunu almasını sağladık. Böylelikle ileride herhangi bir geliştirme, değişiklik olduğunda daha kolay bir şekilde ve yapıyı bozmadan kodumuza entegre edebiliyor olacağız.</p><p>Bir sonraki yazımda görüşmek üzere…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f43067ef9a11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>