<?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 Umut Afacan on Medium]]></title>
        <description><![CDATA[Stories by Umut Afacan on Medium]]></description>
        <link>https://medium.com/@umut_afacan?source=rss-c8d120a93a35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fJuJGf9yqZwW0kLO.</url>
            <title>Stories by Umut Afacan on Medium</title>
            <link>https://medium.com/@umut_afacan?source=rss-c8d120a93a35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:44:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@umut_afacan/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[A Journey of Workstation Setup]]></title>
            <link>https://medium.com/@umut_afacan/a-journey-of-workstation-setup-9d60ecdcd2d1?source=rss-c8d120a93a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d60ecdcd2d1</guid>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[setup-guide]]></category>
            <category><![CDATA[setup]]></category>
            <category><![CDATA[developer-stories]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Umut Afacan]]></dc:creator>
            <pubDate>Mon, 28 Mar 2022 16:26:22 GMT</pubDate>
            <atom:updated>2022-08-19T12:41:27.430Z</atom:updated>
            <content:encoded><![CDATA[<p>As the software engineers that we all actually need is a just computer, merely a laptop in general, which has generally all components we need such as screen, keyboard, touchpad, camera, microphone, speaker. So every effort and money we spend in that regard will aim only enhance our working experience. And I believe it’s totally fine with working basic setup and all we do is pleasing ourselves. Having fancy setup won’t make you 10x developer at all, yet there could be some benefits for someones.</p><blockquote>Before we begin the story, I should mention I am not any kind of physician or ergonomics expert, comments and advises are depends on purely personal experience and out sources.</blockquote><h3>Constraints</h3><p>The aspects of enhancements may be simply categorised in three different term: <strong>aesthetic</strong>, <strong>ergonomics</strong> and <strong>functionality</strong>. These three, I think helps to increase joy of working, health and and so productivity. There is also a term, <strong>mobility </strong>which could be said in comparisons but it is not my concern. Of course, they are not iron rules, could be change for every individual but rest of the writing will be my personal ideas.</p><p>Firstly, I may explain my constraints for these aspects. Aesthetic and functionality is highly debatable topics, but simply I declare my motive like that more usable screen more functionality, more free space more aesthetics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*Dw0yW23qoIN48t_TD_hKKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*jT5kjFK1Cl_kzzXd-NpLYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*Q2TfMwDiP2yHdG3wnjoGBg.png" /></figure><h4>Ergonomics</h4><p>The last one is most important for that reason I would like open up a bit, also still debatable but there is sources we can depend. I believe majority can join at some certain values. So for ergonomic, I take in the consideration <a href="https://www.blitzresults.com/en/ergonomic/">the correct position</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FqgCKPelaOdkCrZK.png" /></figure><p>By adding my comment, these may be simply pointed:</p><ul><li>Top of screen should be on the eye level.</li><li>Screen should be straight ahead us.</li><li>Elbows and knees should be at 90° angle.</li><li>Screen should be approximately distance of arm length.</li></ul><p>Afterwards from this point, I will accept these requirements below are satisfied:</p><ul><li>Feet should stand on floor or on stand.</li><li>Chair height should be adjusted accordingly.</li><li>Desk should be at height of elbows.</li></ul><p>To do these above, taking in consideration the most of the work chairs are height adjustable, we need height adjustable table or modifying it, or just simply placing stand below our feet. And for my opinion, corner desks are not comfortable and useful, so I assume we have flat rectangular desks.</p><p>Another trouble is the term called <a href="https://en.wikipedia.org/wiki/Carpal_tunnel_syndrome"><strong>carpal tunnel syndrome</strong></a>, evet it may be considered as occupational disease for developers or other similar professions. Again repeating, I am not MD or so, if you suffering from this disease you should definitely take professional aid. But to sum up from my understandings:</p><ul><li>Wrist should be flat.</li><li>Lateral wrist movements should be avoided.</li><li>Middle of wrist should not be under pressure.</li></ul><p>There is simple solutions I’ve learned:</p><ul><li>Hovering over the keyboard, so less wrist angle and less pressure.</li><li>Lower sensitivity of mouse to make wider arm movements rather than micro movements from wrist.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*StB-vrFLzKyIJ7IR" /></figure><p>The well known solution, using wrist rests for keyboard and mouse, is generally serves as negatively against to this problem, not help. <br>Of course there is a lot options to use such as track pad, track ball, slim keyboards, split keyboards etc. I’m not experienced at all, but after this point I will accept we’ve taken measures against that problem.</p><p>Lastly, there is also other points I won’t mention deeply such as lightning or screen features. But simply I’m trying to go with:</p><ul><li>Sufficiently enlightened room/work environment. Not direct light to the eyes</li><li>Flicker-free and low blue light screen</li></ul><h3>Setups</h3><p>My setup is evolved in years, I tried to push forward in limitation of my budget and possibilities. Before we begin explaining items individually in final setup. I would like show you previous setups I have and inspect them. I think it will be more beneficial to explain you and you may inspire based on your constraints.</p><blockquote>These setups are based on mostly screen options and positions, which is personally most important. Down these comparisons not focusing on other computer peripherals and accepting correct sitting positions are satisfied by chair and table.</blockquote><p>These numbers are arbitrary and totally my personal evaluation. Even budget is simplified, and taking consideration laptop is 0. Screen is 30, ultra-wide 70, rest of peripherals are 5. And some are considered as 0 because we can find alternative solutions. Functionality is calculated based on sum of screen sizes, according multiplying factors for primary and secondary. Screens are accepted as 24&quot; or 27&quot;. For ergonomics, I’ve used more complicated evaluation but it simply focuses screen usability and keyboard positioning.</p><h4>1) Just Laptop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ie11DbTmFzf1e52JK5h67A.png" /></figure><p>This will be our foundation for improvements. The most of companies are provides at least a laptop. Or as developers we need one :) <br>For the non laptop setups may be considered in some setups below, but for comparison I will use base from this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVKnTaUHf6_pVHq2SaZCBA.png" /></figure><p><strong>Ergonomics:</strong> Uncomfortable arm positioning, not sufficient distance to screen, and lower screen. At least direct angle all the time.<br><strong>Functionality:</strong> The smallest screen and so functionality. <br><strong>Aesthetics:</strong> Simple, almost empty desk, no distraction at all. Hence at it’s at max.</p><h4>2) A Screen in middle, the laptop on side</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lb4yHolGfKWuZ80n77KvDw.png" /></figure><p>So now company or we our own, provided a screen to ourselves. Because screen is already positioned middle, some people just use like that. Maybe it could be more pleasing look, or some other reasons. We may call this as Jr. ‘s Setup. Just because mostly there is no investment at all. And this is one of the worst setups.</p><blockquote>As a side not, I’ve included a stand under the screen, to make more ergonomic position, and didn’t take in calculation because it’s cheap. You may see some people place a box or ball of paper under monitor in companies, it’s a sign they are not junior anymore :D</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1AZCaHRflz1JihRtvkjWA.png" /></figure><p><strong>Ergonomics: </strong>Much worse than just laptop, shoulders and/or neck will hurt after a while. Keyboard positioning is horrible even without using screen. <br><strong>Functionality:</strong> As the external screen is main, there is a huge increase prior to laptop.<br><strong>Aesthetics:</strong> There is more distractions to base, and lower symmetry so there is sudden decrease.</p><h4>3) A Screen on side, the laptop in middle</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfCs-TlJz6uw2Lb5Ei7PTw.png" /></figure><p>It’s also common usage in offices, but generally homes. We place screen to side, like a direct addition to base laptop setup.<br>I tend to find it better because more comfortable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i04MVjsor3H5QXUmna0bBA.png" /></figure><p><strong>Ergonomics:</strong> Significantly increases, almost back to base setup. Rate of external screen usage will have both negatively and positively affects.<br><strong>Functionality:</strong> Decreases because now our main screen is smaller, bigger screen a bit wasted. I tend to code on main because more comfortable.<br><strong>Aesthetic:</strong> In that perspective table is more open, due to screen is pushed towards the corner. So little bit better.</p><h4>4) The laptop under the screen</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oAK71hjUwxGBaVYaRzcZ4w.png" /></figure><p>I found this is one of the most practical solution without spending. But mostly requires a screen stand (can be solved by a box or books, no visual will be seen) and maybe main screen is bit higher than ideal position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iAx7pyb54LVLXijl8WzfKw.png" /></figure><p><strong>Ergonomics: </strong>Of course much better positioning to prior one. Although still lacking keyboard comfort and secondary screen positioning.<br><strong>Functionality:</strong> Increases due to usage of screens are better. <br><strong>Aesthetics:</strong> I found there is increase, takes less space on desk, looks more tidy.</p><h4>5) A screen in middle, the laptop on side with a keyboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ivb-aTjdpou9dUDTlCbqaQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ciJ8jqJSXxqDv3c8WeiBdg.png" /></figure><p>With a simple keyboard, our setup improves greatly. Many companies don’t provide a keyboard(or mouse). And people don’t want make investment in their office setups. But I think this small investment will give much comfort. In my early career, with my first months I bought a keyboard for office.</p><p><strong>Ergonomics: </strong>Major increase, main screen usage, sitting position, arms could be ideal with that. <br><strong>Functionality:</strong> There won’t be any significant change of course in screen usages.<br><strong>Aesthetic:</strong> Even the look is more complete and “professional”, there is more stuff on desk so I call it a tie.</p><h4>6) A screen in middle, the laptop ELEVATED on side with a keyboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wNkUEejscNpFXFiaS_VsRQ.png" /></figure><p>So the problem with prior setup was laptop screen was not accessible easily. Along with ergonomics problem, also height difference between screens are distracting.</p><p>This kind of improvement could be achieved by a box or a couple books for free, but using something like that will make better in aesthetically.</p><p>This kind of accessory almost never supplied by companies. And also workers tend to not make invest in their office setup, but nowadays we see these more often. One of the first enhancement to our setup with our desire on top of standards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1-rDq3GmELkuNH18EsmwA.png" /></figure><p><strong>Ergonomics: </strong>Certainly it will benefit us, neck movements and eye strain will reduce depending of usage rate of secondary screen.</p><p><strong>Functionality: </strong>I called tie due to same screens and almost similar usability. But one important benefit is<strong> camera angle </strong>which much better in this position, in long meetings we can maintain better posture.</p><p>Also moving windows between screens are easier which is also heavily depends on usage.</p><p><strong>Aesthetic: </strong>Rising laptop from desk gives a bit more spacious environment, and with this kind of item, you can place other stuffs under the laptop. So there is a slight improvement.</p><p>7) <strong>Dual screen with laptop</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pcJe_XhM3nsYCiP4.jpg" /><figcaption>Not mine, just an example for screen positioning.</figcaption></figure><p>I’ve used these in my office setup for a while, some companies provide a two screen to employees for that reason my focus will be there.</p><p>There is a tons of configurations with dual screen and a laptop. Such as laptop in the middle, both screens are flat, secondary screen is vertical, stacking two monitors.</p><p>But I found the best one for me is that a primary screen in front of us, secondary screen and the laptops are on sides with slight angle. Because the most my time spent in primary screen which is ideal position with slight angles of side screens gives better viewing angles to these screens. For the side screens, vertical positions could be used however for the vertical viewing not comfortable for me against to its little benefit.</p><p>On the other hand, 3 screens setup could be evaluated in this category. As a developers, I believe we don’t need too much screen. Of course, a log, a documentation, a git tree, a console, a messaging application, even a Spotify or a Youtube or a crypto coin prices tab could be opened up in side screens.</p><p>Moreover, some may prefer to use more than 3 screens. It’s up to preference but still better to use lesser screen due to ergonomic reasons and lesser distraction population. And I find it’s hard to arrange screen positions and spare space in desk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*7qVhVVYe8HFN3ypT.jpg" /><figcaption>triple screen setup</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*twhAKbi1s0n8fMzu" /><figcaption>sky is the limit.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z45DErQTmbxtl3ynu4aNjg.png" /></figure><p>Although there’s a lot of options, we could say that the most feasible functionality is in this setup.</p><p>According to our logic in this text, ergonomics are decreasing a bit. Likewise, aesthetic is too.</p><p>And we need to spend more money for little practical benefit.</p><h4>8) <strong>Dual screen with closed laptop</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*1ZPGfSdUHCACHwuKVkuLGg.png" /></figure><p>This setup is almost identical to screen with elevated laptop setup. But there also are tons of options so we can open up a bit quickly. Personally, this kind of one screen is in the middle, secondary on the side is the best for me. My main work is done in middle, some other stuffs I need lesser could be opened in secondary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3NOqj2hz6ZgBUJNB.jpg" /></figure><p>Even though, this setup in the image looks great and very symmetrical, bezel in the middle makes you work either left or right screen mainly. And which is not ideal for ergonomics just because our head should be angled towards to sides most of the time.</p><p>There is <a href="https://www.youtube.com/watch?v=l1N3jlgqcQ4">a great video</a> about this topic, you see alternatives yourselves.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fl1N3jlgqcQ4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dl1N3jlgqcQ4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fl1N3jlgqcQ4%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/4da237a24bcc23c93517da6cba6eecd2/href">https://medium.com/media/4da237a24bcc23c93517da6cba6eecd2/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JhW5YxGqm32gqFBqv0w5Zw.png" /></figure><p>Not need to say much, reduced functionality, increased ergonomics and aesthetic against to 2 screens + laptop (3 screens setup).</p><p>When it compared to using external screen against to laptop’s screen (2 screen vs 1 screen + laptop) will benefit more due to better screen.</p><h4>9) Single screen with closed laptop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5f8-mYvmE3sAzy5vDkKHAQ.jpeg" /></figure><p>This is one my latest setup, after the mess in picture at bottom.</p><p>Of course some cable management, a monitor arm, vertical laptop stand, and getting rid of all stuffs on table gave me this cleaner look.</p><p>But the real difference is that closing laptop which provided me a much more spacious environment, no matter how I clean the table, unnecessary laptop’s keyboard was bothering me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yXuFpn81yUQN0z7OPci79Q.jpeg" /><figcaption>Mess</figcaption></figure><p>I realised secondary screen was not useful and necessary at all. Although my screen 24&quot; is smaller than my ideal 27&quot;, still its provides essential workspace.</p><p>I admit that sometimes I needed to external screen.</p><p>Of course precondition for this setup is an <strong>external webcam.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4kJxBLS7Bx9gFPLmDXkCw.png" /></figure><p>As I believe, <strong>the most ergonomic </strong>setup is this. We could focus on only one monitor at a time with ideal posture above.</p><p><strong>Functionality: </strong>Decreases definitely, no need to discuss.</p><p>And <strong>aesthetically is the best </strong>one is this setup in my opinion. The cleanest desk possible.</p><h4>10) Ultra-wide screen</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bFbw1Ir7c6AT3tMfY_GO7A.png" /></figure><p>So finally my latest setup. After lacking with smaller and low resolution screen, I’ve decided to go with 34&quot; ultra-wide screen. I will explain all details at last. But for screen perspective it has benefits of single screen with more content.</p><p>Definitely, <strong>ultra-wide screens are expensive</strong>, even they costs more than two screens at same specs.</p><p>Before writing, I’ve waited for a while to experience more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlY6304E6UBLwlos4J9FpA.png" /></figure><p><strong>Ergonomics: </strong>Decreases a bit of course, edge of the screens are not quite perfect to see.</p><p><strong>Functionality: </strong>Increases, on top of single screen more space for a narrow tab is quite handy most of the time.</p><p><strong>Aesthetically: </strong>Inevitably more desk space is allocated, monitor arm is almost required.</p><h4>11) Elevated laptop (bonus)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZUr_vDhEbSQ5ooKK8T-Pw.png" /></figure><p>It’s a budget ergonomic alternative, even though screen size is smaller, with little investment you can get most benefit for working longer period of times. I got upset when see people are working in just laptop and complaining about hurting neck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6yh_3QNdBa-C6I3U2rSsQ.png" /></figure><p>Just buying an external keyboard and stuffing some box or books under the laptop can give you this formation.</p><p>Not other benefit but ergonomics are increasing greatly.</p><h3>FINAL SETUP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8AKlPtO4BC6Dfv-y75U3g.png" /></figure><p>Here is my final setup, I will explain every item I use in there.</p><h4>1) Screen</h4><p>Lastly, I’m using a LG’s <a href="https://www.lg.com/us/monitors/lg-34gn850-b-gaming-monitor"><strong>34GN850-B</strong></a>,<strong> </strong>34&quot; ultra wide curved screen, which costs almost a used car price unfortunately. However I wanted a screen which I can use for both gaming and office, which has high refresh rate, IPS screen, high resolution not even USB-C charging, 38&quot;. One example <a href="https://www.lg.com/us/monitors/lg-38wn95c-w-ultrawide-monitor">LG 39WN95-C</a> has great reviews, feedbacks and features everything except 4k but it costs much much more. Besides on other features, curvature is another point for ultrawide screens that I found unnecessary and unaesthetical earlier but as I get used to this thing, it helps to see edges of screen, reduces glare and not that disturbing as visually.</p><p>Before this one I generally used 27&quot; 1440p screen for a long time, I think it’s sweet-spot in every aspect. Of course sometimes I had to use 24&quot; 1080p screens which are okay too. When this monitor compared with 27&quot; 1440p, resolution and vertical size are almost identical, yet we gain some (half of 27&quot;) space in horizontal. It becomes very handy in meetings (zoom and browser side by side) and using Xcode (2 tabs) along with design or simulator. However, <strong>does it worth spending that much money for office usage? Definitely not. </strong>Still there is cheaper alternatives with lower refresh rate for just office usage, they might be ideal for workstations or buying two 27&quot; screen will be cheaper to an ultra-wide screen with same specs.</p><h4>2) Keyboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*fJDVXBz6n0TtGsfbAbRPmA.png" /></figure><p>Currently I’m using a <a href="https://www.keychron.com/products/keychron-k6-wireless-mechanical-keyboard"><strong>Keychron K6</strong></a> which is mechanical keyboard nowadays it’s so popular. It’s a nice one, not so expensive and has a lot feature. Lately there is a lot of alternative to this keyboard. By the way mine is bit modified and If you have this keyboard or planning to buy definitely I recommend them to mod it. I bought almost 2 years ago but not used too much until modding it. I am not expert about mechanical keyboards but here is the list.</p><ul><li>PBT keycap set from <a href="https://www.aliexpress.com/item/1005002587476102.html?spm=a2g0o.9042311.0.0.27424c4dnmi1T5">aliexpress</a> which improved sound of keyboard a lot, quieter and thockier sound. And original keycaps are so sticky and finger oils makes them irritably shiny. Also my new keycap set is DSA profile which has lower keycap height and flat profile that works better for me.</li><li><a href="https://www.youtube.com/watch?v=44Wv4OGdmu4"><strong>Lubing switches</strong></a> makes much better in terms of sound and typing experience. Of course it takes a lot time to apply but it’s worth it. Even you don’t change cheap gateron switches, lubing turns a decent keyboard. Otherwise scratchy switches are hell to use.</li><li><a href="https://www.youtube.com/watch?v=X2UOzyMS8RU"><strong>Foam Mod</strong></a><strong>: </strong>Adding foam inside keyboard case, I’ve simply cut and placed a piece of box foam, and sound became more muted.</li><li><a href="https://www.youtube.com/watch?v=-vhpHjlkRgQ&amp;t=360s"><strong>Holee Mod:</strong></a><strong> </strong>And a set of modifications over stabilisers makes space bar and other big key’s sounds much better. Irritating scratchy, rattly sound is removed.</li><li><a href="https://www.youtube.com/watch?v=g7-syoxeIBQ"><strong>Tempest Mod:</strong></a><strong> </strong>Simply adding painter’s tape under the pcb, changes sound profile of keyboard. I don’t recommend if you are happy with muted keyboard, it amplifies some of sound.</li><li>And a cheap wrist rest foam which I cut down to size of my keyboard.</li></ul><p>As a summary, using mechanical keyboard could be great if you have or make a decent one. But in anyway it’s better than any high profile membrane keyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*i1-4trzRyRVCJH4cJBuV0w.png" /></figure><p>But it doesn’t mean a mechanical keyboard is must. For a long time I’ve used Apple keyboard, I found it quite perfect because of easy connectivity and sleek profile. Personally, I prefer over a most of mechanical keyboards. And it’s one of the quietest keyboard in market, if you working from office, it’s very important. And there is a lot good pre-made keyboard with low profile like Logitech master keys etc. For me, they are better than any cheap mechanical keyboard.</p><p>I may use any mechanical or Apple or any other but definitely <strong>I prefer %65 or %75 layout</strong>, I think the num pad keys is pretty useless and takes to much space on desk, in the end we are not accountants. So smaller keyboard is better for me. And lastly <strong>US layout is so important</strong> for me, I feel much comfortable in comparison to ISO layout. Of course I’ve started using keyboards with Turkish ISO, later on I’ve started English ISO from suggestions of my friends, after getting used that I’ve seen such a big improvement, but using ANSI layout makes it more perfect.</p><h4><strong>3) Mouse</strong></h4><p>In this article I didn’t even mentioned about the mouses, I’m using an Apple Magic Mouse for 3-4 years, quite happy with gestures and low profile. On contrary many people’s complains about it, I like it. In my opinion, flat angle of my wrist works better than some ordinary mouses for avoiding carpal tunnel.</p><p>However, I’m using at lower sensitivities so I make big arm movements rather than and micro wrist movements, it helps a lot too. I think first thing people should do that before changing their mouses with vertical or more ergonomic ones.</p><p>I’ve used an Apple Magic Trackpad earlier but even it’s so useful, hard to use and makes my wrist hurt too much after a while due to high lateral movements in wrist. <br>Still I have one a Magic Trackpad too, It’s great to use it you have all movements like pinch, scroll etc, and clicks are much much quieter than Magic Mouse or any other mouse. Switching between them time to time could be possible practice for that.</p><h4><strong>4) Webcam</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*AwwZX_pYMhmtxHTqtd0TnA.png" /></figure><p>Third essential thing for my setup is that a webcam, I’m using <a href="https://www.logitech.com/nl-nl/products/webcams/streamcam.960-001281.html">Logitech Streamcam</a> which I’m happy with that, but I don’t recommend. It’s too expensive for benefit, even I bought mine from a discount. There is cheaper alternatives for example <a href="https://www.logitech.com/nl-nl/products/webcams/c920-pro-hd-webcam.html">Logitech C920</a>.</p><p>Besides to its image quality, where macbook’s webcam is pretty good, real benefit of webcam is angle, during a long meeting using laptop’s webcam in side, makes my neck hurt after a while in awkward position. Even if you prefer to use laptop open in the side, I may recommend to buy an external webcam for ergonomics.</p><h4><strong>5) Vertical Laptop Stand</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*4t8KtQRFEECU-FMsJnl3Iw.png" /></figure><p>I found them pretty overpriced, so budget users should avoid. You may use some other methods like placing laptop on desk or drawer or DIY solutions. Mine is <a href="https://www.omoton.com/collections/l2-laptop-stand/products/upgraded-laptop-vertical-stand-omoton-3-in-1-macbook-laptop-holder-dock-with-sturdy-silicone-pads-for-ultra-protection-suitable-for-iphone-ipad-macbook-pro-surface-samsung-android-tablets-black"><strong>Omoton Adjustable Vertical Stand</strong></a> which is solid, sturdy stand. But I don’t recommend it, simpler ones are more than enough, rubbers on sides are not useful, due to macbook gets super hot, placing phone might not be good idea. My reason to buy this model is using like down below, however it’s not usable with that angle macbook’s screen activates which I don’t want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*2HrbEFUIdryd7tyhFkSieQ.png" /></figure><h4>6) Monitor Arm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yXfWZiYjIY1HcKbx.jpg" /><figcaption>Mine</figcaption></figure><p>I am using <a href="https://www.amazon.nl/gp/product/B0861284GB/ref=ppx_yo_dt_b_asin_title_o02_s02?ie=UTF8&amp;psc=1"><strong>HUANUO Double Monitor arm</strong></a><strong>. </strong>It’s cheaper product, I bought possibility to use two monitor but currently I have one. It’s sturdy but not great, so floating design could be problem for heavier monitors. But this kind of arms are much better for different type of screens, instead flat arm’s like below.</p><p>I am not experienced different brands or types, so I don’t recommend this one freely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*UAyoReH0WiGm24Cu.jpg" /><figcaption>Alternative</figcaption></figure><p>However I can suggest that a monitor arm, if you suffer from adjusting screen height and position ideally. And/or you want to keep you table clean and open.</p><p>You can see the change made by monitor arm in <strong>setup 9.</strong></p><h4>7) Large mouse pad</h4><p>I’m using <a href="https://www.dark.com.tr/cevre-birimleri/mousepad/dark-elite-force-serisi-mouse-pad-mikro-dokumali-yuksek-performans-oyuncu-mousepad-850x400mm.html"><strong>a Dark mouse pad</strong></a> for almost 5 years, definitely recommend for both home and office setups even you use a trackpad. It makes better look, muted sounds for keyboard. And I think it avoids from wrist callus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/0*pjzZvf4CEOF6GRCf.jpg" /><figcaption><a href="https://www.jaad.org/article/S0190-9622(05)03016-1/fulltext">https://www.jaad.org/article/S0190-9622(05)03016-1/fulltext</a></figcaption></figure><h4><strong>8) Screen Light Bar</strong></h4><p>I’ve noticed this accessory lately this year, then I bought. It really helps in nights and even day time in darker weather. Although we can turn on our light bulb, mine is not sufficient to illuminate my desk, and this one can be adjustable so I can make it dimmer or brighter as how much I need.</p><p>Mine is <a href="https://banggood.onelink.me/zMT7/40c4af6"><strong>Yee light Screen Light Bar</strong></a><strong> </strong>which has also back lighting, along with <em>cool</em> RGB effects, brighting room a bit more helps me to reduce eye strains.</p><p>Also it has remote controller with fancy looking, I admit that the reason to buy for this item. But I need to say this product is <strong>very expensive</strong> for it’s benefit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*UjQ_UyWoSBHQ-yeu.jpg" /></figure><p>There is less expensive alternative <a href="https://www.mi.com/global/product/mi-computer-monitor-light-bar/"><strong>Xiomi Monitor Light Bar</strong></a><strong> </strong>which lacks of back lighting but has controller and same main light.</p><p>There is also a newer model for curved screens, <a href="https://www.aliexpress.com/item/1005003083161209.html"><strong>Lymax Curved Screen Light Bar</strong></a><strong>.</strong></p><h4><strong>9) Microphone</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/0*Yj1GBY_fZpwj-LCs" /></figure><p>My choice is <a href="https://www.bluemic.com/en-us/products/yeti-x/">Blue Yeti X</a>. I am not expert in music or sound recording, yet after a small research I found large variety of options, then I’ve chosen this one due to it was near to my budget in discount and in the best seller list. It’s usb microphone, plug and play thing is very convenient and I can use both camera and microphone from single Logitech G-Hub application. My reason for buying external microphone is that using laptop away from me and closed position, bluetooth headphones’ microphones are basically bad even for Airpods pro or Sony mx3, and also while microphone in use their sound quality is drastically decreases probably due to bluetooth transmission limits.</p><h4>10) Microphone Arm</h4><p>One of the best performance/price product is <a href="https://www.tonormic.com/products/tonor-t30-mic-arm-stand">Tonor T30</a>. After buying external microphone, It was standing on desk and bothering me while in not use and also it was too far away from my mouth so I needed to turn up gain power which results more background noises along with my voice. An arm solves these kind of problems and I am using it like similar to down below where microphone is bit lower than this, it doesn’t block my vision, not seen in camera and also not interfere with my hand over keyboard, other solutions might be better in terms of voice quality but this usage is perfect for me. Don’t scare with that awkward look, when the meeting is over, I just push forward away from me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*s9-4T1R7A8BX8y9L" /><figcaption>It’s not me, a photo by Official site.</figcaption></figure><h4>11) Drawer (Unseen Hero)</h4><p>I bought an Ikea Micke Drawer unit because it’s cheaper than the popular Alex Drawers especially in terms of shipping price. Stuffing everything into this drawer made huge improvement to my setup. In before, no matter how I organise items on desk notebook, pen, cables etc. which are sources of mess in my desk. It’s effect is greater than others such as monitor arm or laptop stand while creating a cleaner setup.</p><h4>12) Cable Basket (Hero under the hood)</h4><p>Last but not least component is cable basket/tray which is placed under the table. There is nothing to say much obviously packing up cables to somewhere unseen is better to make more spacious and tidy setup. It’s also very cheap when it compared to other components, even a single laptop charger block on table can ruin whole <strong>aesthetic</strong> and take up considerable space on desk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*Dp_51Yu6DynsyeYpYPwVcw.png" /><figcaption>Brand: ‎Scandinavian Hub</figcaption></figure><h3>Conclusion</h3><p>To sum up, I’ve tried to build my setup as <strong>criterion </strong>mentioned above. Of course there is more room for improvement such as motorised elevating sit/stand desk for spine health, split keyboard for shoulders and writs. (I may update my article later with these additions) As my humble recommendation to readers, people are tend to focus on more fancy stuffs like keyboards, rgb lights or expensive monitors but ergonomics comes first for me while thinking we are working longer hours on these desks. Some cheap upgrades like right placement and elevation for our screens could benefit most. Also before placing cool stuffs on table, we might get rid of unnecessary crown on desk with basic cable management to reach better aesthetics. As for productivity perspective, everyone can find their sweet spots. Some may be comfortable with less, some may need more but it would be better to see our needs first.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d60ecdcd2d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Should You Avoid From Using Dispatch Async?]]></title>
            <link>https://medium.com/@umut_afacan/why-should-you-avoid-from-using-dispatch-async-93e79ba89bf0?source=rss-c8d120a93a35------2</link>
            <guid isPermaLink="false">https://medium.com/p/93e79ba89bf0</guid>
            <dc:creator><![CDATA[Umut Afacan]]></dc:creator>
            <pubDate>Sat, 15 Feb 2020 12:54:53 GMT</pubDate>
            <atom:updated>2020-02-15T12:54:53.793Z</atom:updated>
            <content:encoded><![CDATA[<p>iOS Applications are multi-thread applications by default, and we usually use these by willingly or unintentionally. <strong><em>Grand Central Dispatch</em></strong> is one of biggest helper on this concern. However, <strong><em>GCD</em></strong> and multi-threading in detail is not topic of this post. I will try to explain why should not use <strong><em>GCD</em></strong> unconsciously.</p><p>You may used or encountered with codes which contains <strong><em>DispatchQueue.main.async </em></strong>blocks, but the flow is already in main.</p><pre>// Main thread<br>DispatchQueue.main.async {<br>  // Some code<br>}</pre><p>or <strong><em>asyncAfter </em></strong>are not for animation or user experience.</p><pre>DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { <br>  // Some code<br>}</pre><p>And you may heard this advice on unknown UI issues.</p><blockquote>Add dispatch async, it will solve.</blockquote><p>Even Apple’s Cocoa Touch is easy to use, sometimes things become complicated more than you expect. In that times, we find work-arounds which we don’t know why it works or don’t care depending our workload or standards.</p><p>Let’s start with example, we have an application with 2 screen which are main and detail. And also we have a component named as <strong>SliderView</strong> which shows numbers with <em>UICollectionView </em>in <strong>DetailViewController</strong>.<em> </em>Flow is like below that:</p><p>1- We tap the button from MainViewController</p><p>2- Sends predefined selected index to DetailViewController</p><p>3- DetailViewController shows number list with showing selected index</p><p>4- Also DetailViewController shows label which contains first selected index</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/09525cadc6388ee6e0514030b118106f/href">https://medium.com/media/09525cadc6388ee6e0514030b118106f/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7020ab39fce3795c7b3ae948242ab787/href">https://medium.com/media/7020ab39fce3795c7b3ae948242ab787/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b02c0e835daeb6fe6cc8539ebe8ab314/href">https://medium.com/media/b02c0e835daeb6fe6cc8539ebe8ab314/href</a></iframe><pre><strong>func</strong> selectIndex(<strong>_</strong> index: Int) {</pre><pre><strong>  let</strong> indexPath = IndexPath(item: index, section: 0)</pre><pre><strong>  self</strong>.collectionView.selectItem(</pre><pre>     at: indexPath,</pre><pre>     animated: <strong>false</strong>,</pre><pre>     scrollPosition: .centeredHorizontally)</pre><pre>}</pre><pre><strong>override</strong> <strong>func</strong> viewDidLoad() {</pre><pre><strong>  super</strong>.viewDidLoad()</pre><pre>  sliderView.numbers = 4</pre><pre><strong>  if</strong> <strong>let</strong> selectedIndex = selectedIndex {</pre><pre>    sliderView.selectIndex(selectedIndex)</pre><pre>    label.text = &quot;initialIndex: \(sliderView.selectedIndex ?? -1)&quot;</pre><pre>  }</pre><pre>}</pre><p>The codes we will focus are written above, <em>selectIndex</em> method at <strong>SliderView </strong>and <em>viewDidLoad</em> of <strong>DetailViewController.</strong></p><p><a href="https://github.com/umutafacan/DispatchAsyncExample">umutafacan/DispatchAsyncExample</a></p><p>At initial implementation, selectIndex is not working due to UI state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*1HgkczGwpnxyE5ZsK6eBUw.gif" /></figure><h4>Initial Implementation</h4><p>As shown example at left, we can obtain pre-set index from sliderView however could not show number with selected index.</p><p>Apparently when we called <em>selectIndex </em>DetailViewController’s UI state is not ready yet. So if we move selection method to <em>viewDidAppear</em>, problem should be solved.</p><p><a href="https://github.com/umutafacan/DispatchAsyncExample/tree/viewDidAppear">umutafacan/DispatchAsyncExample</a></p><p>This solution’s implementation is at link above.</p><pre><strong>override</strong> <strong>func</strong> viewDidLoad() {</pre><pre><strong>    super</strong>.viewDidLoad()</pre><pre>    sliderView.numbers = 4</pre><pre>}</pre><pre><strong>override</strong> <strong>func</strong> viewDidAppear(<strong>_</strong> animated: Bool) {</pre><pre><strong>    super</strong>.viewDidAppear(animated)</pre><pre><strong>    if</strong> <strong>let</strong> selectedIndex = selectedIndex {</pre><pre>         sliderView.selectIndex(selectedIndex)</pre><pre>         label.text <br>               = &quot;initialIndex: \(sliderView.selectedIndex ?? -1)&quot;</pre><pre>    }</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*pdjkYvmHGm-1IOZa5vW-6Q.gif" /></figure><h4>ViewDidAppear modification</h4><p>As it shown, the problem should around not ready UI state. Selection is looks like working now. However, while page opening we see first index which is <strong>0</strong>. Then it turns to <strong>2</strong>. Our solution is created another UI problem which is buggy animation state.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FuY0zZnQqZD8Jy%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FuY0zZnQqZD8Jy%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FuY0zZnQqZD8Jy%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="202" frameborder="0" scrolling="no"><a href="https://medium.com/media/30db671c39fd14a10f941a51d43e5236/href">https://medium.com/media/30db671c39fd14a10f941a51d43e5236/href</a></iframe><p>At that trial <em>viewWillAppear </em>seen as an solution, however it will not make difference than initial implementation. You may try yourself with implementation at link below.</p><p><a href="https://github.com/umutafacan/DispatchAsyncExample/tree/viewWillAppear">umutafacan/DispatchAsyncExample</a></p><p>If this problem is searched stackoverflow.com or asked to a colleague at work along with viewDidAppear solution, we will face with quotes like below:</p><blockquote>use in async block!</blockquote><blockquote>it works for me!</blockquote><blockquote>little delay will solve!</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl4Jz3a8jO92crUlWM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl4Jz3a8jO92crUlWM%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl4Jz3a8jO92crUlWM%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="339" frameborder="0" scrolling="no"><a href="https://medium.com/media/78ac27906fc0b97f67d48f137d7f482a/href">https://medium.com/media/78ac27906fc0b97f67d48f137d7f482a/href</a></iframe><p>Let’s try!</p><p><a href="https://github.com/umutafacan/DispatchAsyncExample/tree/dispatchAsync">https://github.com/umutafacan/DispatchAsyncExample/tree/dispatchAsync</a></p><pre><strong>func</strong> selectIndex(<strong>_</strong> index: Int) {<br>    <strong>let</strong> indexPath = IndexPath(item: index, section: 0)</pre><pre>    DispatchQueue.main.async {<br>        <strong>self</strong>.collectionView.selectItem(<br>                    at: indexPath,<br>                    animated: <strong>false</strong>, <br>                    scrollPosition: .centeredHorizontally)</pre><pre>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*PO6lAEWvi2jdo7iGiLzWbg.gif" /></figure><h4>Dispatch Solution</h4><p>Voila! <br>It works 💪</p><blockquote>But How Did It Worked?</blockquote><p>As mentioned above UI state of collection view is not ready yet, simply we dispatched the code with async and GCD is handled the rest, run our code block at an ‘appropriate time’ where possibly later than before. Apparently, that is enough to collection view reload itself and selection works.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fh5vIRTHWQyDuTRQI18%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fh5vIRTHWQyDuTRQI18%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fh5vIRTHWQyDuTRQI18%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e54f539ecb24c25bda4495a3be55439/href">https://medium.com/media/2e54f539ecb24c25bda4495a3be55439/href</a></iframe><p>However, we do not know when it runs selection exactly and as you may notice, somethings following are broken, like <strong>initialIndex</strong>. Because we altered run-order of codes.</p><pre><strong>override</strong> <strong>func</strong> viewDidLoad() { <br>    <strong>super</strong>.viewDidLoad()</pre><pre>    sliderView.numbers = 4 // Run first</pre><pre>    <strong>if</strong> <strong>let</strong> selectedIndex = selectedIndex {</pre><pre>        sliderView.selectIndex(selectedIndex) // Last</pre><pre>        label.text // Second<br>             = &quot;initialIndex: \(sliderView.selectedIndex ?? -1)&quot;</pre><pre>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*hDFmydPcZtoq2ez2Ok6Ayw.gif" /><figcaption>But why?</figcaption></figure><p>Simply, async blocks run by order. If a code is dispatched, it runs later than other codes in block. To explain with example:</p><pre>print(&quot;1&quot;)</pre><pre>DispatchQueue.main.async { <br>     print(&quot;2&quot;)<br>}</pre><pre>print(&quot;3&quot;)</pre><pre>output:<br>1<br>3<br>2</pre><p>If we try a bit more complex one:</p><pre>DispatchQueue.main.async { <br>    DispatchQueue.main.async {<br>         print(&quot;1&quot;)<br>    }<br>    print(&quot;2&quot;)<br>}<br>DispatchQueue.main.async {<br>    print(&quot;3&quot;)<br>}<br>print(&quot;4&quot;)</pre><pre>output:<br>4<br>2<br>3<br>1</pre><p>If we break down code, whole code chunk above is also a dispatch item. Firstly, outer block will execute with order, then inner blocks by continuing.</p><pre>//Dispatch<br>DispatchQueue.main.async {<br>    // 1 =&gt; Dispatch<br>    DispatchQueue.main.async { <br>        // 1.1 =&gt; Dispatch<br>        DispatchQueue.main.async { <br>            //1.1.1 =&gt; Print<br>            print(&quot;1&quot;)<br>        }<br>        // 1.1.2 =&gt; Print<br>        print(&quot;2&quot;)  <br>    } <br>    // 2 =&gt; Dispatch<br>    DispatchQueue.main.async { <br>        //  2.1 =&gt; Print<br>        print(&quot;3&quot;) <br>    } <br>    // 3 = Print<br>    print(&quot;4&quot;) <br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*BLAasO9SyUoacvsYvISJ9w.png" /></figure><h4>Serial order:</h4><p>1 -&gt; Dispatch<br>2 -&gt; Dispatch<br>3 -&gt; Print // output: 4<br>1.1 -&gt; Dispatch<br>1.2 -&gt; Print // output: 2<br>2.1 -&gt; Print // output: 3<br>1.1.1 -&gt; Print // output: 1</p><p>It may become a bit long however to understand problem, it should be clear as possible. Let’s go back to our case, actually it is more complicated but if we may simplify:</p><pre>viewDidLoad block { <br>    <br>    reloadData //sliderView.numbers = 4<br>    <br>    select //sliderView.selectIndex(selectedIndex)</pre><pre>    getSelectedIndex //label.text = &quot;..sliderView.selectedIndex..&quot;<br>}</pre><blockquote>Why dispatching is worked, What is different than viewDidAppear solution?</blockquote><p>If we examine more detailed, the basic reason of selection does not work is that <strong>cells have not been created yet</strong>. We can see that by debugging both the first and the second examples.</p><p>So when cells are created? Obviously not at <em>viewDidAppear </em>because dispatch solution makes happen at <em>viewDidLoad.</em></p><p>When more variation is tried, such as the collection view has a fixed height and width constraints instead edge constraints, we can see collection view cells are created at <em>viewDidLoad</em>. Or instead of using <strong><em>SliderView</em></strong>, just adding collection view to <strong><em>DetailViewController </em></strong>will make the same consecution. If a deduction is made, results that collection view needs to conclude layout operation for creating cells.</p><p>To sum up, dispatching selection will delay it after layout and cell creation along with all others in same block.</p><blockquote>Is there another solution in result of these informations?</blockquote><p><em>viewDidAppear</em> is not necessary but layout<em> is. </em>Therefore we need to conclude layout. If we go back to initial implementation and add <em>layoutIfNeeded </em>before selection.</p><pre><strong>func</strong> selectIndex(<strong>_</strong> index: Int) {<br>    <strong>let</strong> indexPath = IndexPath(item: index, section: 0)</pre><pre>    collectionView.layoutIfNeeded()</pre><pre>    collectionView.selectItem(<br>                    at: indexPath,<br>                    animated: <strong>false</strong>, <br>                    scrollPosition: .centeredHorizontally)<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*5CqrAMYghwdPwiblbVRkLA.gif" /></figure><h4><strong>Layout Solution</strong></h4><p>Works as we wanted 👌</p><h3>Conclusion</h3><p>Layout solution gives us a better alternative however dispatching async is also valid solution at first sight if later calls are ignored. And if the codes after dispatch has no relation with selection, although there is no disadvantage at first sight, we do not know whats in the same block or difference in debug and release or other optimization cases. Therefore our code will be vulnerable to breaking in time. In addition, later modifications in there will be more trickier than latest solution because considering async block how actually works these codes will be hard to see by just reading. As we mentioned above, unintended behaviour can be occur due to <strong>GCD</strong>’s works at that specific situation. Even we may consider possible options, more linear flow in code will make easier to read and maintain. Although there is just one example, many cases can be seen in stackoverflow.com or in projects which mostly has better solution than dispatching asynchronously if we examine problems and try to figure out their reasons.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93e79ba89bf0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>