<?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 Eren Altın on Medium]]></title>
        <description><![CDATA[Stories by Eren Altın on Medium]]></description>
        <link>https://medium.com/@erennaltin?source=rss-eeaad0f95b10------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KFvgzY_JUJkVpW_eDPS9fA.jpeg</url>
            <title>Stories by Eren Altın on Medium</title>
            <link>https://medium.com/@erennaltin?source=rss-eeaad0f95b10------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:36:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erennaltin/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 I learned from Google’s leadership course]]></title>
            <link>https://medium.com/@erennaltin/what-i-learned-from-googles-leadership-course-60505aa11c9e?source=rss-eeaad0f95b10------2</link>
            <guid isPermaLink="false">https://medium.com/p/60505aa11c9e</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[leadership-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Eren Altın]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 19:45:22 GMT</pubDate>
            <atom:updated>2026-09-14T07:32:52.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZiXpjBKrWinu5El-2Aewvw.avif" /></figure><p>I started coding in high school to create a “Bandersnatch” version of a Turkish drama called “Forbidden Love”. Until the beginning of 2026, I had worked with several leaders and teams, but I had never been the leader myself. Being a leader seems to be an obvious career path in theory; what about in practice?</p><h3>The leaders who taught me</h3><p>Engineering isn’t only about tools, and software engineering is much more than coding. It demands skills and experience that you need to learn along the way. Coding, understanding the architecture, working under pressure, mentoring, and coaching are all necessities of a senior engineer. These are skills that are shaped brick by brick. For example, I learned that making a mistake is a part of the job when I did something horrible during my first year at Pragmasoft; Ahmet Kızıltan said:</p><blockquote><em>“</em>If a mistake teaches you what went wrong and how to avoid it, then it isn’t a failure at all.<em>”</em></blockquote><p>I never repeated the same mistake.</p><p>I learned that “the best solution” does not always align with broader goals and organizational plans when Ihsan Serdaroğlu said:</p><blockquote>“Why does a simpler solution not work out here? Is your solution worth your effort to implement it and the cost of maintaining that complex system?”</blockquote><p>These are just small moments and examples of how my thinking has been shaped as an engineer, and how I want to shape my team.</p><h3>What does Google think about it?</h3><p>Google offers four connected courses about the topic. One by one, I will share my notes and what I did with them.</p><h4>Create a High-Performing Team</h4><p>People can tell when sympathy is fake. You cannot fake sincere interest in someone. It is the first and most important lesson of this course:</p><blockquote>“Care about people to care about people”</blockquote><p>Before you think about performance, you need to build the team itself, and the first step is knowing the people. What do they want to learn? What are their long-term goals? What can you give each to help them succeed? How do they like to talk? Some want every detail, some want it short. Do not be someone just assigning tasks. Conduct regular 1-on-1s to keep in touch and talk more than daily work. One tip that stuck: Open up a bit yourself so people feel safe doing the same.</p><blockquote>“How a team works together is more important than who is on the team”</blockquote><p>After you build your relationship with individuals, you need to build up the team. This part is more complicated because it means creating an environment that strengthens open communication and trust, encouraging contributions, and discussing mistakes alongside success freely. Conflicts can arise; it is easier to solve them as a team when the culture is about learning and support, not blaming.</p><blockquote>“As an individual, you are responsible for the work you deliver. As a leader, you are responsible for all the work done by your team.”</blockquote><p>You need to realize your output is the sum of your team’s output. So, it is not about you knowing everything and handling every detail yourself. As the youngest in the room who had just gotten the title, it was the hardest part of my job to say “I don’t know” or delegate tasks to people I already knew, since I was a developer. I was like, “Let me learn that,” or “I can handle that myself.” Changing my idea of performance from an individual to a collective effort helped me fix that.</p><p><strong>What I did: </strong>I started by scheduling regular 1-on-1s with everyone. I learned their goals, strengths, and priorities, and even about their daily lives. I shared mine. That really helped us build trust and discuss issues confidently. We started to run bi-weekly “Tech Speak 💻” meetings where we discussed what we wanted to work on. For example, some wanted to improve routing. Someone else discussed security. Someone talked about logging and performance monitoring, etc. That gave us a platform where we share knowledge and support each other.</p><h4>Set and Achieve Team Goals</h4><p>Working towards a greater goal is empowering. Your team needs to see how their individual efforts connect to the bigger goals. Therefore, you need to find out how they can add more by asking these questions:</p><ul><li>What kind of work problems do you love to solve?</li><li>Where do you feel you could add more value if you had the opportunity?</li><li>What areas of the business are you especially curious about?</li></ul><p>In order to evaluate answers, you can apply this framework:</p><ul><li><strong>Clarity</strong>: How clearly can individuals explain their roles and why they matter?</li><li><strong>Meaning</strong>: Why are they doing it?</li><li><strong>Impact: </strong>They should see their efforts make a difference<strong>.</strong></li></ul><p>There is an easy way to satisfy all three aspects: produce SMART goals.</p><p>Even though goals are usually long runs, you can divide them into milestones because progress should be visible and should be celebrated. By setting milestones that both parties agreed on and are proud to be a part of, as a leader you will have something easily trackable and as an individual they will get something to achieve day by day.</p><p>Lastly, seniority is gained through experience. For learners to gain that experience, you need to give them meaningful ownership of the work and provide active coaching along the way. Juniors don’t become seniors by being protected from difficult problems; they become seniors by being trusted with them, supported through them, and given the opportunity to learn from them.</p><p><strong>What I did: </strong>I started planning issues by dividing them into milestones and encouraging my team to do that without my asking. We added a 15-minute session after each sprint planning to agree on the plan. That lets us see our progress clearly and celebrate through milestones! Also, that helped me plan my support for different team members according to their plan beforehand.</p><h4>Support Individual Growth and Development</h4><p>Active coaching is not about giving directions. It’s about helping them build their own plan. There are some crucial points you can take advantage of. For example, you can make direct eye contact or reflect what you just heard. These will show your team you are all ears and fully focused on them. For remote teams like mine, turning on the camera makes a big difference. Below you can find an example dialog:</p><ul><li><strong>Team member</strong>: “I’m having a problem.”</li><li><strong>Manager</strong>: “How are you thinking of handling it?”</li><li><strong>Team member</strong>: “I know XYZ information, so I guess I could try ABC approach.”</li><li><strong>Manager</strong>: “What else could be helpful?”</li><li><strong>Team member</strong>: “I should talk to Alice from Marketing and Bob from Finance.”</li><li><strong>Manager</strong>: “Tell me more about that.”</li><li><strong>Team member</strong>: “They both want this fixed. With their support, it’ll be easier to convince Carol in upper management.”</li><li><strong>Manager</strong>: “So you want to get Alice and Bob to agree with your plan before showing it to Carol?”</li><li><strong>Team member</strong>: “Yeah, exactly. I’m thinking I’ll write up a quick proposal, check with them, and if we all agree, we’ll present it to Carol together.”</li><li><strong>Manager</strong>: “You seem confident in this approach.”</li><li><strong>Team member</strong>: “Yes, thank you for the help.”</li></ul><p>Notice that the manager does not propose a solution or ask yes/no questions but waits for the member to find their own solution. Although it usually works, sometimes it might not. In this case, you should not wait forever. If the conversation heads toward a bad solution, say so and explain why, but be careful:</p><blockquote>“Listen to learn, not listen to win.”</blockquote><p>Sometimes you may think that the decision is clear and no further talking is required. You’ve made up your mind, and that is it. Do not forget that listening to a different perspective and thinking through it may change yours as well.</p><p>Beyond what you think, listen carefully to what your team thinks about your leadership. That is called “Upward feedback” and it is a true way to find out whether your ideas match your team’s. It is important to ask for feedback as well as to give it. Feedback is an effective tool for a leader, but it is a skill that you need to improve. Good feedback is:</p><ul><li><strong>Actionable</strong>: Can the person take a concrete step toward a solution?</li><li><strong>Timely: </strong>Is it relevant right now?</li><li><strong>Specific</strong>: Does it describe the moment, the action, or the impact?</li></ul><p>There is a model called SBI to structure this:</p><p>Clarify the <strong>situation</strong>, describe the specific <strong>behavior</strong> you observed, and explain its <strong>impact</strong>. Avoid statements about personality, character, or personal traits completely.</p><p>That does not mean avoiding difficult conversations. They are important and inevitable because they are the real source of trust.</p><p><strong>What I did: </strong>Right after completing the course, I sent a survey to my team about my leadership (Obviously using <a href="https://teamflect.com/">Teamflect</a>) and scheduled 1-on-1s to talk about it. The questions were from the course:</p><ul><li>How have I tried to improve my management skills during the last three months?</li><li>What is one management skill that I have successfully improved? How have I improved it?</li><li>Which management skill can I improve to add the most value to the team I manage?</li></ul><p>They sincerely answered my questions and gave me feedback. Besides the nice things they said, one said that:</p><p>“Sometimes you are too quick to block me from thinking about advancement. Your reasons are usually such as:</p><ul><li>No time to do that.</li><li>Too complex for us, no need.</li><li><em>I think that is a better way.”</em></li></ul><p>That struck me because I thought that I was listening carefully, but I realized sometimes I was pushing hard instead of active listening.</p><p>Another of them said that:</p><p>“Sometimes you become too lost on your own work, and I hesitate to disturb you because you are already busy.”</p><p>The first part, that sometimes I deep dive into my own developer job, was expected, but hearing that it creates hesitations made me uncomfortable, because I always had leaders I could go to, and I want to be that for my team.</p><p>Now I focus more on listening and coaching, rather than dictating solutions and blocking first.</p><p>Additionally, I can confirm the SBI model works! I am using it all the time when I need to give feedback. It helped me to make my feedback clear and pointed at concrete improvements.</p><h4>Grow as a Manager</h4><p>Let&#39;s circle back to the beginning: As a leader, you’re responsible for how your team is doing, not only yourself. Leadership is not something you can do alone. So know your team, help them succeed in their goals, and listen to them. Upward feedback is crucial here. It matters what they think about you and your leadership as well as what you think about your leadership. Therefore, regularly conduct self-evaluations. Another angle you need to manage is time.</p><blockquote>“Time is the currency of our life” by John Kretschmer</blockquote><p>It is the same when you are working. One meeting, then another. A quick question, a small get-together. They drain your time without you noticing. That is why you need to invest in a time-management strategy. You can start by:</p><ul><li>Identifying where your time goes</li><li>Deciding what is worth your time</li><li>Protecting your focus</li></ul><p><strong>What I did</strong>: I started to plan my days more carefully. Detecting the patterns. Most of my meetings were in the afternoon. My team mostly needed me in the mornings. It was harder for me to focus on development right after eating. So now my schedule looks like this:</p><ul><li>Mornings are for the team, not focus hours.</li><li>I eat lunch at 11:30, earlier than everyone else. So, when I am back, I can handle boring stuff like preparing for meetings, etc. Then I protect the stretch before meetings for the real work.</li></ul><h3>In conclusion</h3><p>As a new leader, I see a clear difference between being a good engineer and a leader. There are things I can learn, and others I can only experience.</p><p>In this course, I learned that asking for feedback is one of the best ways to find out how you are doing and what I need to work on. Thus, I found out that I need to work on my coaching skills. I need to be more available for my team; maybe I need to plan my time more carefully. It taught me that individual effort and achievements are not my priority as a team lead. My priority needs to be my team’s output and growth.</p><p>I am not the leader I want to be yet, but I am working on it. I have a clearer path toward developing those skills.</p><p>I believe this course might help you build those skills too.</p><p>Thank you for reading.</p><p>Eren</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60505aa11c9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sence neden JavaScript “non-blocking”?]]></title>
            <link>https://medium.com/@erennaltin/sence-neden-javascript-non-blocking-e4ac1ed3c662?source=rss-eeaad0f95b10------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4ac1ed3c662</guid>
            <category><![CDATA[threads]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[concurrency]]></category>
            <category><![CDATA[browsers]]></category>
            <dc:creator><![CDATA[Eren Altın]]></dc:creator>
            <pubDate>Sun, 27 Aug 2023 20:01:23 GMT</pubDate>
            <atom:updated>2023-08-27T20:02:33.679Z</atom:updated>
            <content:encoded><![CDATA[<p>Bir mülakatta “tamam iyi hoş asenkron çalışıyor ama, neden sence böyle bir yapıya ihtiyacı var JavaScript’in? Nasıl yapıyor threadleri mi kullanıyor?” sorusu, bu konuyu daha derinlemesine öğrenmem için bir kapı araladı bana. Bu sırada Philip Roberts’ın 2014 yılında bir JSConf’ta bunu en basit haliyle açıkladığını gördüm.</p><p>Eğer İngilizce ile aranız kötü değilse tam sunumu buradan izleyebilirsiniz:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8aGhZQkoFbQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8aGhZQkoFbQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8aGhZQkoFbQ%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ceb2480b42c554992ed73b9f25c70cb6/href">https://medium.com/media/ceb2480b42c554992ed73b9f25c70cb6/href</a></iframe><h3>JavaScript aslında nasıl çalışır?</h3><p>Burada karşımıza single-thread, callbacks, V8 Chrome runtime gibi terimler çıkıyor. Eğer bu terimlere aşina değilseniz, ilk olarak onlar hakkında okumanızı öneririm. Kısaca açıklamak gerekirse:</p><p><strong>Thread: </strong>Türkçe karşılığına “İş parçacığı” diyebiliriz. Bir program, içerisindeki görevleri gerçekleştirmek için iş parçacıklarına ihtiyaç duyar. Bu parçacıklar işletim sistemi tarafından zamanlanabilen ve diğer parçacıklar ile birlikte yürütülebilen küçük işçiler olarak düşünülebilir. Bu işçiler birlikte çalışabileceği gibi, tek bir işçi ile de tüm iş yapılabilir. Tek bir iş parçacığının tüm işi yaptığı durum “single-thread” olarak isimlendirilir.</p><p><strong>Callbacks: </strong>Çok temel ve kısaca anlatmak gerekirse callback de bir fonksiyondur. Onu özel kılan şey başka bir fonksiyonun tamamlanmasının ardından çağırılmasıdır.</p><p><strong>V8 Chrome Runtime: </strong>JavaScript tarayıcılar üzerinde çalışmak için uygun bir ortama ihtiyaç duyar. V8 ise JavaScript’in çalışabilmesi için bu ortamı yaratmakla görevli bir motordur. İşletim sistemi ve tarayıcı arasında bağlantı kurar ve süreci yönetir. Ayrıca JavaScript’in günümüzde bu kadar popüler olmasını bir nevi V8&#39;e borçluyuz. Bknz: <a href="https://nodejs.org/tr">Node.js</a></p><h4>JavaScript Nedir?</h4><p>Philip burada bunu JavaScript’in kendini “a single-threaded non-blocking asyncronous concurrent language” olarak tanımladığını söyler. Tam olarak Türkçe’ye çevirdiğimizde “<strong>tek bir iş parçacığı </strong>ile <strong>bloklanmayan</strong>, <strong>asenkron </strong>ve <strong>eş zamanlı </strong>çalışan bir dil” anlamına geldiğini görürüz bu tanımın. Tek bir iş parçacığı ile nasıl bloklanmayan bir yapı kurulabilir? İşte burası JavaScript’in alameti farikası. JavaScript bunun için bir <strong>call stack</strong>, bir <strong>event loop</strong>, bir <strong>callback queue</strong> ve <strong>Web API</strong>’ı kullanır.</p><p>O zaman V8&#39;de bu yapılara sahip olmalı değil mi? Nasıl yok?</p><p>V8 sadece bir <strong>call stack</strong> ve bir <strong>heap</strong> ile operasyonları yönetir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*M41cUPY999vvijB5ajbK2g.png" /><figcaption>V8 Engine Structure</figcaption></figure><p>Fakat V8&#39;in <a href="https://github.com/v8/v8">kodunu</a> incelerseniz göreceksiniz ki içerisinde setTimeOut, HTTP request ya da DOM gibi şeyler içermez. Ama bunlar bizim JavaScript’i kullanırken ihtiyacımız olan temel yapılar değil mi? Nasıl yok?!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcXUvaK33VE4yCrx8Mn9fQ.gif" /><figcaption>Big picture of how does browser handle JavaScript</figcaption></figure><p>Aslında bu temel şeyler tarayıcı tarafından bize sağlanır ve tarayıcı hepsini bir arada kullanır. Yani tüm gerekli yapılar V8 motorunun içerisinde değil. Peki ya nedir bunlar?</p><p><strong>Call Stack: </strong>JavaScript bir “single-threaded” programlama dili. Yani tek seferde yalnızca tek bir iş yapabilir. <strong>Yani program tek seferde sadece bir kod bloğu çalıştırabilir. </strong>Call stack ise temelde programda nerede kaldığımızı kaydeden bir veri yapısıdır. Yani kod bloğunu yürütmeye başladığımızda bu call stack’e kaydedilir, o blok ile işimiz bittiğinde ise bu call stack’ten silinir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmQKhi_g7M0xXNezB-f0zQ.gif" /><figcaption>The Call Stack</figcaption></figure><p>Peki hocam, bu gerçek hayatta nerede karşımıza çıkacak?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cj2vvH0sVin7T36VUo6ljw.png" /><figcaption>Error Stacktrace</figcaption></figure><p>Eğer bu kod bloğunu tarayıcıda çalıştırırsanız size çıktı olarak bu hatayı verecektir. Gördüğünüz üzere hataya giden yol adım adım yazmakta. Bunu da bize call stack sağlamaktadır.</p><p>Başka bir örnek ise JavaScript geliştirirken mutlaka karşılaştığımız bir hata:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDAZunMoI19Io1bsIlJy6A.gif" /><figcaption>Maximum call stack error</figcaption></figure><p>Burada sorun stack’in boşalmasına izin vermeden sürekli eklemeye devam etmek. Stack, alabileceği limiti doldurduğunda V8 bize bir hata verecek ve daha fazla kod bloğu yürütemeyeceğini bildirecektir.</p><p><strong>Blocking: </strong>Philip burada aslında tam bir tanım yapmak yerine örnekler ile anlatmaktadır. Örneğin console.log çalışan threadi bloklamazken uzun süren while döngüleri, görüntü işleme, network request gibi şeylerin tamamlanması uzun zaman alabilir, bu da thread’i cevap beklemeye zorlar yani bir nevi <strong>bloklar</strong>. Burada <strong>blocking </strong>için Philip’in kendi tanımı “things that are slow” yani yavaş gerçekleşen şeylerdir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*oygc5ELAj4xag5qMBgESfw.gif" /><figcaption>Network requests blocking main thread</figcaption></figure><p>Java, C++ gibi programlama dillerinde özellikle yeni thread’ler oluşturmuyorsanız, karşılaşacağınız durum bu olacaktır. Peki bu bir sorun mu? Hayır. Single thread kullanımı bir tercih dahi olabilir. Bu JavaScript için bir sorun mu? Evet! Hadi tarayıcımızın bu şekilde çalıştığını düşünelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*wW0U0SDw3KDQ99t9epsr8Q.gif" /><figcaption>Network requests blocking main thread demo</figcaption></figure><p>Göründüğü üzere Philip “run” tuşuna bastıktan sonra ekranda tıkladığı hiçbir şey çalışmıyor. Üstelik butonun aktiflik durumu dahi değişmiyor çünkü motor kod bloğundan cevap gelene kadar <strong>render </strong>işlemini dahi yapmıyor. İşlem bittikten sonra stackte biriken diğer işlemlerin yerine getirildiği de gözden kaçırılmamalıdır.</p><h4>Çözümü yok mu?</h4><p>Call stack aslında basit bir veri yapısı, adı üstünde bir stack demiştik. Görevi ise program akışında nerede bulunulduğunu takip etmektir. Yeni eklenen görevler en üste eklenmekte ve tamamlanır tamamlanmaz stackten silinmektedirler. <strong>Blocking </strong>bloklar<strong> </strong>ise uzun süren ve stackin boşaltılmasını geciktiren kod bloklarıdır. Peki bu kod bloklarını stack yerine, başka bir “şey” içerisinde tutsak, sorun çözülür mü?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QnDbuWRysRGVttqGl1PirA.gif" /><figcaption>Magically appearing code 🤩</figcaption></figure><p>setTimeout fonksiyonun 5 saniye sonra çalışmaya ayarlı olduğu görünmektedir. Fakat stack gözlemlendiğinde setTimeout’un belirip kaybolduğu, <strong>en az 5 </strong>saniye sonra ise yeni bir kod bloğunun stackte belirdiği görünmektedir. Stack boşken, yani yeni bir kod bloğu eklemek üzere hiçbir şey yapılmıyorken bu nasıl gerçekleşebilir? Yeterince soru sorduğumuza göre, bunları cevaplamaya başlayalım.</p><p><strong>Concurrency &amp; the Event Loop</strong></p><p>Evet JavaScript runtime tek seferde sadece bir iş yapabilir. Yani bir kod yürütürken aynı zamanda bir AJAX isteği yapamaz. Bu işlemleri <strong>eş zamanlı </strong>olarak yapabilmemizi sağlayan ise tarayıcının sadece runtime’dan ibaret olmamasıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcXUvaK33VE4yCrx8Mn9fQ.gif" /><figcaption>Big picture of how does browser handle JavaScript</figcaption></figure><p>Büyük resmi tekrar hatırlayalım. Şimdiye kadar sadece runtime’dan konuştuk. Kalan bileşenleri de devreye alalım. <strong>Web API</strong> aslında direkt olarak erişilemeyen thread’leri kullanmaya yarar. Bu thread’leri görevlendirmek için istekler yapılır ve bunun sonucunda onlardan cevap olarak bir <strong>callback </strong>gelir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jem82jxGnru0nIVpikFGpw.gif" /><figcaption>The whole browser system works for concurrency</figcaption></figure><p>Biraz önce bilinmeyen “şey”, burada web API’lar, task queue ve event loop’u temsil eder. SetTimeout web API’a istekte bulunur ve web API’da bir zamanlayıcı tetiklenir. Zamanlayıcı süre dolduktan sonra <strong>callback</strong>’i <strong>task queue</strong>’ya iletir. Burada belki de en basit işlev ise <strong>event loop</strong> tarafından gerçekleştirilmektedir. Event loop stack ve task queue’yu kontrol eder. Eğer stack boş ise task queue’da ilk sırada bulunan callback’i alır ve stack’e aktarır.</p><p><strong>Burada gözden kaçırılmaması gereken nokta şudur: Event loop sadece stack boş ise task queue’dan bir callback’i stack’e iletir.</strong></p><p>Örneğin SetTimeout fonksiyonun delay kısmı 0 olsa dahi, “there” en son yazılacaktır çünkü callback fonksiyonu stack’e diğer fonksiyonlar sonlandırıldığında aktarılacaktır.</p><h4>Single-thread ama çok da değil gibi?!</h4><p>Sonuç olarak JavaScript bir “single-threaded non-blocking asyncronous concurrent” yazılım dili. Bunu da kendisi için çalışan “yardımcı” thread’lere borçlu. Yapıyı incelediğimiz zaman tüm program tek bir thread üstünden yürütülüyor fakat <strong>blocking </strong>olaylar diğer thread’ler tarafından hazırlanıyor, JavaScript sadece hazırlanan sonuçlarla ilgileniyor.</p><p>Harika bir restauranta gittiğinizi ve tüm gece hikayeler anlatarak birlikte olduğunuz insanları eğlendirdiğinizi düşünün. Bu sırada sizden sipariş alınacak, yemekler hazırlanacak ve size servis edilecektir. Yapmanız gereken ise sadece sipariş vermek ve afiyetle yemeğinizi yemek olacak. İşte JavaScript’te yapması gereken tek şeyi yapar, ve ona sunulan tüm görevleri yerine getirir, görevlerin hazırlanması ile ilgilenmez.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4ac1ed3c662" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>