<?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 Gökhan İpek on Medium]]></title>
        <description><![CDATA[Stories by Gökhan İpek on Medium]]></description>
        <link>https://medium.com/@gokhanipek?source=rss-36b9430a4ce7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yFU1YHDTo644UW0aAfGvQA.jpeg</url>
            <title>Stories by Gökhan İpek on Medium</title>
            <link>https://medium.com/@gokhanipek?source=rss-36b9430a4ce7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:51:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gokhanipek/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[Animation with DeviceOrientation event]]></title>
            <link>https://javascript.plainenglish.io/animation-with-deviceorientation-event-dc27209af0b7?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc27209af0b7</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-events]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Tue, 30 Apr 2024 10:25:02 GMT</pubDate>
            <atom:updated>2024-05-13T18:54:49.663Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is the continuation of this article -&gt; <a href="https://gokhanipek.medium.com/how-to-create-gradient-background-for-messaging-apps-05e958bf5356">Gradient Background for Messaging applications</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*1YpGoILEvnv-WInQ.gif" /></figure><p>To animate the background, most of the time, using background-position-x or background-position-y will suffice. These animations typically rely on user interaction, such as clicking a button, focusing on an input, or hovering over an element. However, the scenario I&#39;ll discuss today is different. It doesn&#39;t require users to interact with elements on the page or application. Instead, it relies on the orientation of the device the user is using, particularly if it&#39;s a mobile device equipped with sensors like a phone or tablet. This approach is particularly useful when you want to incorporate typography-related animations.</p><p>Continuing from where we left off, we have the JSX structure and the CSS file ready.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-iqrpvg%3Fembed%3D1%26file%3Dsrc%252FApp.css&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-iqrpvg%3Ffile%3Dsrc%252FApp.css&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Fvitejs-vite-iqrpvg%2F8d71a792d32c79502c139919a1874330&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/b52c697dc53c1cb19fb3257be3e0e125/href">https://medium.com/media/b52c697dc53c1cb19fb3257be3e0e125/href</a></iframe><p>What we need is the check the device orientation and do the animating accordingly.</p><p>For this we will need to use an event called <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event">DeviceOrientation</a>. It’s super cool, just gives you the alpha, beta and gamma values. What these values stand for requires just a little bit of Physics knowledge. About more and better explanation about orientation data, the link is here: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Device_orientation_events/Orientation_and_motion_data_explained">MDN</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0PrYcyyzb8tRv4zAo4baBQ.png" /><figcaption><a href="https://developer.mozilla.org/en-US/docs/Web/API/Device_orientation_events/Orientation_and_motion_data_explained">images</a> are from MDN, device orientation page</figcaption></figure><p>So in short, when we listen to DeviceOrientation, it will return 3 values that we can use to animate. alpha beta and gamma</p><p>These correspond to rotation around z axis, x axis and y axis.</p><h4>Let’s do the coding</h4><p>Anyone who listened to events on the web before, knows what this is,</p><pre>window.addEventListener(&quot;click&quot;, function() {…})</pre><p>We will do something similar, instead of click, it will be deviceorientation .</p><pre>window.addEventListener(&#39;deviceorientation&#39;, handleDeviceOrientation);</pre><p>inside the handleDeviceOrientation method, we can have something like below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db96b7c240d0f36f84ba9e382a96b787/href">https://medium.com/media/db96b7c240d0f36f84ba9e382a96b787/href</a></iframe><p>For JSXELEMENT, we should add the ref property to the element that we applied background color property, and update it’s background-position. For below gist I added both alpha, beta and gamma values destructured but in reality you only need which one/ones you are planning to use.</p><p>And for this one I used only beta to update the `background-position-y` as beta is for the rotation around X axis.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3db7bd13038158572cd18589d3aa1c0/href">https://medium.com/media/a3db7bd13038158572cd18589d3aa1c0/href</a></iframe><blockquote>But still there is one problem. For iOS devices, <a href="https://developer.apple.com/documentation/webkitjs/deviceorientationevent">Apple kept the feature as off</a>, so we need to enable it. And to enable it, <a href="https://forums.developer.apple.com/forums/thread/128376?answerId=615625022#615625022">we need to ask for permissions</a>.</blockquote><blockquote>This is easy to achieve with a simple click event, we can think of it like a popup when the page renders, it looks like this is the only way at the moment. For android devices I couldn’t personally tested it but I am assuming the solution will work for both devices.</blockquote><p>For the solution, what I will do it almost identical to Oleksii Trehkleb did here <a href="https://github.com/trekhleb/trekhleb.github.io/blob/master/src/posts/2021/gyro-web/components/useDeviceOrientation.ts">useDeviceOrientation.ts</a> so I would like to send my respects to <a href="https://trekhleb.medium.com/">Oleksii Trekhleb</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5fe0b0a3f5ae01575d2e5633e1fa195/href">https://medium.com/media/b5fe0b0a3f5ae01575d2e5633e1fa195/href</a></iframe><p>At this point user should have a button and when they click it, the permission will be granted and then we can listen to `deviceorientation` event, and animate the background.</p><blockquote>Please keep in mind, stackblitz won’t show the expected result if the device doesn’t have sensor, and on mobile as well. For working demo: <br>demo: <a href="https://insta-bg.vercel.app/">https://insta-bg.vercel.app</a><br>repo: <a href="https://github.com/gokhanipek/cool-insta-gradient-bg">https://github.com/gokhanipek/cool-insta-gradient-bg</a></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-dsuneb%3Fembed%3D1%26file%3Dsrc%252FApp.jsx&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-dsuneb%3Ffile%3Dsrc%252FApp.jsx&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Fvitejs-vite-dsuneb%2F5f7dfe1633e9cda4d9a3f7fdf5cb59ee&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad861fd8aaa5b32976de8a59de3d2875/href">https://medium.com/media/ad861fd8aaa5b32976de8a59de3d2875/href</a></iframe><p>This is it! This is a very basic example but we can make a lot more than that if we want to. First thing that comes to my mind is on typography area.</p><p>demo: <a href="https://gyroscope-react.vercel.app/">https://gyroscope-react.vercel.app/</a><br>repo: <a href="https://github.com/gokhanipek/gyroscope-react">https://github.com/gokhanipek/gyroscope-react</a></p><p>Thanks for reading!</p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a><strong> | </strong><a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://stackademic.com/"><strong>Stackademic</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc27209af0b7" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/animation-with-deviceorientation-event-dc27209af0b7">Animation with DeviceOrientation event</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Gradient Background for Messaging Apps]]></title>
            <link>https://javascript.plainenglish.io/how-to-create-gradient-background-for-messaging-apps-05e958bf5356?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/05e958bf5356</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gradient-background]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 09:02:11 GMT</pubDate>
            <atom:updated>2024-05-13T18:54:29.875Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*csWFBrP2jc_4zdudcwH2eA.png" /></figure><p>Recently I found out that on Instagram you can select a gradient background not just for the messages, the background of the messages. This got me thinking, how can I apply this on the web?</p><p>Normally this would be simple to do, by just adding background property with either a radial or linear gradient.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae7813172a247f8d0ab964205f26055a/href">https://medium.com/media/ae7813172a247f8d0ab964205f26055a/href</a></iframe><p>We can also apply this to each message bubble in a messaging application but it will look a bit weird.</p><p>For the ones who read from their phones, this is what I am talking about</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*9OjJ0_sO1vcx7fbuGxNsHg.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-y7ofg8%3Fembed%3D1%26file%3Dsrc%252FApp.css&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fvitejs-vite-y7ofg8%3Fembed%3D1%26file%3Dsrc%252FApp.css&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Fvitejs-vite-y7ofg8%2Ffc2851df8982be76fcedf14a63e3fa84&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d13a6d9d333bb52918140b7c9d121a5/href">https://medium.com/media/9d13a6d9d333bb52918140b7c9d121a5/href</a></iframe><p>Instead of this, what we what want to achieve is something similar to how it looks on Instagram chat background. For the people who have no idea or in other words, a boomer like most of people I know — me included. I probably noticed it years later it was introduced. I believe a quick short video would help understand what I am talking about here:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyvhhRiT2aAo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyvhhRiT2aAo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyvhhRiT2aAo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0ece8fd9199f94398fbbf51072d3590/href">https://medium.com/media/d0ece8fd9199f94398fbbf51072d3590/href</a></iframe><p>How to achieve something like this? Obviously adding background color to each message bubble won’t work, they need to look like each bubble is connected.</p><p>For that, we need to apply a concept called masking. There are already a lot of good resources to learn about CSS-masking or SVG masking online. But what we want is something more dynamic, as this will be used in a messaging application and the number of chat bubbles will not be a fixed number.</p><p>For that, we need to apply the background gradient to the parent of the messaging bubbles and act bubbles as the masks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hiqnx0yzBTgT3bz7G1rU6Q.png" /></figure><p>To achieve this, first I create my JSX structure. And apply the styles.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccd53c76163616732ed17e7d86881354/href">https://medium.com/media/ccd53c76163616732ed17e7d86881354/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ebc3a5bb27ee7e139d9850f73e27ce4/href">https://medium.com/media/4ebc3a5bb27ee7e139d9850f73e27ce4/href</a></iframe><p>To mask the rest of the background from bubbles, we need to apply <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow">box-shadow</a>. Below video shows, the magic of box-shadow when it’s applied to the text elements.</p><pre>box-shadow: &lt;x-offset&gt; &lt;y-offset&gt; &lt;blur&gt; &lt;spread radius&gt; &lt;color&gt;</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fw1cX2oxGado%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dw1cX2oxGado&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fw1cX2oxGado%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f439fa692ecaa8e924ae48c84be3f96/href">https://medium.com/media/2f439fa692ecaa8e924ae48c84be3f96/href</a></iframe><p>There is one more trick we need to do here, as the texts won’t be every time 100% width, we need to have a separate element, or a pseudo class and add the white background there as well. If our background was something different, we would need to adjust ours to that color too.</p><p>I will add 2 span elements inside the div, one for the actual text and the other for the rest, which will be for the white background masking again.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ae255ad19fb9afd9327225d0669b143/href">https://medium.com/media/9ae255ad19fb9afd9327225d0669b143/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bc55e4a6452be07455a531feb41d71e/href">https://medium.com/media/7bc55e4a6452be07455a531feb41d71e/href</a></iframe><p>At this point you may realize the bubbles are separated with a gradient background that is consistent with what color is behind them.</p><p>We can add more messages, from an object and map over the them. For the purpose of this article, I added sender option to align the message left or right. In real life scenario it should be for defining either sender or receiver.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8dcac6893bcc3b2a56f7b5883d00d2fc/href">https://medium.com/media/8dcac6893bcc3b2a56f7b5883d00d2fc/href</a></iframe><p>The final result should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*JtGOV7rYFIuupsDLOoENjQ.png" /></figure><p>You can add {item.text} inside the map and show the actual messages too, add border-radius, and have an input to have the functionality to add more messages.</p><p>In my next article, I will show you how to animate the background, on the devices that have access to the sensors such as gyroscopes, compasses, and accelerometers.</p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a><strong> | </strong><a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://stackademic.com/"><strong>Stackademic</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05e958bf5356" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/how-to-create-gradient-background-for-messaging-apps-05e958bf5356">How to Create Gradient Background for Messaging Apps</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advantages and Disadvantages of Using TypeScript]]></title>
            <link>https://gokhanipek.medium.com/advantages-and-disadvantages-of-using-typescript-94e43df172b7?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e43df172b7</guid>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Mon, 08 May 2023 13:11:19 GMT</pubDate>
            <atom:updated>2023-05-08T13:11:19.703Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>TL;DR: Disadvantages are not big at all, TypeScript is the power buff under your sleeves</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QVuJLh-wox028r38STK2lg.jpeg" /></figure><p>TypeScript, as a superset of JavaScript has the rising popularity over the years. It started as a nice to have but nowadays it has become more of a necessity in professional projects.</p><p>So you are considering learning it or start using it in your projects whether it is a small side project or a professional one, and want to know about its advantages and disadvantages or whether it’s a good investment in time and effort. Today we will be focusing on this.</p><p>Small history: TypeScript was first released back in 2012 by Microsoft as a language that compiles JavaScript. And it aimed to fix maybe the biggest complaining point of JavaScript users: static types, and type safety.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90pKMHhYAYJ7RZtY18xs4A.png" /><figcaption>static typing is the most voted feature that’s missing from JavaScript — <a href="https://2021.stateofjs.com/en-US/opinions/#currently_missing_from_js_wins">State of JS 2021</a></figcaption></figure><p>In its earlier days, it was mostly associated with Angular as Angular comes with TypeScript by default. But as the amount of Angular usage increased, TypeScript exposed more and more to the rest of the JavaScript community.</p><p>One thing to note here, whatever you write on TypeScript will also be a valid JavaScript code. It will point out a lot of the mistakes you may encounter on production, as you code and develop your project.</p><p>We can talk about the advantages and disadvantages of TypeScript in these small points:</p><h4>TypeScript enables static typing, accurately defining the type of a variable</h4><p>Even though the name ‘static typing’ should give you enough information about what it is, it may sound confusing to someone as a concept if they are not familiar or never thought about it.</p><p>In JavaScript, you don’t need to define the type of a variable. It will generically understand the type of variable you defined. If you don’t assign a value its type will be undefined.</p><p>JavaScript has 6 built-in types:</p><p>Number, String, Boolean, Symbol, Null, Undefined, BigInt</p><p>You can define much more than this with TypeScript.</p><blockquote>JavaScript is a dynamically typed language, with dynamic types. And the variables in JavaScript are not associated with any particular value type, and can be assigned values of all types. JavaScript is also a weekly typed language, which means it allows implicit type conversion when an operation involves mismatched types, instead of throwing an error. — <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">MDN</a></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1115691c769d5f1b63a2146fb1a96ee9/href">https://medium.com/media/1115691c769d5f1b63a2146fb1a96ee9/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fjs-zmzrlr%3Fembed%3D1%26file%3Dindex.js&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fjs-zmzrlr%3Ffile%3Dindex.js&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Fjs-zmzrlr%2F803a4921636f717e1d0cffdf68d210b3&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb2d8235cb6c85ef62bc924e72479929/href">https://medium.com/media/bb2d8235cb6c85ef62bc924e72479929/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Ftypescript-l3sb5o%3Fembed%3D1%26file%3Dindex.ts&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Ftypescript-l3sb5o%3Ffile%3Dindex.ts&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Ftypescript-l3sb5o%2Fcc1d4f7a45861b7a70c0a990f6789ca4&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/1dea386c61e0ff6a99634155a9f780c1/href">https://medium.com/media/1dea386c61e0ff6a99634155a9f780c1/href</a></iframe><p>So for the examples above, if we were using TypeScript, you would get an error. Here in these examples, it’s obvious why but if you were working on a big project you would not notice why you are getting that error.</p><p>Here you can see just by hovering over variables one, two, and three. For the first two variables, the types are defined and TypeScript shows a warning that if you want to change the value of the variable, use the correct type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*okcMkIQfsB1cnvsY67XZ_w.png" /><figcaption>TypeScript shows the errors</figcaption></figure><p>As a last note on this, TypeScript has the type ‘any’ if you are not sure or want to bypass this type check for some reason.</p><h4>TypeScript grants the developer the power of intelligence</h4><p>In my opinion, this is one of the underrated advantages of TypeScript. You won’t know that you have this power if you only used TypeScript and you realize what you are missing if you stop using it after you go back to Vanilla JavaScript. Intellisense helps with code completion and hints with the code.</p><p>Below Stackblitz projects have the same cars object which is exported from a separate file. In the index.js and index.ts files, ‘cars’ objects are imported and can be used. On the Vanilla JavaScript project, if you try to complete the 6th line, you will not get the properties sedan and hatchback. But in the TypeScript project, you will instantly know what is in the cars object.</p><figure><img alt="a simple javascript object named as cars and has sedan and hatchback properties with brand and color properties inside" src="https://cdn-images-1.medium.com/max/261/1*RuJ9hL4Kuo2XofN3yRhCGg.png" /></figure><pre>const displayedCard = cars.sedan.brand</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fjs-y4atl9%3Fembed%3D1%26file%3Dindex.js&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fjs-y4atl9%3Ffile%3Dindex.js&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Fjs-y4atl9%2Fec1877dedc66bb9eeb4731f4333c4ffc&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d43ff7263e1e09d531df30bda856d2a4/href">https://medium.com/media/d43ff7263e1e09d531df30bda856d2a4/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Ftypescript-m8suft%3Fembed%3D1%26file%3Dindex.ts&amp;display_name=StackBlitz&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Ftypescript-m8suft%3Ffile%3Dindex.ts&amp;image=https%3A%2F%2Fsocial-img.staticblitz.com%2Fprojects%2Ftypescript-m8suft%2Fcc1d4f7a45861b7a70c0a990f6789ca4&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d804ed469bdc209e1840a1ee81e0f730/href">https://medium.com/media/d804ed469bdc209e1840a1ee81e0f730/href</a></iframe><p>And as for disadvantages, if you have never used a type-safe language before, the concept of types takes some time to get used to. Even if it’s not steep, getting up to speed with TypeScript takes some time.</p><p>Also, TypeScript needs to compile to JavaScript so you can’t just open a notepad file and save it as a <strong>js </strong>file and expect it to work right away. TypeScript adds a build step whether it’s Webpack, Babel, or others, it is a required step and there is no other way to prevent it. But if you are using a framework or a library like React, you are going to do it anyway so this may not be counted as a disadvantage.</p><p>Aside from these two, TypeScript creates an illusion that your application is error-prone because you are checking all the types in the application, and every variable, request, and response is type-safe.</p><p>In reality, it is not. At the end of the day, TS compiles to JS. And the build you are deploying to production will not have any of these types. TS just does a type check on the development stage. After that point, you will be dealing with Vanilla JavaScript. You may still encounter some bugs in the production but those will be far less than if you didn’t use TypeScript. You can also reduce those bugs/errors too with unit testing.</p><p>Thank you for reading. For more articles follow me on <a href="https://twitter.com/gipek03">Twitter </a>&amp; <a href="https://gokhanipek.medium.com/">Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e43df172b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript’de Currying nedir?]]></title>
            <link>https://gokhanipek.medium.com/javascriptde-currying-nedir-8ac3500da1d3?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ac3500da1d3</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[closure]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[curry]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Sun, 17 Jan 2021 17:32:24 GMT</pubDate>
            <atom:updated>2021-02-07T06:46:12.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*XyEjW3ifS8sW36mH.jpg" /></figure><p>Yıllar önce JavaScript’i yeni öğrenen alaylı bir yazılımcı iken (hala alaylıyım), o zamanlar, akıl hocam olarak gördüğüm bir arkadaşım, bana JavaScript’i daha iyi anlamak için Closure, Currying gibi kavramları öğrenmemi söylerdi. Bu kavramlar hep aklımdaydı, zaman içinde farkına bile varmadan kullanmaya başladım. Ancak özel olarak üzerine hiç eğilmemiştim. Şu anda çalıştığım şirket ile görüşürken, görüşme yaptığım arkadaşım şöyle bir soru sordu:</p><pre>console.log(sum(2,3)) // 5</pre><pre>console.log(sum(2)(3)) //5</pre><pre>Bu iki durumu sağlayan bir method yazabilir misin?</pre><p>Ve içimden şöyle dedim:</p><p>“Ah, çok kolay! Currying! bunu her zaman kullanıyorum zaten.”</p><p>Ve çözmeye başladım. Ancak belki de görüşmenin heyecanı ile çözemedim. Benim için tam bir hayal kırıklığıydı. Bu makalenin konusu da bu, umarım daha iyi kavramanıza yardımcı olur.</p><p>Higher-Order fonksiyonlar(HOF) ve Saf Fonksiyonlar(Pure Functions) gibi, Currying de programlama dillerinde bir konsepttir. Fonksiyonel programlama dillerinin bize sağladığı güzel bir avantaj olduğunu söyleyebiliriz. Yalnızca JavaScript değil Haskell, Scala, Clojure gibi farklı programlama dillerinde de kullanılır.</p><p>Currying kullanarak, fonksiyon dönen bir fonksiyon (<a href="https://eloquentjavascript.net/05_higher_order.html">bkz: Higher-order functions</a>) yazabilirsiniz. Bunun bize faydası aşağıdaki gibi fonksiyonları,</p><pre>function sum(a,b,c) {<br>    return a + b + c;<br>};<br>sum(10,20,30);</pre><p>buna çevirmemiz konusunda bize yardımcı olmasıdır.</p><pre>const sum = (a) =&gt; {<br>    return (b) =&gt; {<br>        return (c) =&gt; {<br>            return a + b + c<br>        }<br>    }<br>}</pre><pre>sum(10)(20)(30);<br></pre><p>Yani en yalın şekilde, tüm argümanlar kullanılana kadar bize bir fonksiyon dönecek. Eğer Closure konsepti hakkında bilgi sahibiyseniz ya da duyduysanız, Currying’in Closure’lara bağlı olarak çalıştığını farkedeceksiniz.</p><p>Haklı olarak şu soru sorulabilir:</p><blockquote>İstediğim sayıda argüman alacak bir fonksiyon yazabilecekken neden Currying kullanayım ki?</blockquote><p>Bu durumda cevap olarak şunu verebilirim,</p><blockquote>Eğer yazdığın fonksiyon 2–3&#39;ten fazla argüman alıyorsa büyük ihtimalle bir şeyleri fazla karmaşık düşünüyorsun demektir.</blockquote><p>Şaka bir yana, Currying ile ilgili öğrenmeye başladığımda aklıma gelen ilk soru buydu. Karmaşık düşünmekten bahsederken, Currying konseptinin de başlı başına karmaşık olduğu bir gerçek. Görünüm olarak en azından.</p><p>Kopseptin arkasında ise yalnızca matematik var.</p><p>Currying bize aslında birden çok argüman alan ve bunları frameworklerde kullanan fonksiyonlarla çalışmanın yolunu sağlar. Ayrıca matematikte bazı analitik teknikler yalnızca tek bir argümana sahip işlevlere uygulanabilir.</p><p>Bu son cümleyi lise ve üniversitede matematik dersinde duymuş olmanız kuvvetle muhtemel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*o4aGpJv_TstASoFdqXXkqQ.jpeg" /><figcaption>Sanırım bu yüzden yazılımcı olmak için matematik bilgisi önemli diyorlar</figcaption></figure><p>Peki bu bilgi gerçek hayatta(iş hayatında) nerede işimize yarayacak?</p><p>En basitinden, çalıştığınız projede aynı argümanı kullanarak iş yapan birden fazla method olduğunu düşünelim. Defalarca aynı argümanı çağırıp farklı şeyler dönüyorsunuz (return ediyorsunuz).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/134a063a406846ea71e2049bfe747372/href">https://medium.com/media/134a063a406846ea71e2049bfe747372/href</a></iframe><p>orderDeliveryDate metodunu bypass edersek,daha kısa şekilde aşağıdaki gibi olacaktır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ceb6d4c01865c9fefdf7a3e480a0b87/href">https://medium.com/media/4ceb6d4c01865c9fefdf7a3e480a0b87/href</a></iframe><p>Yukarıdaki işlemi Currying olmadan şu şekilde yapardık:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b68be81b25ab36bd729f2be5191163d/href">https://medium.com/media/4b68be81b25ab36bd729f2be5191163d/href</a></iframe><p>Burada yalnızca 3 defa fazladan müşteri ismini yazdığımıza dikkat çekmek istiyorum. Bu durumu Hepsiburada, Trendyol gibi platformlarda milyonlarca sipariş için yapıyor olsaydık, Currying’in değeri daha iyi anlaşılıyor olacaktı.</p><p>Son olarak, daha önce React ve Redux kullandıysanız, aşağıdaki kullanımdan da haberdar olmanız muhtemel.</p><pre>export default connect(mapStateToProps, mapDispatchToProps)(SomeComponent);</pre><p>aslında kaynak kodlara göz gezdirdiğimizde bu satır ile yaptığımız şeyin de yukarda anlatılan kısmın aynısı olduğunu farkediyoruz. Daha fazla ayrıntı için kaynak kodunu inceleyebilirsiniz.</p><p>Aslında ortalama bir React kullanıcısı günlük hayatında farkında olmadan dahi Currying kullanıyor. Bu sebeble yazdığımız kodu daha iyi analiz etmek ve anlamak için Currying, closure gibi kavramlar ile ilgili daha fazla bilgi sahibi olmak yararlı diye düşünüyorum.</p><p>Okuduğunuz için teşekkür ederim. Sevgi ile kalın.</p><p><em>Kaynaklar ve daha fazla okuma için: <br></em><a href="https://blog.benestudio.co/currying-in-javascript-es6-540d2ad09400"><em>benestudio</em></a><em>, </em><a href="https://codeburst.io/callbacks-closures-and-currying-3cc14300686a#:~:text=This%20is%20currying.,arguments%20at%20once%2C%20but%20separately.&amp;text=Or%2C%20like%20in%20this%20case,each%20time%20you%20call%20it"><em>codeburst</em></a><em>, </em><a href="https://dev.to/cesareferrari/higher-order-components-and-currying-in-react-fep"><em>dev.to1</em></a><em>, </em><a href="https://www.nypl.org/blog/2016/12/06/currying-functions"><em>nypl</em></a><em>, </em><a href="https://dev.to/ogzhanolguncu/using-curry-the-functional-way-3pbh"><em>dev.to2</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ac3500da1d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accessing the Webcam with JavaScript and React]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/accessing-the-webcam-with-javascript-and-react-33cbe92f49cb?source=rss-36b9430a4ce7------2"><img src="https://cdn-images-1.medium.com/max/1920/0*hajW2ctiRkBWqQ3u.jpg" width="1920"></a></p><p class="medium-feed-snippet">When I bought a new Microsoft LifeCam in Autumn 2020, I had to download their official software to use it. And instantly hated it. Tried&#x2026;</p><p class="medium-feed-link"><a href="https://itnext.io/accessing-the-webcam-with-javascript-and-react-33cbe92f49cb?source=rss-36b9430a4ce7------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/accessing-the-webcam-with-javascript-and-react-33cbe92f49cb?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/33cbe92f49cb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webcam]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 22:47:51 GMT</pubDate>
            <atom:updated>2024-01-07T22:45:58.213Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[From Research Assistant to Front End Developer]]></title>
            <link>https://gokhanipek.medium.com/from-research-assistant-to-front-end-developer-f46fa177a975?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f46fa177a975</guid>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[frontend-developer]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Sun, 14 Jun 2020 21:01:01 GMT</pubDate>
            <atom:updated>2022-10-30T18:36:29.834Z</atom:updated>
            <content:encoded><![CDATA[<h4>in two years</h4><p>I am a member of some active Facebook groups. In the last 2–3 years I saw posts like this multiple times:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*odMXhrF-mm8Sj92QhnXlWw.png" /></figure><p>And every time these posts show up, I remember how I decided to change careers. The times when I was unhappy, I didn’t have the freedom to change the environment and get more quality of life.</p><p>I feel like the posts like this one you are about to read, encourages people to overcome their fears.</p><p>To have a better understanding of the situation, we need to go back to 6 years past my life.</p><p>Since the day I know myself, whenever I see an astronaut, a scientist, a laboratory, I had been feeling the butterflies in my stomach. I knew I was destined to become a scientist. I loved Physics. It shaped my life.</p><p>So after the bachelor’s degree on Physics, I decided to get a Master’s degree and do some real researching stuff. Learn the techniques. Put my mark on human life, be a part of something improves our life. Publish articles and get recognition. Well, that last part was not my main purpose but every once in a while if I get that, it would be awesome.</p><p>With those intentions, I applied and got accepted to Istanbul Technical University. And in terms of Physics, that’s is one of the best you can go to in Turkey. 6 months later I found “the rockstar” instructor (the idealist type, if an article is not worth <a href="https://journals.aps.org/prl/">Physical Review Letters</a> A or B, that article is not worth the publish.)</p><p>Here, I was doing my dream job. Constantly doing experiments about Graphene and P-STM which is one of the rarest machines you can find but we built it ourselves because otherwise, the university couldn’t afford due to huge prices. (One of them is currently at IBM’s research lab as far as I know).</p><p>My days were spent in front of the software looking at 3 screens and waiting for an experiment to complete at the -1 floor of the ITU Physics department inside the darkness because P at the P-STM stands for photon, so to see the photons, you need to be in the dark. (This is originally more complicated)</p><p>Long story short, I spent nearly 20 months in that laboratory. My results were always getting denied harshly by the instructor and need to work in darkness and mostly being alone made me consider my self-worth. Think about a situation you work from 9 am to the next day 6 pm without a break. And you are reminded of how careless, unsuccessful, how you are the worst. Every other day. While your instructor is using your results to do talks abroad. This was my breaking point. Depression issues started to surface.</p><figure><img alt="our corridor was something like this" src="https://cdn-images-1.medium.com/max/448/1*5lfY9cP_iY3qJ2x3LjbuFw.jpeg" /><figcaption>our corridor was similar</figcaption></figure><p>And I start to think to myself: Do I want to do this? I was feeling like a lonely budgie and my only owner was some douchebag who shouts at me when I wanted to sing.</p><p>That summer, I remembered my other hobby. In my 3rd year of college, they thought us to code (in Fortran). It was old but at least I was building something in which I can see the results right away.</p><p>With that in mind and roughly 1000 dollars in my bank account(2014), I decided to leave my job at the lab but continue my education while improving my skills in software development and find a job as a developer. Being in the dark for 2 years, I wanted something colorful, so Front End Development was ideal for me. It was colorful, normal people see you as a magician because you create the screens they see first. Not the Back End side.</p><p>But 6–7 years ago I had no idea what a Front End Developer or any kind of Developer is. I only heard the keywords like ASP, HTML, Java, C#, C… I decided that I am going to learn, HTML, CSS, JavaScript, ASP, Java in order. And I thought Java was the short version of JavaScript.</p><p>I found some online free course on HTML and CSS and completed it. But all those keywords they called “tags” were new to me. And I’m not gonna lie, it sounded stupid, what is it? ‘head’? ‘body’? And some browser reads it? Uhh… OKAY??? Should I memorize it? Like writing on a paper and study every day?</p><p>Believe it or not, I did that. Wrote on an A4 paper and tried to memorize.</p><p>2 months later, studying all day, got me nowhere.</p><p>I found it ridiculous. And contacted a friend of mine about what should I do next.</p><blockquote>Hey Ozgun, I started learning web development but I don’t know how to proceed. Do you have any advices?</blockquote><p>He replied to me, if you know a little bit of HTML, we have an opening but we don’t do web development. You are going to be a Content Editor, sometimes you need to edit HTML and that’s it. (It turned out he was not working as a developer, I was that clueless)</p><p>I was desperate and ran out of money. I accepted that.</p><p>Turned out job had nothing to do with HTML and CSS. My only duty was to read the texts and find double spaces between words. And get paid moderately. But I sucked at it. It was boring for me.</p><p>6 months later I was fired and unemployed again. Plus, my education postponed 6 more months because the company was so demanding.</p><p>When I was fired, I realized I forgot what I learned about HTML and CSS and I was still not on the JavaScript part yet.</p><p>I continued my studies on HTML and CSS slowly. 6 months later a friend of mine said:</p><blockquote>We have a Front End Developer opening but you have to know Bootstrap. And a little bit of jQuery.</blockquote><p>At that time, I had never heard of Bootstrap before. Quickly, I opened Youtube and typed Bootstrap.</p><p>My idea was to learn as much Bootstrap as I can till the interview day and I knew they were going to want me to do an example project and I had to use Bootstrap. The interview day came, I showed up wearing a “suit” in a hot July noon. All sweaty. They gave me the project, I had around 3 days. I even ruled out learning about jQuery. Seeing all those classes: container, col-md-6 ’s. In my mind I was thinking:</p><blockquote>Let’s change the class names so they don’t think I cheated using Bootstrap.</blockquote><p>And looking back, it was looking pretty weird. For all container classes, I used container1, container2, and so on.</p><p>As you can imagine, they never replied.</p><p>So quick recap, for nearly a year, I was telling everybody about my goal of becoming a web developer and yet I was miserable.</p><p>Around this time, I was out of money, again. I had to stay at my parent’s house, rarely leaving my room and studying both for my Master’s Degree and to switch careers.</p><p>I continued my study of HTML and CSS. Built around 40 single page websites by following KhanAcademy, CodeAcademy, and Freecodecamp. It was again, wake up around noon, start studying, work until you can’t anymore, sleep around 6–7 in the morning and wake up, continue. Also in those times, I already got backstabbed by my instructor at the last minute of course selection period at University, I was without an instructor and I needed one to select which classes I am going to apply that semester. I went to his room and asked “Sir, I think there was an error, I got dropped from your Master’s students list.” He smiled and said:</p><blockquote>Yes, I am aware, I did it.</blockquote><p>Can’t you add me back?</p><p>He smiled again cruelly:</p><blockquote>Nope. Bye. Close the door behind you.</blockquote><p>I was facing the danger of getting banned from my Master’s Degree which was like a statement for me to the ones that doubted me. Quickly I mailed around 5–10 professors and found the perfect one for me, unlike my previous one, caring, positive person. So with him, I was studying Black Holes this time, doing complicated math stuff using software called Maple, and I had to code in it to calculate my results, which was awesome even though I sucked badly.</p><p>Just around that time, a friend of mine told me about a free, government-backed, 6-month web development course she applied and completed. So I applied there too. Before the course, they were interviewing you. You had to be one of the chosen ones. Luckily I was confident of myself, and I made the interviewing teachers believe in myself. Got selected as one of 30 people from around 1000 applied.</p><p>That was also one of the turning points of my career. Good thing, the course included Front and Back End side of web development. You start with SQL, C#, and Winforms, Webforms then MVC in .NET environment. With little to no background with OOP, I sucked at writing C# which was the main point of that course. So, for 5 months, 6 hours a day, every day of the week, I showed up to classes and sit there while had the worst percentage to solve any examples or homework given by the teacher or understand the topic taught by the teacher. At least for the C# and SQL part. The last time I was using an actual software language was 2009 and it had been 7–8 years since. Even it would not count because Fortran and C# have not much in common.</p><p>There were 15 people in the class and I was the worst student there.</p><p>The worst. Hopeless. I hate being the worst one. Our instructor even informed me about it, I can accept failure but I can’t accept not trying. So it was the third time in the last 3–4 years I was sleepless. The course was from 2 pm to 9 pm. I was coming home around 10 pm and studying until 9 am, sleep around 3 hours, and go to course again. I still sucked. I was feeling dumb. About Back End stuff.</p><p>One small upside for me was, the teacher never liked writing HTML or CSS. He even told me about it:</p><blockquote>Gokhan, I think you are good at HTML and CSS. And I am not a fan of HTML and CSS. Maybe you can take over for a week and teach everyone instead of me?</blockquote><p>And to me, that was a great opportunity. First, he saw me the caliber of teaching something, second, this would look amazing on my resume. So I accepted it. Board and the class was mine for a week and I went home and studied all of the HTML and CSS section on W3Schools website. All of it, in only 1 night. I didn’t sleep, created a small personal website as a project for class, and next week, I was pretty confident of my skills to write HTML and CSS. When I started my first job, I understand that I was wrong. But this is a topic for another article.</p><blockquote>I think this applies to everything in life but if you want to learn something, you should be brave enough to be ready, to get out of your cocoon and throw yourself into the fire.</blockquote><p>I showed those 14 students a glimpse of what Front-End side is about, and I made them create a single-page website using only HTML, CSS, and Bootstrap. I was in a situation in which I had to learn Bootstrap overnight and teach about it. I didn’t sleep that night. While teaching, my eyes were hurting. I was dizzy. Not a big deal.</p><blockquote>And I did. This information helped me find my first job.</blockquote><p>5 weeks later, the course ended and before it ended, I was already looking for a job in Istanbul. My main objective was to get a job. Regardless of the location. I think in my 3rd or 4th interview, I got a job offer 3 hours away from my home. I accepted it. It was 2016. And the course was ending in 5 days.</p><p>I was the worst in that class. Hopeless one. And second person to find a job from that class.</p><p>2 years ago I decided to leave my job as a Research Assistant, and now I was a Front End Developer in a Digital Web Agency.</p><p>For 4 months I was there, it was all about learning, acting like a sponge to learn as much as I can. Every day, I woke up at 6 am, went to the office after 3 hours of the trip, got out of the office around 7–8 pm and 3 hours trip home. I had around 1 hour to eat and rest. Then sleep. CSS was more than what I thought, it was hard. jQuery was hard. JavaScript was hard. But just like I said, I threw myself into the fire.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHESKqQ8pAnkCRhWbQ7Eeg.png" /></figure><p>Back in 2016, Angular was releasing 4th version, and React was on the 15th version, and I was still learning about jQuery, far away from what the Front End community was into globally, but I was on my course to get better. I had a long long way ahead of me. And lots to learn. I just didn’t know it.</p><p>After my first experience as a Front End Developer and minimum salary, I was still clueless about what should be my career path. Found another small company and worked there for another 8 months, I was earning %60 more but the problem was they were thinking they hired a Web Designer who can code. And I was thinking they wanted a developer who can design. At the end of 8th month, they told me they are having financial issues and they informed me that I should look for another job. And I joined another team that my course instructor was building. The course where I was the worst student and gave a workshop. For the first 3 experiences I was only building with jQuery and CSS. Still I was far away from React, Angular, SASS, Webpack. But I was starting to build small projects with React by myself.</p><p>Then I joined another company and become a part of a team consists of 15 developers. For me this was the hardest time of my career, it was demanding but luckily all those people were willing to share their knowledge and I even met my unofficial mentor there. We started NGTurkey, the biggest Angular community of Turkey. I dived into the world of TypeScript, Reactive Programming, State Management, and Atomic Design principles.</p><p>On my 4th or 5th experience, I was earning 4 times more compared to my first salary. In roughly 3 years.</p><p>Does this story end here? If this question about changing careers, yes. But just like that wise man said, all the destinations I reached, created more roads to travel. All the answers created more questions. I am excited to improve my vision, my thought. process, and happy to find the parts of Front End Development I am more interested in.</p><p>Changing careers is a tough decision. It’s scary. But it’s less painful than working for a job you don’t like anymore for the next 20–30 years of your life.</p><p>My story is a long one, not like “how I become a developer and earned 1.000.000 dollars in 6 months!”. Being a developer takes little to no time if you know a little big about algorithms. It takes a lot more to be a qualified developer and improve yourself constantly. If I could achieve this, nearly without a budget, you can too. I become the developer I am today by lots of open source material and blog posts, free material people post online. Believe me, I didn’t even buy a single Udemy course. I didn’t pay one penny before I was into my 2nd year into my career. Here these articles I try to post as much as I can and I will is a payback to community.</p><p>For the people who are interested in this career path without the dead ends I faced, I am adding links to get you started faster than I do.</p><p><a href="https://www.freecodecamp.org/">freeCodeCamp.org</a></p><p><a href="https://wesbos.com/">https://wesbos.com</a></p><p>(Wes Bos has a free course and huge discounts for other courses if your money is not valuable compared to dollars, one of the great guys)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f46fa177a975" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Renderer2 in Angular]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/using-renderer2-in-angular-8f80da6756f8?source=rss-36b9430a4ce7------2"><img src="https://cdn-images-1.medium.com/max/733/1*-b5enQnC74Yym5c9-AFiQg.png" width="733"></a></p><p class="medium-feed-snippet">aka this is how we manipulate DOM in Angular</p><p class="medium-feed-link"><a href="https://itnext.io/using-renderer2-in-angular-8f80da6756f8?source=rss-36b9430a4ce7------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/using-renderer2-in-angular-8f80da6756f8?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f80da6756f8</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[renderer-methods]]></category>
            <category><![CDATA[renderer2]]></category>
            <category><![CDATA[renderer2-examples]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Mon, 06 May 2019 13:15:31 GMT</pubDate>
            <atom:updated>2019-05-08T08:36:31.176Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Renderer2 Nedir? Nasil Kullanilir?]]></title>
            <link>https://gokhanipek.medium.com/renderer2-nedir-nasil-kullanilir-579c4a393823?source=rss-36b9430a4ce7------2</link>
            <guid isPermaLink="false">https://medium.com/p/579c4a393823</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[ngturkey]]></category>
            <dc:creator><![CDATA[Gökhan İpek]]></dc:creator>
            <pubDate>Sun, 10 Mar 2019 23:48:21 GMT</pubDate>
            <atom:updated>2019-04-25T07:30:14.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*q_X46je2gMh3KJClkAtSnw.png" /></figure><p>Eğer Ön Yüz Geliştirme kariyerinize benim gibi henüz Javascript konusunda yetkin bile olmamanıza rağmen Jquery ile girmiş ve ön yüzde binbir türlü animasyonu yapabiliyor, butonları zıplatıyor, günleri geceleri simule ediyorsanız, Angular gibi bir framework’e geçiş yaptığınızda ilk zamanlar aklınızda şu soru oluyor: “Uygulamamda DOM üzerinde değişiklik yapmak zorundayım, native methodlar dışında ne kullanabilirim?”</p><p>Bu noktada, arayışlarınızın bir kısmına Renderer2 kullanarak son verebilirsiniz. Çünkü DOM manipülasyonu söz konusu olduğunda Renderer2 kullanabileceğimiz en doğru yöntemlerden bir tanesi.</p><p>Tabii ki VanillaJS bize DOM manipülasyonu için seçenekler tanıyor, ‘document.querySelector’ ile DOM’dan eleman seçip ‘appendChild’ ile DOM’a eleman eklemek, silmek, class ekleyip kaldırmak ve daha fazlası mümkün. Ne de olsa bu bir Javascript uygulaması. Lakin, native methodları kullandığımız taktirde Angular’ın bize sağladığı DOM abstraction yöntemlerinden ve masaüstü, mobil, web worker ve server side rendering gibi bir çok önemli fırsattan mahrum kalıyoruz.</p><p>Siz de benim gibi Awwwards üzerinde (sanat eserinden bozma) sitelere kıskançlıkla ve hayranlıkla bakıyorsanız, Angular’ın bize sunduğu kolaylıklardan, güzelliklerden birisi olan Renderer2&#39;den faydalanabilirsiniz. `CreateElement`, `addClass`, `removeClass` gibi ihtiyaclariniz varsa yine büyük ihtimalle ilk başvurmanız gerekecek özelliklerden birisi Renderer2 olacaktır.<br>(Üstte bahsettiğim örnek söz konusu olduğunda yine de akla ilk gelecek Framework Angular olmayabilir)</p><p>Renderer2 en temelde, Custom Directive yaratılarak kullanılıyor. Zira Directive’ler Angular’da uygulama geliştirmiş her bireyin kullandığı yapıtaşlarıdır. Tüm component’ler aslında birer directive’dir. Bu küçük ama temel bilginin üzerine, basit bir örnek ile gösterecek olursak:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/732e1eea16ac96bf3c9b51a12e6039d2/href">https://medium.com/media/732e1eea16ac96bf3c9b51a12e6039d2/href</a></iframe><p>Bundan sonra html dosyasında yalnızca attribute’u,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b85b270e641dd582565422393df2dc54/href">https://medium.com/media/b85b270e641dd582565422393df2dc54/href</a></iframe><p>Şeklinde eklemeniz yeterli olacaktır. Sayfa ilk açıldığında, ‘off’ class’ı kalkacak, ‘on’ eklenecektir.</p><p>Renderer2&#39;nin Directive ile kullanımı bu şekilde. Component içinde kullanımı için ise, aşağıdaki gibi kırmızı kenarları olan bir button yaratalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bf24ed35e69238b3378d10a65b664b6/href">https://medium.com/media/3bf24ed35e69238b3378d10a65b664b6/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74cabfc985f4ead006c74232f78ec3d9/href">https://medium.com/media/74cabfc985f4ead006c74232f78ec3d9/href</a></iframe><p>Renderer2&#39;nin Directive ve Component içinde kullanımları genel olarak bu şekilde. Eventler ile, Directive yaratarak ve Component içinde kullanımlarının, methodların kendilerini kullanmaya göre daha biraz daha kompleks olması sebebi ile bu 3&#39;üne öncelik verdim.</p><p>Daha fazla bilgi icin, <a href="https://angular.io/api/core/Renderer2">Angular.io</a> üzerinden, diğer Renderer2 methodlarını inceleyebilirsiniz.</p><p>Yazıda başvurduğum kaynakların listesi için:</p><ul><li><a href="https://angular.io/api/core/Renderer2">Angular</a></li><li><a href="https://alligator.io/angular/using-renderer2/">Using Renderer2 in Angular</a></li><li><a href="https://www.concretepage.com/angular-2/angular-4-renderer2-example">Angular 4 Renderer2 Example</a></li><li><a href="https://ngrefs.com/en/v6/core/renderer2">Core: Renderer2 - Angular 6 References</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*wNpGEM8MvNE0IeHlbYUynQ.png" /><figcaption><a href="https://twitter.com/ngturkiye">https://twitter.com/ngturkiye</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=579c4a393823" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>