<?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 Juan Manuel Gentili on Medium]]></title>
        <description><![CDATA[Stories by Juan Manuel Gentili on Medium]]></description>
        <link>https://medium.com/@jmgentili?source=rss-c70bc153caea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*la25AK4wgUV0nzF39fxrSA@2x.jpeg</url>
            <title>Stories by Juan Manuel Gentili on Medium</title>
            <link>https://medium.com/@jmgentili?source=rss-c70bc153caea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:19:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jmgentili/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[Un oasis para detenerse (fragmento de diario personal)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/un-oasis-para-detenerse-fragmento-de-diario-personal-dae5a7b372bc?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/2600/1*OnVv78-G349BT3Gm5Y-AlQ.jpeg" width="3024"></a></p><p class="medium-feed-snippet">15/11/2025 &#x2192; 15/12/2025</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/un-oasis-para-detenerse-fragmento-de-diario-personal-dae5a7b372bc?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/un-oasis-para-detenerse-fragmento-de-diario-personal-dae5a7b372bc?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae5a7b372bc</guid>
            <category><![CDATA[journaling]]></category>
            <category><![CDATA[diary]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[oasis]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 18:03:13 GMT</pubDate>
            <atom:updated>2025-12-23T18:03:13.158Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, el disidente [Parte III]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-iii-75d8445e87df?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/972/1*tEFd2KsUfVRXiNBsWe8bjA.jpeg" width="972"></a></p><p class="medium-feed-snippet">Tratando de entender la filosof&#xED;a detr&#xE1;s de sus creaciones</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-iii-75d8445e87df?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-el-disidente-parte-iii-75d8445e87df?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/75d8445e87df</guid>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[art]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 23:22:30 GMT</pubDate>
            <atom:updated>2025-08-14T01:00:10.537Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, the contrarian [Part III]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-iii-b324a8050f9d?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/972/1*tEFd2KsUfVRXiNBsWe8bjA.jpeg" width="972"></a></p><p class="medium-feed-snippet">Trying to understand the philosophy behind his work</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-iii-b324a8050f9d?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-the-contrarian-part-iii-b324a8050f9d?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/b324a8050f9d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[art]]></category>
            <category><![CDATA[stories]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 23:14:07 GMT</pubDate>
            <atom:updated>2025-08-14T01:00:07.027Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, el disidente [Parte II]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-ii-1740842c4d35?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/2600/1*tvEV1sR9yuWj4vSu9kFlug.png" width="2636"></a></p><p class="medium-feed-snippet">Cu&#xE1;l es el lado B de elevar los niveles de abstracci&#xF3;n de forma tan agresiva?</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-ii-1740842c4d35?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-el-disidente-parte-ii-1740842c4d35?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/1740842c4d35</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 01:01:59 GMT</pubDate>
            <atom:updated>2025-07-22T10:53:14.903Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, the contrarian [Part II]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-ii-da4882a45fdb?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/2600/1*tvEV1sR9yuWj4vSu9kFlug.png" width="2636"></a></p><p class="medium-feed-snippet">What&#x2019;s the B side about raising the levels of abstraction so aggressively?</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-ii-da4882a45fdb?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-the-contrarian-part-ii-da4882a45fdb?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/da4882a45fdb</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 00:50:34 GMT</pubDate>
            <atom:updated>2025-07-22T10:54:51.718Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, el disidente [Parte I]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-i-21f1ecfebb6e?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/2600/1*807hwnm4MpuLvOMSicb8RA.png" width="3024"></a></p><p class="medium-feed-snippet">Aprendizajes extra&#xED;dos de un caso an&#xF3;malo</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-el-disidente-parte-i-21f1ecfebb6e?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-el-disidente-parte-i-21f1ecfebb6e?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/21f1ecfebb6e</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[lessons]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 12:28:36 GMT</pubDate>
            <atom:updated>2025-07-22T10:52:20.338Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Terry Davis, the contrarian [Part I]]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-i-a22d9fce9cdf?source=rss-c70bc153caea------2"><img src="https://cdn-images-1.medium.com/max/2600/1*807hwnm4MpuLvOMSicb8RA.png" width="3024"></a></p><p class="medium-feed-snippet">Key lessons learned from an outlier</p><p class="medium-feed-link"><a href="https://medium.com/@jmgentili/terry-davis-the-contrarian-part-i-a22d9fce9cdf?source=rss-c70bc153caea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@jmgentili/terry-davis-the-contrarian-part-i-a22d9fce9cdf?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/a22d9fce9cdf</guid>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[lessons]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Sat, 28 Jun 2025 12:27:50 GMT</pubDate>
            <atom:updated>2025-07-22T10:54:08.276Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A healthier self: thoughts after a trip to Brazil]]></title>
            <link>https://medium.com/@jmgentili/a-healthier-self-thoughts-after-a-trip-to-brazil-e441dc514617?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e441dc514617</guid>
            <category><![CDATA[trip]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[reflections]]></category>
            <category><![CDATA[work-life-balance]]></category>
            <category><![CDATA[burnout]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Wed, 10 Jul 2024 09:52:03 GMT</pubDate>
            <atom:updated>2024-07-10T10:00:08.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2ZSKAk5Sxd2IccUSOokVw.jpeg" /><figcaption>A bigger splash — David Hockney</figcaption></figure><p><em>Note:</em> if you want to read this post on my personal blog, here’s the link:</p><p><a href="https://gentilijuanmanuel.github.io/posts/a-healthier-self/">A healthier self</a></p><p>A couple of months ago, I started having chronic headaches. At first, it wasn’t a big problem. When it happened, I just stopped working, took a pill, or went for a run. Then I would return to work refreshed, and that was it.</p><p>But the pain’s intensity and frequency started to increase progressively, and I began to take it more seriously. It’s not normal to have headaches at least once a day, right?</p><p>I talked with my therapist and my doctor. I described the pain I was feeling, my daily routine, fears, desires, goals, and ways of thinking. Both agreed that it’s a symptom related to <em>burnout</em>, a sadly common word nowadays.</p><p>The worst time was a week before a planned vacation with my girlfriend. We traveled to Brazil for some time off, and the days before were filled with dozens of maintenance tasks (both work and personal related) that I needed to complete before the trip. Many of these tasks depended on other people or processes, making them more difficult to accomplish. It was crazy.</p><p>When we arrived at the hotel, I made a personal promise to myself: let’s use our time off <em>to be really off</em>. I deleted X app, turned off most notifications on my phone, shut down the computer, and didn’t touch it for 9 days. The only interaction I had with the digital world was using my phone to take photos and my Kindle to read only one book: <a href="https://www.goodreads.com/book/show/42771901-how-to-do-nothing"><em>How to do nothing</em></a> by <a href="https://en.wikipedia.org/wiki/Jenny_Odell">Jenny Odell</a>.</p><p>Those nine days in a different location, doing different things from the ones I usually do in my daily routine, and without distractions, gave me a lot of resources to think about myself, the relationship I have with my work, and other questions that I need to at least pay attention to.</p><p>They are summarized in the following sections.</p><h3>Multitasking</h3><p>I’m deeply interested in today’s Argentine economy and politics. This is kind of a new phenomenon to me, since I didn’t pay too much attention to politics in the past (only in my adolescence, when I was an idealistic child with some theoretical background but zero practical expertise, wanting to change the world based on books).</p><p>Reasons:</p><ul><li>We’re in the middle of a big crisis. More than 200% per year inflation is not something we are proud of. A 60% poverty rate is even worse. One out of two children cannot cover their basic needs.</li><li>There was a shift in political power. We moved from a way of thinking that put the government as the most important economic actor to a libertarian mindset that basically hates the government. It’s a 180-degree change, and we’re feeling the gap between them every day.</li><li>I’m trying to build a better economic and political outlook for myself. I have <em>a lot</em> of doubts, and I think this moment is really good to put my ideas or preconceptions under the pressure of different perspectives to grow as a better thinker.</li><li>I’m an economic actor who offers services and has needs and desires, and all the economic decisions directly impact me.</li></ul><p>But… what does it have to do with my headaches? Well, it has to do with a bad habit that I silently developed because of this interest. Every time I have a free moment, I grab my iPad and listen to some YouTube video of <a href="https://es.wikipedia.org/wiki/Ernesto_Tenembaum">Ernesto Tenembaum</a> interchanging ideas with a libertarian guy or <a href="https://www.wikidata.org/wiki/Q101072268">Carlos Zuchovicki</a> talking about trends in the national stock market.</p><p>The good part is that I’m always up to date. I’m a little bit obsessed with trying to hear more than one voice on a specific topic, and because of that, I think I can have a clearer picture of it. The bad part is that sometimes I cannot control the <em>compulsion</em> of knowing what’s going on. Technology has made it really, really easy to stay informed, so every dead moment is a potential moment to listen to or read something. Cooking? With a video playing. Running? With a podcast playing. Taking a break? Reading the news…</p><p>Over-information + multitasking is a bad combo. In <a href="https://www.goodreads.com/book/show/26085550-the-burnout-society"><em>The Burnout Society</em></a>, a book that I recently read but it seems like I forgot (🫠), <a href="https://en.wikipedia.org/wiki/Byung-Chul_Han">Byung-Chul Han</a> warns about multitasking:</p><blockquote>Multitasking is commonplace among wild animals. It is an attentive technique indispensable for survival in the wilderness. An animal busy with eating must also attend to other tasks. For example, it must hold rivals away from its prey. It must constantly be on the lookout, lest it be eaten while eating. At the same time, it must guard its young and keep an eye on its sexual partner. In the wild, the animal is forced to divide its attention between various activities. That is why animals are incapable of contemplative immersion — either they are eating or they are copulating. The animal cannot immerse itself contemplatively in what it is facing because it must also process background events.</blockquote><p>Sometimes, I feel like I’m an animal in a jungle. There’s too much going on, and it feels like it’s directly affecting us. Wait! They tell me we’re living in a civilization! That we’re better than animals because we build things to satisfy our needs and grow in complexity. But many of these things (push notifications, infinite scrolling, persuasive designs, etc.) are taking us back to the beginning: being an animal with the fear of being eaten. In the words of <a href="https://x.com/arielsbdar/status/933306131253989377?lang=en">Cocos Capital’s CEO (an Argentinian stock broker)</a>:</p><blockquote>Each morning a gazelle wakes up. It knows it must run faster than the fastest lion or it will be killed.</blockquote><blockquote>Each morning a lion wakes up. It knows it must run faster than the slowest gazelle or it will starve to death.</blockquote><blockquote>Lion or gazelle, when the sun comes up, you better start running.</blockquote><p>I like running, but to be healthy, not to avoid the possibility of being eaten.</p><h3>Boredom, attention, hyperattention, action</h3><p>Reviewing my highlights on <a href="https://www.goodreads.com/book/show/25744928-deep-work"><em>Deep Work</em></a> (by <a href="https://en.wikipedia.org/wiki/Cal_Newport">Cal Newport</a>), I found a simple, short sentence that caught my attention:</p><blockquote>I’m comfortable being bored, and this can be a surprisingly rewarding skill</blockquote><p>I’m not. I hate being bored. Whenever I feel that way, my mind automatically starts thinking about things I <em>can</em> or <em>should</em> be doing. How about reading a book? Continuing that side project? Going for a walk? Messaging a friend? Messaging my GF? Watching a documentary?</p><p>In Brazil, I tried the opposite. We visited beautiful beaches in Buzios, and I focused on just sitting and contemplating our surroundings. Talk with my girlfriend, drink mate, and just watch the sea, the “morros,” and people enjoying that space and time. And it felt good. Refreshing. I felt like my mind was a box full of things, and that with this immersive process, I started to put some of them out of it, make some space, and order what was left inside. Like when you organize things in your home and you feel it’s way bigger than you perceived before.</p><p>With space, you can think in a better way. I started to make cool connections between supposedly unrelated topics; creative ideas came to my mind without effort. In fact, we can generalize my particular feeling into a more collective thing. In the words of Byung-Chul Han, in <em>Profound Boredom</em> (an essay inside <em>The Burnout Society</em>):</p><blockquote>We owe the cultural achievements of humanity — which include philosophy — to deep, contemplative attention. Culture presumes an environment in which deep attention is possible.</blockquote><p>There is no doubt that without Aristotle and Socrates spending their entire lives in deep contemplation and reflection, many things that exist today wouldn’t be here. After all, philosophy is the mother of all thoughts.</p><p>It’s worth paying attention to the rest of the paragraph:</p><blockquote>Increasingly, such immersive reflection is being displaced by an entirely different form of attention: hyperattention. A rash change of focus between different tasks, sources of information, and processes characterizes this scattered mode of awareness. Since it also has a low tolerance for boredom, it does not admit the profound idleness that benefits the creative process. […] A purely hectic rush produces nothing new. It reproduces and accelerates what is already available.</blockquote><p>The most important sentence is the last one, which showcases the consequences of this modern phenomenon: <em>“A purely hectic rush produces nothing new. It reproduces and accelerates what is already available.”</em> This hurts, but it’s true. When I’m constantly in a rush, without time to think, reflect, or simply observe, my thoughts and decisions become repetitive and robotic. There’s nothing new in them. When I make time to observe and reflect (like in Brazil), I connect dots and produce new thoughts. I’m able to hear my own voice, breaking the compulsive cycle of <em>“accelerating what is already available.”</em></p><p>Jenny Odell goes to the same direction when she quotes <a href="https://en.wikipedia.org/wiki/William_Deresiewicz">William Deresiewicz</a> in <em>How to do nothing</em>:</p><blockquote>William Deresiewicz warns of this in “Solitude and Leadership,” a speech to an audience of college students in 2010. By spending too much time on social media and chained to the news cycle, he says, “[y]ou are marinating yourself in the conventional wisdom. In other people’s reality: for others, not for yourself. You are creating a cacophony in which it is impossible to hear your own voice, whether it’s yourself you’re thinking about or anything else.”</blockquote><p>It’s true that Odell and Newport don’t agree on the fundamental criticism of current times (Odell believes something is wrong with the economic system design, while Cal thinks the issues can be fixed <em>within</em> capitalism). However, they both seem to agree that sitting and observing is not an easy task, given a similar quote by her:</p><blockquote>Nothing is harder to do than nothing.</blockquote><p>…especially for me (an active person), but also for the rest of society. How is it possible to “simply” do nothing when streaming, social media, games, and the gig economy demand your attention 24/7? Doing nothing feels like a fight against all this. It requires effort and energy. But if mental health and having a meaningful life are priorities, it’s worth it.</p><p>Byung-Chul Han discusses this effort in <em>The Pedagogy of Seeing</em> (another essay inside the book), an essay in which he talks about <em>vita contemplativa</em>, in contrast (or complement?) to <em>vita activa</em>. He refers to some thoughts described by <a href="https://en.wikipedia.org/wiki/Friedrich_Nietzsche">Nietzsche</a> in <a href="https://en.wikipedia.org/wiki/Twilight_of_the_Idols"><em>Twilight of the Idols</em></a> about learning to see:</p><blockquote>One must learn “not to react immediately to a stimulus, but instead to take control of the inhibiting, excluding instincts.” By the same token, “every characteristic absence of spirituality, every piece of common vulgarity, is due to an inability to resist a stimulus” — the inability to set a no in opposition.</blockquote><p>And:</p><blockquote>The vita contemplativa is not a matter of passive affirmation and being open to whatever happens. Instead, it offers resistance to crowding, intrusive stimuli. Instead of surrendering the gaze to external impulses, it steers them in sovereign fashion. As a mode of saying no, sovereign action proves more active than any and all hyperactivity, which represents a symptom of mental exhaustion.</blockquote><p>If I succeed in making this happen to me, time will <em>feel</em> different. Time will be <em>fragrant</em>, as Byung-Chul Han describes when talking about Cézanne:</p><blockquote>Paul Cézanne, a master of deep, contemplative attention, once remarked that he could see the fragrance of things. This visualization of fragrances requires profound attention. In the contemplative state, one steps outside oneself, so to speak, and immerses oneself in the surroundings.</blockquote><h3>Structured and unstructured thinking</h3><p>Other things that came to mind on that trip were some interests that had been deprioritized over the years.</p><p>When I was a teen, I wanted to be a writer. A fiction writer. I loved literature (I still love it) and since I had a lot of free time after school, I spent hours reading books and writing crap. I was lucky to have parents who also enjoy reading, so I created a little library by merging titles from my father, my mother, and buying more myself (I remember my first informal salaries were spent on completing <a href="https://en.wikipedia.org/wiki/Julio_Cort%C3%A1zar">Julio Cortázar</a>’s bibliography).</p><p>I also participated in a literature workshop in the city where I currently live. There, I learned a lot about modern literature and tried to improve my writing skills. I kind of failed at that (or didn’t persist enough), but as a success, I can say that we published an anthology of stories and poems among all the participants of the workshop, which was really nice.</p><p>Then time passed. I started university, and time became more scarce. I graduated as a Software Engineer and began working in the tech industry. Coding became my passion.</p><p>The two blogs (<a href="https://hipervinculando.wordpress.com/">intersecciones</a> and <a href="https://soyantipoeta.blogspot.com/">soyantipoeta</a>) and <a href="https://medium.com/@jmgentili">the Medium account</a> I maintained during this era and the transition to the new one (the <em>engineer</em> era, let’s say) are good examples to illustrate my worries:</p><ul><li>The first blog is called <em>“Intersecciones”</em>, which in English means <em>“Intersections.”</em> The blog’s subtitle reads: <em>“Searching for elements that belong to two or more sets”</em>, complemented by a Venn diagram.</li><li>I chose this title because I was studying discrete mathematics in college at the time, which left me with little time to read literature or write posts. The idea was to merge two worlds I was enjoying: liberal arts, literature, and engineering, science, coding. As Steve Jobs repeatedly said in his Apple talks:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*4Yu9hetXlNKmfoEA_gf_dg.png" /><figcaption>Steve Jobs and his slide about the intersections between technology and arts</figcaption></figure><ul><li>The second blog’s web title is <em>Poemas, ecuaciones, acordes</em>, which means <em>poems, equations, chords.</em> More of the same.</li><li>I wrote <a href="https://medium.com/@jmgentili/un-poeta-compilando-un-obj-58863d707183">a post</a> where I researched initiatives to write poems using programming languages instead of natural languages.</li><li>In 2016, in the middle of my career, I watched two TED talks related to AI: <a href="https://youtu.be/40riCqvRoMs?si=ZAb67dN43g8HE5E2"><em>How we teach computers to understand pictures</em></a> and <a href="https://youtu.be/uSUOdu_5MPc?si=GxX9e8f2KL-X4Nlr"><em>How computers are learning to be creative</em></a>. In the first one, Fei Fei Li, a computer scientist, explained the process of training and testing a neural network to understand and categorize images. In the second one, Blaise Agüera y Arcas, another computer scientist at Google, reversed the problem: what happens if, instead of having the picture as an input and the categorization as an output on a neural net, <em>we make the image the output</em>. The result was something similar to what we call <em>creativity</em> in humans.<br>At that point, neither ChatGPT nor Midjourney existed. The results just blew my mind. It was the perfect combination of art and technology!<br>I wrote <a href="https://medium.com/@jmgentili/neurociencias-ia-arte-56af2942863">an article</a> on Medium and spoke to the owner of the literature workshop I mentioned earlier to organize a talk at my high school. I wanted people to notice these awesome discoveries that were happening.<br>And we did it. Here’s the only photo I have of that moment. I can say it was the first <em>tech talk</em> I gave:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYX3NTJqs5Rw9pIj5dz1Rg.png" /><figcaption>My first “<em>tech talk”</em></figcaption></figure><p>What I’m trying to illustrate with these examples is that I always try to combine both worlds. The first is unstructured, flexible, crazy. The second is deterministic, detailed, and consistent, with a concrete roadmap. But I need both. Whenever I lean towards one, something feels off.</p><p>In one of the evenings we spent on the beach, I started to look at my hands. On the left hand, I had my Apple Watch: numbers, activity rings, progress, productivity, growth. On the right hand, I had some bracelets I bought from street sellers in Buzios: just some calm scraps of thread with some aesthetic meaning. No progress. No numbers. It seems like both are parts of myself, like the <a href="https://en.wikipedia.org/wiki/Yin_and_yang">Yin and Yang</a>, that <em>can be thought of as complementary (rather than opposing) forces that interact to form a dynamic system in which the whole is </em><strong><em>greater</em></strong><em> than the assembled parts.</em></p><h3>In response to multitasking and hyper-attention: slow down</h3><p>What happened to my thinking process in Brazil (which can be summarized as: <em>having more space and time tends to generate better and deeper ideas</em>) is not a unique or original experience. Something similar happened to <a href="https://fr.wikipedia.org/wiki/Lionel_Dricot">Lionel Dricot</a>. In his article <em>A </em><a href="https://ploum.net/2024-03-18-lost-focus.html"><em>society that lost focus</em></a>, he presents the same idea through a teen experience:</p><blockquote>In the early 90s, after tweaking my MS-DOS computer, I was able to play games. One of those games was called “Battle Chess”. A Chess game were pieces were really fighting against each other. It was fun. I was, and still am, a mediocre chess player. I was mate in less than 10 or 15 turns at the easiest level.</blockquote><blockquote>For the sake of the experiment, I turned the difficulty to the harder level and started playing. Something strange happened: I was still losing but it took a lot more turns. I was able to protect my game, even to manage a few draws.</blockquote><blockquote>Was it a bug in the game?</blockquote><blockquote>Even as a young teenager, I quickly understood the reason. With the setting set to “hard”, the game would try a lot harder to find a good move. On my 386 processor, without the mathematical coprocessor, this would take time. Several seconds or even one minute by turn. During that time, I was thinking, anticipating.</blockquote><blockquote>With the easiest setting, computer moves would happen immediately. I knew I had all the time I want but I was compelled to move fast. I could not take the time while the other side was immediately reacting to my moves.</blockquote><p>And then he states:</p><blockquote>⁠⁠The root problem is that, for the first time in human history, <strong>our brain is the bottleneck</strong>. For all history, transmitting information was slow. Brains were fasts.</blockquote><p>Our brain is the bottleneck. Specially for us, workers in the knowledge sector. Func fact related to this: I have a <a href="https://images.app.goo.gl/mCBquh4zkt7PWv7J6"><em>cactus cerebro</em></a> on my desk. It’s inside a 3D-printed flowerpot shaped like a person reading a book, which is a gift from one of my best friends. The head part is open to let the <em>“cerebro”</em> rest in peace. This always reminds me that it’s a living organism. Being able to focus on one thing at a time or setting aside time to think deeply without restrictions or distractions is like watering it regularly and giving it sunlight.</p><p>Another excellent description of the problem can be found in <a href="https://theamericanscholar.org/author/william-deresiewicz/">William Deresiewicz</a>, previously mentioned by Jenny Odell in my <em>How to Do Nothing</em> quotes. In <a href="https://theamericanscholar.org/solitude-and-leadership/"><em>Solitude and Leadership</em></a>, he’s sharp about multitasking and the way our society tries to think nowadays:</p><blockquote>Multitasking, in short, is not only not thinking, it impairs your ability to think. Thinking means concentrating on one thing long enough to develop an idea about it. Not learning other people’s ideas, or memorizing a body of information, however much those may sometimes be useful. Developing your own ideas. In short, thinking for yourself. You simply cannot do that in bursts of 20 seconds at a time, constantly interrupted by Facebook messages or Twitter tweets, or fiddling with your iPod, or watching something on YouTube.</blockquote><p>He also describes his own thinking process:</p><blockquote>I find for myself that my first thought is never my best thought. My first thought is always someone else’s; it’s always what I’ve already heard about the subject, always the conventional wisdom. It’s only by concentrating, sticking to the question, being patient, letting all the parts of my mind come into play, that I arrive at an original idea. By giving my brain a chance to make associations, draw connections, take me by surprise. And often even that idea doesn’t turn out to be very good. I need time to think about it, too, to make mistakes and recognize them, to make false starts and correct them, to outlast my impulses, to defeat my desire to declare the job done and move on to the next thing.</blockquote><p>We always have a <em>next thing</em> waiting for us. Something in our backlog claiming for priority, affirming that you should stop doing what you’re doing and pay attention to it. Fragmented attention. Just finish this <em>in progress</em> thing asap, put it in the <em>done</em> column and move on.</p><p>If we compulsively follow this process, we eliminate all alternative paths that may appear when examining a thought from different perspectives. We end up with partial realities that likely reinforce our previous thinking, increasing the risk of making bad decisions. This applies not only to individuals but also to companies and governments. The consequences of this negligent process can impact an entire society.</p><p>With this, I’m not saying I’m against <em>trial and error</em> strategies (at least for companies). I know that it is impossible to know all the results an idea or implementation can lead to, and iterative processes and MVPs can help with real feedback. But I can say an MVP of a weak idea, without foundations, that came out of a 20-minute brainstorming session without much stress testing will, with higher confidence, result in a failure. We <em>need</em> time to think:</p><blockquote>I used to have students who bragged to me about how fast they wrote their papers. I would tell them that the great German novelist Thomas Mann said that a writer is someone for whom writing is more difficult than it is for other people. The best writers write much more slowly than everyone else, and the better they are, the slower they write. James Joyce wrote Ulysses, the greatest novel of the 20th century, at the rate of about a hundred words a day — half the length of the selection I read you earlier from Heart of Darkness — for seven years. T. S. Eliot, one of the greatest poets our country has ever produced, wrote about 150 pages of poetry over the course of his entire 25-year career. That’s half a page a month. So it is with any other form of thought. You do your best thinking by slowing down and concentrating.</blockquote><p>Talking about real-world examples, this article is one of them. I was feeling guilty because it’s taking me months to write it. I was in Brazil in April. At the time I’m writing these lines, it’s the end of June. My inner voice:</p><blockquote>Omg! You’re not being very productive, Juan! There is a goal of writing content that you need to achieve for 2024! Probably, <strong>to engage your audience</strong>, you can separate all these thoughts into smaller pieces, one topic at a time, to produce easier and shorter content to digest.</blockquote><p>It’s an ongoing battle, but I’m trying to silence that voice. These topics are highly related, and this blog post won’t be <em>Les Miserables.</em> We’re good.</p><h3>Reject modernity, embrace tradition</h3><p>I’m currently reading <a href="https://www.goodreads.com/book/show/197773418-slow-productivity"><em>Slow productivity</em></a>, by <a href="https://en.wikipedia.org/wiki/Cal_Newport">Cal Newport</a>.</p><p>One idea I’m finding interesting to explore more because of this book is a tendency to <a href="https://x.com/aragunde/status/1595006273816334339"><em>reject modernity and embrace tradition</em></a>. It’s not a new concept for Cal. He doesn’t have social media, he’s a professor of computer science, but he uses pen and paper a lot and tends to view <em>the next big thing</em> (a common phrase in the tech world) with skepticism. In <em>Slow Productivity</em>, he explains this with a historical example: <a href="https://es.wikipedia.org/wiki/Carlo_Petrini">Carlo Petrini</a>, an Italian activist and journalist, and his experiment called <a href="https://es.wikipedia.org/wiki/Slow_food"><em>Slow Food</em></a>, a movement created in response to the arrival of fast food chains like McDonald’s and Burger King in Italy.</p><blockquote>Against those — or, rather, the vast majority — who confuse efficiency with frenzy, we propose the vaccine of an adequate portion of sensual gourmandise pleasures, to be taken with slow and prolonged enjoyment. Appropriately, we will start in the kitchen, with Slow Food. To escape the tediousness of “fast-food,” let us rediscover the rich varieties and aromas of local cuisines.</blockquote><p>A reminder to take undisputed progress with quotation marks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74lX4v-orvmPAE56WB72cg.png" /><figcaption>A tweet I saw during the last World Cup (one of the best tweets I’ve ever read by the way)</figcaption></figure><p>In my mind, the idea is not to reject progress, but to think about it before jumping on board. Understand what’s the balance. Understand what you’re leaving behind. Sometimes, efficiency and speed are traps. Sure, you can probably produce 10x more writing content with ChatGPT-4, but does it have the same quality, unique thought, or inner voice as a single text written by you? Yes, you can be 10x more productive in your side project by coding with AI assistance, but if you use it to implement the app’s core logic, how much time will you spend fixing AI-generated bugs?</p><p>Again, T.S. Eliot wrote about 150 pages of poetry in his entire career, and he’s one of the best writers the world has produced. It’s not all about producing <em>more</em>.</p><h3>Final thoughts</h3><p>I don’t want this to be a classic <em>How to</em> article that offers you a set of instructions to follow in order like a robot and solve the information overload or the multitasking problem. <em>How to do nothing</em> is, basically, a title that takes that trend with irony. This is just a description of my personal experience, with some observations that can be extrapolated or not. It’s a discovery work. A WIP (an acronym we like to use in the tech industry). When I’m writing about myself <em>I write myself</em>, like Escher’s drawing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*rJpk-vVs6WJw2TeseBKZIg.png" /><figcaption>Drawing hands — Escher</figcaption></figure><p>Since this a WIP (and I’m a WIP), there may will be future posts about the same topics.</p><p>Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e441dc514617" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulations: How iOS engineers try to imitate reality in their labs]]></title>
            <link>https://medium.com/@jmgentili/simulations-how-ios-engineers-try-to-imitate-reality-in-their-labs-56f7d50fd041?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/56f7d50fd041</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[side-project]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 19:43:53 GMT</pubDate>
            <atom:updated>2024-07-10T09:55:45.349Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJmwI2ZNq044zZFyKnP_rg.jpeg" /><figcaption>First image of a black hole</figcaption></figure><p><em>Note:</em> if you want to read this post on my personal blog, here’s the link:</p><p><a href="https://gentilijuanmanuel.github.io/posts/simulations/">Simulations</a></p><h3><strong>Lex, Elon and their thoughts on our existence</strong></h3><p>The other day, I ran a couple of kilometers while listening to one of my favorite podcasts: <a href="https://podcasts.apple.com/ar/podcast/lex-fridman-podcast/id1434243584">The Lex Fridman Podcast</a>. In a world full of instant gratification, fifteen-second viral content, quick answers to hard problems, and infinite scrolling, the interviews conducted by Lex (ranging from one to nine hours in duration and featuring deep human questions that intersect various disciplines) are like a rare diamond for me.</p><p>The show was <a href="https://podcasts.apple.com/ar/podcast/lex-fridman-podcast/id1434243584?i=1000634296338">#400</a>, the 4th round between Lex and Elon Musk. I don’t think I need to introduce Elon Musk.</p><p>They talked about a bunch of things: the two wars that (sadly) are happening right now, Grok (the AI model created by X), the existence of aliens, video games (both play Diablo), a bit of futurology, dystopian worlds influenced by Aldous Huxley, and much more. I highly recommend listening to it.</p><p>I was more or less in the middle of my training, sweating profusely, when <a href="https://lexfridman.com/elon-musk-4-transcript#chapter8_god">they started discussing about God</a>. What a topic to talk about, huh? It was a relatively short exchange of ideas compared to the other chapters of the interview, but it completely captured my attention. Lex suggested that it seems like there is a master plan, a <em>something</em> or <em>someone</em> that orchestrates this spectacle we call reality. If true, life is somewhat deterministic. There is a <em>plan</em>, created by something we often refer to as God; this plan is executed, and all its rules are set in stone. We live our lives believing that we’re free, but in reality, there is something larger than us that designed our environment and all the possible paths a life can take. If the plan is made by someone with good intentions, everything should go well, right?</p><p>Elon threw an interesting follow-up question in response to that idea:</p><blockquote>There may not be a master plan in the sense. So maybe an interesting answer to the question of determinism versus free will is that if we are in a simulation, the reason that these higher beings would hold a simulation is <strong>to see what happens</strong>. So they don’t know what happens otherwise they wouldn’t hold the simulation. So when humans create a simulation, so it’s SpaceX and Tesla, we create simulations all the time. Especially for the rocket, you have to run a lot of simulations to understand what’s going to happen because you can’t really test the rocket until it goes to space and you want it to work. So you have to simulate subsonic, transonic, supersonic, hypersonic, ascend, and then coming back, super high heating and orbital dynamics. All this has got to be simulated because you don’t get very many kicks at the can. But we run the simulations to see what happens, not if we knew what happens, we wouldn’t run the simulation. So whoever created this existence, they’re running it because they don’t know what’s going to happen, not because they do.</blockquote><p>It’s not the first time Elon has suggested we’re <a href="https://www.google.com/search?q=we%27re+living+on+a+simulation+elon+musk&amp;sourceid=chrome&amp;ie=UTF-8">living in a simulation</a>.</p><p>That paragraph gave me chills. I rewound the interview a few seconds to listen to it again.</p><h4><strong>From philosophy and weird thoughts to iOS development</strong></h4><p><em>Disclaimer 1:</em> I don’t know whether we live in a simulation or not. I don’t even know <em>if there is a way to find out.</em> It’s an interesting philosophical discussion, but I’m not prepared for it, I think.</p><p><em>Disclaimer 2:</em> I don’t create rockets or electric cars. I believe I possess 0.0000000001% of the knowledge required to participate in that complex process.</p><p>BUT! As a random engineer who writes Swift code for a living, I do work with simulations all the time:</p><ul><li>We (iOS devs) use the Simulator app to test our code on different Apple devices: iPhones, iPads, Macs, Apple Watches, etc. They have limited functionality (for example, you cannot open the camera on an iOS simulator), but for the vast majority of features, it’s really useful.</li><li>Every time we need to perform communication between our client code and a web service, we tend to use different <strong>environments</strong>. The production environment is the real database, where your actual users are, but there are copies of that database with fake information to allow developers to test the functionality they’re working on. Production is like SpaceX’s rockets in real space, and staging or development environments are the labs where the rockets are tested. (Remember: please DO NOT test in production!)</li><li>When writing unit tests or UI tests, we generally tend to <strong>inject</strong> mock services into our logic, allowing us to focus our attention on the piece of software under test. In the case of unit tests, it could be a View Model into which we inject mock services to focus solely on the logic inside the VM, in all possible scenarios.</li><li><strong>SwiftUI</strong> previews are a new type of UI simulation for us. We can set up different device configurations and see how the UI responds to them: color schemes, device orientations, dynamic font sizes, localization, etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSC2s2mHo5uTCATqTMC4Qg.png" /><figcaption>Screenshot of a SwiftUI preview on my side project 📱</figcaption></figure><p>All the examples (from environmental simulations for rockets to simple mock responses on API calls) share the same principles: they are <strong>models</strong> that reduce reality to a set of controllable conditions, to see how our creations respond to them. Again, they are <strong>models</strong>, representations of reality, and it can happen that our models are not 100% accurate to the real world. But it’s a practical way to speed up the building process, and it seems like it works, given the current state of the art in the industry.</p><p>I’d like to elaborate on a specific type of simulation (in fact, a way to <em>facilitate the use of simulations</em>) that’s commonly found in well-designed iOS projects (and in software projects in general): dependency management in our business logic.</p><ul><li>How can we unit test logic that includes communication with a web service or an <strong>SDK</strong>?</li><li>How can we avoid using a real web service or <strong>SDK</strong> in our <strong>SwiftUI</strong> previews?</li><li>How can we test every possible scenario (that we know of) on a particular screen, and have a preview for each one?</li></ul><p>I’ll demonstrate here how I addressed these questions in the side project I’m working on, a fitness app called <em>Fitterfly</em> (which has not yet been uploaded to the App Store 😄 (1)). After that, I’ll mention a few alternatives I encountered in my journey as an iOS developer.</p><p><em>(1) However, we have a mini Pre-MVP available on TestFlight! Please let me know if you’d like to give it a try and provide feedback. Your input would be greatly appreciated.</em></p><h3><strong>A couple of words about Fitterfly</strong></h3><p>Fitterfly is a <strong>SwiftUI</strong> based app with a couple of third-party dependencies available using <strong>Swift Package Manager</strong>. Nothing fancy, to be honest.</p><p>Regarding architecture, I wanted to learn something different from the current stack I’m using in my full-time job (mostly <strong>MVVM</strong> + <strong>UIKit</strong> + <strong>RxSwift</strong>). Also, I enjoy working with functional paradigms: pure functions, isolated side effects, state machines, etc. These two constraints led me to <a href="https://github.com/pointfreeco/swift-composable-architecture">The Composable Architecture (TCA)</a>.</p><p>I’m still learning, but for now, I can say that I love having isolated features that can be easily modularized in the future. I like having side effects grouped in one file per feature and an architecture that’s more in sync with the <strong>SwiftUI</strong> UI paradigm. <strong>SwiftUI</strong> is similar to <strong>React</strong>, and <strong>TCA</strong> is like <strong>Redux</strong>.</p><h3><strong>Swift Dependencies</strong></h3><p>But I’m not here to talk about <strong>TCA</strong>. You can read about it <a href="https://www.pointfree.co/collections/composable-architecture">here</a>. I’m here to talk about a package also created by Point Free, which is included when you use <strong>TCA</strong>, but you can also use it independently. It’s called <strong>Swift Dependencies</strong>. Here’s the <a href="https://github.com/pointfreeco/swift-dependencies">repo</a>, and here’s the <a href="https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependencies">documentation</a>. Also, here’s a <a href="https://www.pointfree.co/collections/dependencies/designing-dependencies">video series</a> from Point Free authors about designing dependencies (I think it was the precondition that led them to write and publish the <strong>Swift Dependencies</strong> package, but I’m not sure about it).</p><p>When they talk about dependencies, they define them in a general way that opens your mind:</p><blockquote>Dependencies are the types and functions in your application that need to interact with outside systems that you do not control.</blockquote><p><em>“Outside systems that you do not control.”</em> Clearly, the backend communication in your app is one example (the most obvious one): it’s a completely separate piece of software, likely written in a different language, using different technologies, and possibly written by other members of your team. Another example could be iOS <strong>SDKs</strong>: a third-party open-source library or an Apple library.</p><p>But also, some <strong>Swift</strong> types can be treated as dependencies! For example, a <strong>Date</strong> initializer: if you create a <strong>Date</strong> object, it will give you the current date, now. Let’s say you have a unit test which needs to validate that a user is less than 18 years old, given their birth date. If you compare their birth date with a new date by using the <strong>Date</strong>’s initializer, you’ll have a different comparison depending on the time when you run the unit test! And this is something <em>you don’t control, it’s something </em><strong><em>external</em></strong><em> that affects your system.</em></p><p>It would be awesome to <em>control</em> external dependencies like this one, or to <em>simulate</em> different possible conditions, like Elon Musk and his team do with rockets.</p><h4><strong>Creating and using dependencies</strong></h4><p>As I mentioned, the best resource for starting to work with <strong>Swift Dependencies</strong> is its own documentation. However, I’ll provide a quick real use case for:</p><ul><li>Designing, creating, and using a simple dependency.</li><li>Advantages (mocks, <strong>SwiftUI</strong> previews, and unit tests).</li></ul><p><em>Note: At the end of the article, you’ll find a link to download a complete sample project with all the code explained below. It’s free, but you can choose to pay if you wish. If you do, know that you’re creating an incentive for me to continue writing these types of posts (and making me a happier person, because I’ll believe that my words are truly helping people out there 🙂).</em></p><h4><strong>Creating a dependency</strong></h4><p>Let’s say we’re building an app for an art museum (for example, the <a href="https://www.artic.edu/">Art Institute of Chicago</a>). And let’s say that we need to integrate the <a href="https://api.artic.edu/docs/#quick-start">REST service they have</a> in order to populate our app with data.</p><p>We will focus our attention on a single scenario: on the app’s home page, we need to display a list of artworks using <a href="https://api.artic.edu/docs/#collections">the artworks endpoint</a>. It would be awesome if we had a way to:</p><ul><li>At the view level: reproduce all possible scenarios (like a full list of items, an empty list, an API error, etc.) and see how the UI reacts to them.</li><li>At the business logic level: add unit tests to cover all possible scenarios described above.</li></ul><p>Assuming we have our project already set up with the <strong>Swift Dependencies </strong>package in place, let’s focus our attention on creating the backend dependency.</p><p>The first thing to think about is its high-level appearance. Usually, we define it by using <strong>protocols</strong>, and then we have concrete implementations depending on the case. A common example can be:</p><pre>// MARK: Interface<br><br>protocol ChicagoArtInstituteService {<br> func fetchArtworks() async throws -&gt; ArtworkResponse<br>}<br><br>// MARK: Live implementation<br><br>class LiveChicagoArtInstituteService: ChicagoArtInstituteService {<br> func fetchArtworks() async throws -&gt; ArtworkResponse {<br>  // Your concrete API request implementation using URLSession, Alamofire or<br>  // whatever networking tool you want to use.<br> }<br>}<br><br>// MARKL Test implementation<br><br>class MockChicagoArtInstituteService: ChicagoArtInstituteService {<br> func fetchArtworks() async throws -&gt; ArtworkResponse {<br>  // Your concrete mock implementation.<br> }<br>}</pre><p>This is clean! However, to reproduce all possible scenarios in a simulated environment like <strong>SwiftUI</strong> previews, we’ll need to create different mock implementations for each case (one to return an empty list, another for a list with artworks, etc.). If there’s a change in the API contract, we’ll need to update each mock implementation, plus the live one, to reflect it. And that’s… not fun.</p><p>This problem is deeply explained in <a href="https://www.pointfree.co/collections/dependencies/designing-dependencies/ep110-designing-dependencies-the-problem#t1693">this Point-Free episode</a>, in the last section titled <em>“Protocol-oriented problems”.</em> An improvement to overcome this issue is to use <strong>structs</strong> instead of <strong>protocols</strong>. One large <strong>struct</strong> can hold both live and mock implementations as properties:</p><pre>import Dependencies<br><br>// MARK: - Service interface (1)<br><br>struct ChicagoArtInstituteService {<br>    var fetchArtworks: () async throws -&gt; ArtworkResponse<br>}<br><br>// MARK: - Test implementation (2)<br><br>extension ChicagoArtInstituteService: TestDependencyKey {<br>    static let previewValue = Self(<br>        fetchArtworks: {<br>            ArtworkResponse.happyPathMock  // (2.a)<br>        }<br>    )<br>}<br><br>// MARK: - Live implementation (3)<br><br>extension ChicagoArtInstituteService: DependencyKey {<br>    static let liveValue = Self(<br>        fetchArtworks: {<br>            // (3.a)<br>        }<br>    )<br>}<br><br>// MARK: - Dependency registration (4)<br><br>extension DependencyValues {<br>    var chicagoArtInstituteService: ChicagoArtInstituteService {<br>        get {<br>            self[ChicagoArtInstituteService.self]<br>        }<br>        set {<br>            self[ChicagoArtInstituteService.self] = newValue<br>        }<br>    }<br>}</pre><p>Let’s explain a bit about what’s happening here:</p><p>1. We created a <strong>struct</strong> that serves as the service’s interface. Each API call is a property.</p><p>2. We adopted the <strong>TestDependencyKey</strong> <strong>protocol</strong>, from the <strong>Swift Dependencies</strong> package, to set all our mock dependencies.</p><p>2.1. I won’t include the complete <strong>ArtworkResponse</strong> <strong>struct</strong> here because it’s a lengthy model (it has many properties). If you want to check it out, download the sample project.</p><p>As for the <strong>happyPathMock</strong> property, it’s a <strong>static</strong> property that represents a response with a list of items, our happy path. Something like this:</p><pre>static let happyPathMock = {<br>    let mockJSON = &quot;&quot;&quot;<br>    {<br>        &quot;data&quot;: [<br>            // the list of items goes here!<br>        ]<br>    }<br>    &quot;&quot;&quot;<br><br>    let decoder = JSONDecoder()<br>    decoder.keyDecodingStrategy = .convertFromSnakeCase<br><br>    guard<br>        let jsonData = mockJSON.data(using: .utf8)<br>    else {<br>        debugPrint(<br>            &quot;Error: Cannot create Data from mockJSON&quot;<br>        )<br>        return ArtworkResponse(data: [])<br>    }<br><br>    do {<br>        let mockResponse = try decoder.decode(<br>            ArtworkResponse.self,<br>            from: jsonData<br>        )<br>        return mockResponse<br>    } catch {<br>        debugPrint(<br>            &quot;Error decoding mock JSON: \(error)&quot;<br>        )<br>        return ArtworkResponse(data: [])<br>    }<br>}()</pre><p>3. We did the same for <strong>DependencyKey</strong>, defining the actual implementation, the dependency that will be used in production to make the API call to the backend.</p><p>3.1. This closure is the actual implementation of the API call. It’s your choice, but if you want to use <strong>URLSession</strong>, here is a possible (simplified) implementation:</p><pre>// MARK: - Live implementation<br><br>extension ChicagoArtInstituteService: DependencyKey {<br>    static let liveValue = Self(<br>        fetchArtworks: {<br>            guard<br>                let url = URL(string: Constants.baseURL + &quot;/artworks&quot;)<br>            else {<br>                throw ArtworkError.invalidURL<br>            }<br><br>            do {<br>                let (data, response) = try await URLSession.shared.data(from: url)<br><br>                guard<br>                    let httpResponse = response as? HTTPURLResponse,<br>                    httpResponse.statusCode == 200<br>                else {<br>                    throw ArtworkError.requestFailed(<br>                        URLError(.badServerResponse)<br>                    )<br>                }<br><br>                let decoder = JSONDecoder()<br>                let artworkResponse = try decoder.decode(<br>                    ArtworkResponse.self,<br>                    from: data<br>                )<br><br>                return artworkResponse<br>            } catch {<br>                throw ArtworkError.decodingError(error)<br>            }<br>        }<br>    )<br>}<br><br>// MARK: - Service Errors<br><br>extension ChicagoArtInstituteService {<br>    enum ArtworkError: Error {<br>        case invalidURL<br>        case requestFailed(Error)<br>        case decodingError(Error)<br>    }<br>}</pre><p><strong>ArtworkError</strong> is an <strong>enum</strong> that represents several error cases that can occur.</p><p>4. We registered the created dependency.</p><h4><strong>Using the dependency</strong></h4><p>A user of the created dependency can be a view model. In our case, the view model is responsible for binding the view with the data that comes from the backend. Here’s a proposed implementation of it:</p><pre>import Dependencies<br>import Foundation<br><br>// MARK: - ArtworksViewModel<br><br>final class ArtworksViewModel: ObservableObject {<br><br>    // MARK: Observable properties<br><br>    @Published<br>    var artworks: [Artwork] = []<br><br>    @Published<br>    var isLoading = false<br><br>    @Published<br>    var errorMessage: String?<br><br>    @Published<br>    var apiError: Bool = false<br><br>    // MARK: Dependencies<br><br>    @Dependency(\.chicagoArtInstituteService)<br>    private var chicagoArtInstituteService<br><br>    // MARK: Methods<br><br>    @MainActor<br>    func loadArtworks() async {<br>        isLoading = true<br>        do {<br>            let response = try await chicagoArtInstituteService.fetchArtworks()<br>            artworks = response.data<br>        } catch {<br>            debugPrint(&quot;Failed to fetch artworks: \(error)&quot;)<br><br>            apiError = true<br>            if let error = error as? ChicagoArtInstituteService.ArtworkError {<br>                switch error {<br>                case .decodingError(_):<br>                    errorMessage = &quot;.decodingError :(&quot;<br>                case .invalidURL:<br>                    errorMessage = &quot;.invalidURL :(&quot;<br>                case .requestFailed(_):<br>                    errorMessage = &quot;.requestFailed :(&quot;<br>                }<br>            } else {<br>                errorMessage = error.localizedDescription<br>            }<br>        }<br>        isLoading = false<br>    }<br>}</pre><p>A couple of important points:</p><ul><li>The <strong>Dependencies</strong> section, in which we <em>inject</em> the dependency with a property wrapper that’s found in <strong>Swift Dependencies</strong>.</li><li><strong>loadArtworks()</strong> function, in which we <em>use</em> the dependency to retrieve data and modify the observable properties accordingly.</li></ul><p>Let’s define a simple <strong>SwiftUI</strong> view that uses the view model and displays the data to the end user:</p><pre>import SwiftUI<br><br>// MARK: - ArtworksView<br><br>struct ArtworksView: View {<br><br>    // MARK: Properties<br><br>    @ObservedObject<br>    private var viewModel: ArtworksViewModel<br><br>    // MARK: Views<br><br>    var body: some View {<br>        NavigationStack {<br>            List(viewModel.artworks, id: \.id) { artwork in<br>                VStack(alignment: .leading) {<br>                    Text(artwork.title)<br>                        .fontWeight(.bold)<br>                    Text(artwork.artistTitle ?? &quot;Unknown&quot;)<br>                        .font(.subheadline)<br>                        .foregroundColor(.secondary)<br>                }<br>            }<br>            .navigationTitle(&quot;Artworks&quot;)<br>            .onAppear {<br>                Task {<br>                    await viewModel.loadArtworks()<br>                }<br>            }<br>            .overlay {<br>                if viewModel.isLoading {<br>                    ProgressView(&quot;Loading...&quot;)<br>                } else if viewModel.artworks.isEmpty {<br>                    Text(&quot;Nothing to show here 🤐&quot;)<br>                        .font(.subheadline)<br>                        .foregroundColor(.secondary)<br>                }<br>            }<br>            .alert(<br>                &quot;Error&quot;,<br>                isPresented: $viewModel.apiError,<br>                presenting: viewModel.errorMessage<br>            ) { detail in<br>                Button(&quot;OK&quot;, role: .cancel) { }<br>            } message: { detail in<br>                Text(detail)<br>            }<br>        }<br>    }<br><br>    // MARK: Initializers<br><br>    init(viewModel: ArtworksViewModel) {<br>        self.viewModel = viewModel<br>    }<br>}</pre><h4><strong>What advantages do we gain from this implementation?</strong></h4><p>As we previously stated, we’d like to easily <em>swap behaviors</em>, <em>simulate different environments</em> not only to test our view models, but also our views!</p><h4><strong>View Models &amp; unit tests</strong></h4><p>We can override the view model dependencies by using a powerful function from <strong>Swift Dependencies</strong> called <a href="https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependencies/withdependencies(_:operation:)-4uz6m"><strong>withDependencies</strong></a>. With this, we can unit test every possible escenario.</p><p>First, let’s create more test dependencies to represent additional outcomes:</p><pre>// MARK: - Test implementation<br><br>extension ChicagoArtInstituteService: TestDependencyKey {<br>    static let previewHappyPathValue = Self(<br>        fetchArtworks: {<br>            ArtworkResponse.happyPathMock<br>        }<br>    )<br><br>    static let previewEmptyList = Self(<br>        fetchArtworks: {<br>            ArtworkResponse.emptyListMock<br>        }<br>    )<br><br>    static let invalidURL = Self(<br>        fetchArtworks: {<br>            throw ArtworkError.invalidURL<br>        }<br>    )<br><br>    static let decodingError = Self(<br>        fetchArtworks: {<br>            throw ArtworkError.decodingError(<br>                DecodingError.dataCorrupted(<br>                    DecodingError.Context(<br>                        codingPath: [Artwork.CodingKeys.altArtistIds],<br>                        debugDescription: &quot;There was an error while decoding keys&quot;<br>                    )<br>                )<br>            )<br>        }<br>    )<br><br>    static let requestFailed = Self(<br>        fetchArtworks: {<br>            throw ArtworkError.requestFailed(<br>                URLError(.badServerResponse)<br>            )<br>        }<br>    )<br>}</pre><p>And then, let’s create a couple of unit tests to cover them at the view model level:</p><pre>import XCTest<br>import Dependencies<br><br>@testable import SimulationsArticle<br><br>final class ArtworksViewModelTests: XCTestCase {<br><br>    // MARK: Private Properties<br><br>    private var sut: ArtworksViewModel!<br><br>    // MARK: Set up, Tear down<br><br>    override func tearDownWithError() throws {<br>        sut = nil<br>    }<br><br>    // MARK: Tests<br><br>    func test_artworksArray_withHappyPathMock_shouldHaveOneItem() async throws {<br>        sut = withDependencies {<br>            $0.chicagoArtInstituteService = .previewHappyPathValue<br>        } operation: {<br>            ArtworksViewModel()<br>        }<br><br>        await sut.loadArtworks()<br><br>        XCTAssertEqual(sut.artworks.count, 1)<br>        XCTAssertNil(sut.errorMessage)<br>        XCTAssertFalse(sut.apiError)<br>    }<br><br>    func test_artworksArray_withEmptyMock_shouldHaveZeroItems() async throws {<br>        sut = withDependencies {<br>            $0.chicagoArtInstituteService = .previewEmptyList<br>        } operation: {<br>            ArtworksViewModel()<br>        }<br><br>        await sut.loadArtworks()<br><br>        XCTAssertEqual(sut.artworks.count, 0)<br>        XCTAssertNil(sut.errorMessage)<br>        XCTAssertFalse(sut.apiError)<br>    }<br><br>    func test_artworksArray_withInvalidURLMockError_shouldHaveZeroItems_andCorrespondingErrorMessage() async throws {<br>        sut = withDependencies {<br>            $0.chicagoArtInstituteService = .invalidURL<br>        } operation: {<br>            ArtworksViewModel()<br>        }<br><br>        await sut.loadArtworks()<br><br>        XCTAssertEqual(sut.artworks.count, 0)<br>        XCTAssertEqual(sut.errorMessage, &quot;.invalidURL :(&quot;)<br>        XCTAssertTrue(sut.apiError)<br>    }<br><br>    func test_artworksArray_withDecodingMockError_shouldHaveZeroItems_andCorrespondingErrorMessage() async throws {<br>        sut = withDependencies {<br>            $0.chicagoArtInstituteService = .decodingError<br>        } operation: {<br>            ArtworksViewModel()<br>        }<br><br>        await sut.loadArtworks()<br><br>        XCTAssertEqual(sut.artworks.count, 0)<br>        XCTAssertEqual(sut.errorMessage, &quot;.decodingError :(&quot;)<br>        XCTAssertTrue(sut.apiError)<br>    }<br><br>    func test_artworksArray_withRequestFailedMockError_shouldHaveZeroItems_andCorrespondingErrorMessage() async throws {<br>        sut = withDependencies {<br>            $0.chicagoArtInstituteService = .requestFailed<br>        } operation: {<br>            ArtworksViewModel()<br>        }<br><br>        await sut.loadArtworks()<br><br>        XCTAssertEqual(sut.artworks.count, 0)<br>        XCTAssertEqual(sut.errorMessage, &quot;.requestFailed :(&quot;)<br>        XCTAssertTrue(sut.apiError)<br>    }<br>}</pre><h4>SwiftUI views &amp; previews</h4><p>We can use <strong>withDependencies</strong> + test dependencies to simulate each scenario in <strong>SwiftUI</strong> previews:</p><pre>// MARK: - Previews<br><br>#Preview(&quot;Happy path&quot;) {<br>    withDependencies {<br>        $0.chicagoArtInstituteService = .previewHappyPathValue<br>    } operation: {<br>        ArtworksView(viewModel: ArtworksViewModel())<br>    }<br>}<br><br>#Preview(&quot;Empty list&quot;) {<br>    withDependencies {<br>        $0.chicagoArtInstituteService = .previewEmptyList<br>    } operation: {<br>        ArtworksView(viewModel: ArtworksViewModel())<br>    }<br>}<br><br>#Preview(&quot;API error: .invalidURL&quot;) {<br>    withDependencies {<br>        $0.chicagoArtInstituteService = .invalidURL<br>    } operation: {<br>        ArtworksView(viewModel: ArtworksViewModel())<br>    }<br>}<br><br>#Preview(&quot;API error: .requestFailed&quot;) {<br>    withDependencies {<br>        $0.chicagoArtInstituteService = .requestFailed<br>    } operation: {<br>        ArtworksView(viewModel: ArtworksViewModel())<br>    }<br>}<br><br>#Preview(&quot;API error: .decodingError&quot;) {<br>    withDependencies {<br>        $0.chicagoArtInstituteService = .decodingError<br>    } operation: {<br>        ArtworksView(viewModel: ArtworksViewModel())<br>    }<br>}</pre><p>And this is the visual result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjewH0z-GFSFHg8Hwl8myg.png" /><figcaption>Happy path</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6oTACrpOpn0qsbEOTSjxg.png" /><figcaption>Empty list</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zESvEuGsx1p0p-jEKPseUA.png" /><figcaption>API error</figcaption></figure><h3><strong>Wrapping up</strong></h3><p>We didn’t simulate subsonic, transonic, or supersonic dynamics for rockets, nor did we conclude whether we live in a simulation. However, we were able to experiment with different environments on a sample iOS app and observe them in action at both the view model and view level! We can do the same for any future dependencies, decoupling our app from external elements, which is a superpower. A real-life example that illustrates this power: we needed to deploy a TestFlight version of Fitterfly for some users, solely to display the UI and gauge their reaction. The backend wasn’t ready. I was able to switch from real backend communication to mocks with a single <strong>withDependencies</strong> call at the app’s starting point. It was magic. Easy.</p><p>As a side note, it’s worth mentioning that <strong>Swift Dependencies</strong> is not the only package that can accomplish what we have achieved. I chose it because, as I mentioned, I’m using <strong>TCA</strong> and <strong>SwiftUI</strong> in Fitterfly, and it’s well-integrated with them. However, your project’s needs or characteristics may differ, and you should use critical thinking to decide the best option for your case. Here are some alternatives:</p><ul><li><a href="https://github.com/hmlongco/Factory"><strong>Factory</strong></a> (also influenced by the <strong>SwiftUI</strong>’s <strong>Environment</strong> pattern).</li><li><a href="https://stevenpcurtis.medium.com/the-service-locator-pattern-in-swift-5db2c770bcc"><strong>ServiceLocator</strong></a> pattern.</li><li>Dependency Injection with other techniques (like constructor injection or method injection).</li><li>And much more.</li></ul><p>If you know of other libraries or ways to accomplish similar behaviors, please mention them in the comments below or talk to me about them. I’d love to expand my knowledge on this topic.</p><p>See you in the next post and thank you very much for reading! 👋</p><h3><strong>Resources</strong></h3><p>You can download the full iOS project <a href="https://jmgentili.gumroad.com/l/simulations-article-ios-code">here</a>. Again: it’s free, but you can choose to pay if you wish. If you do, know that you’re creating an incentive for me to continue writing these types of posts (and making me a happier person, because I’ll believe that my words are truly helping people out there 🙂).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56f7d50fd041" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[«Build», «Make» & my side project]]></title>
            <link>https://medium.com/@jmgentili/build-make-my-side-project-11e0aa94fda0?source=rss-c70bc153caea------2</link>
            <guid isPermaLink="false">https://medium.com/p/11e0aa94fda0</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[side-project]]></category>
            <category><![CDATA[book-review]]></category>
            <dc:creator><![CDATA[Juan Manuel Gentili]]></dc:creator>
            <pubDate>Thu, 30 Nov 2023 21:48:15 GMT</pubDate>
            <atom:updated>2023-12-01T12:05:42.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SsMMOK0YXteg15uziTkO7w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@jmgentili?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Juan Manuel Gentili</a> on <a href="https://unsplash.com/photos/8Lk49prMRls?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p><em>Note:</em> if you wanna read this post in my personal blog, here’s the link:</p><p><a href="https://gentilijuanmanuel.github.io/posts/build-make-and-my-projects/">&quot;Build&quot;, &quot;Make&quot; &amp; my side project</a></p><h3><strong>Intro</strong></h3><p>I enjoy reading non-fiction books. Biographies, autobiographies, travel journals, topic-related ones. There are plenty of reasons:</p><ul><li>It inspires me. There are millions of intelligent people out there, with problems, solutions, mistakes, failures, and successes. That deserve to be read. Especially the problems, mistakes and failures, and how they overcome them: sometimes it’s easy to think that an important person never faced a failure, which is by all means not true. How they manage those situations is a source of motivation to me.</li><li>When you’re in the road doing something, a lot of doubts came to you mind, and a lot of bad things happen all the time. Having like a virtual companion, a person you don’t know but that’s talking to you thought a book is a valuable thing. You feel less alone in the dark moments.</li><li>In my mind, doing something + documenting it for future reference &gt; just doing something. I really value people who do something and also record that process in whatever form (in this case, we’re talking about books, but it can be a video, a talk, etc.). <em>“This guy went through exactly the same problem as I’m facing right now, and he wrote a couple of words about his journey! What can I learn from his experience?”</em></li><li>It enables me to challenge and question my perspectives: knowledge is a collective thing, and always doing what your gut tells you without the possibility to think the problem in a different way is a wrong move to me. Books can help you with that. History can help you with that. Travel can help you with that. Talking with other people with different perspectives can help you with that.</li></ul><p>As I said in previous posts, this year I stopped working on freelance projects after my full-time work hours, and I started to think about side projects. I started two, one is still alive. A fitness app. And in order to increase my motivation to spend more than 8 hours a day coding, I started reading some non-fiction books that are related with building products and startups.</p><p>I’d like to mention two, and share my learnings and highlights from them.</p><ul><li><em>Build</em>, by Tony Fadell.</li><li><em>Make</em>, by Pieter Levels.</li></ul><p>I really like the fact that both titles are more or less synonyms. It’s not coincidence.</p><h3><strong>Build</strong></h3><p>Tony Fadell is a monster. He worked at Apple from 2001 to 2008. He was the father of the iPod and co-creator of the iPhone. After that he built Nest and sold it to Google. A complete life dedicated to creating technology.</p><p>If you want to listen to him, I recommend Lex Friedman’s interview. Here’s <a href="https://www.youtube.com/watch?v=4oDZyOf6CW4">the link</a>. 2 hours and 46 minutes of Tony.</p><p>If you want to read him, you must get <a href="https://www.amazon.com/Build-Unorthodox-Guide-Making-Things/dp/B09CF2YB6Z?adgrpid=158657690121&amp;hvadid=678842482997&amp;hvdev=c&amp;hvlocphy=20021&amp;hvnetw=g&amp;hvqmt=e&amp;hvrand=9161373248178966668&amp;hvtargid=kwd-1809135502015&amp;hydadcr=26255_13666751&amp;keywords=build+tony+fadell+book&amp;qid=1701010993&amp;sr=8-1"><em>Build</em></a>.</p><h3><strong>Make</strong></h3><p>I came across Pieter Levels’ life and projects thanks to a thread on X, which I should mention was clickbait. I couldn’t find it, but it was something like, <em>”Look at this guy! He built a couple of successful side projects and now he’s a billionaire traveling around the world as a digital nomad!”</em> His most notable successes are <a href="https://remoteok.com/">RemoteOk</a> and <a href="https://nomadlist.com/">NomadList</a>. The former is a website for searching remote-friendly jobs, mostly in development. The latter is a community of digital nomads where you can find friendly cities to this lifestyle based on certain criteria. However, what’s truly remarkable about him are not his successes, but his failures. He has a <a href="https://x.com/levelsio/status/1457315274466594817?s=20">list</a> of all the startups he created. &gt;95% of them failed. Only 4 of 70+ projects made money and grew.</p><p>This metric, and the fact that he publicly shared it rather than feeling ashamed, is astonishing to me.</p><h3><strong>An interesting exercise</strong></h3><p>Given the fact that a book review is something a little bit conventional in my opinion (and you can find nice book reviews in Amazon or GoodReads if you want), I thought of a funnier exercise: <em>what if I just pick a couple of highlights from each book and write some thoughts about them?</em></p><p>I have read both books on my Kindle, so I have a pretty large database of highlights inside it. Instead of manually picking them, let’s get more random/automated: how if I rely on a script that selects random quotes from that source of truth? I have a really nice co-worker that will be happy to solve this problem: ChatGPT-4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIcgDKwdeq7TD6KSxxaKMA.png" /><figcaption>ChatGPT highlights</figcaption></figure><p>Nice! After some iterations, it came up with a pretty decent python script:</p><pre>import random<br>import re<br><br>def get_random_highlights(file_path, num_highlights=4):<br>    with open(file_path, &#39;r&#39;, encoding=&#39;utf-8&#39;) as file:<br>        contents = file.read()<br><br>    # Regular expression to extract each entry<br>    pattern = re.compile(r&#39;(.*?)\n- (Your Highlight.*?\n)\n(.*?)\n=+&#39;, re.DOTALL)<br>    highlights = re.findall(pattern, contents)<br><br>    # Check if the file has enough highlights<br>    if len(highlights) &lt; num_highlights:<br>        print(f&quot;Only {len(highlights)} highlights found. Returning all.&quot;)<br>        return highlights<br><br>    random_highlights = random.sample(highlights, num_highlights)<br>    return random_highlights<br><br>random_highlights = get_random_highlights(&#39;highlights.txt&#39;, 4)<br><br>for i, highlight in enumerate(random_highlights, 1):<br>    book_info, metadata, actual_highlight = highlight<br>    print(f&quot;{i}. Book info: {book_info.strip()}\n- Highlight metadata: {metadata.strip()}\nHighlight: {actual_highlight.strip()}\n{&#39;-&#39;*40}&quot;)</pre><p>I ran it using two different `.txt` files, one for each book.</p><p>Result for <em>Build</em>:</p><pre>1. Book info: Build (Tony Fadell)<br>- Highlight metadata: Your Highlight on Location 1356-1357 | Added on Thursday, December 15, 2022 7:52:56 PM<br>Highlight: I got a little seed money and then I was in it. I had to build a company. And not a side-job, small-potatoes college startup. A real company. A serious business.<br>----------------------------------------<br>2. Book info: Build (Tony Fadell)<br>- Highlight metadata: Your Highlight on Location 1160-1160 | Added on Thursday, December 15, 2022 7:20:39 PM<br>Highlight: “The amount of energy needed to refute bullshit is an order of magnitude higher than to produce it.”<br>----------------------------------------<br>3. Book info: Build (Tony Fadell)<br>- Highlight metadata: Your Highlight on Location 2562-2567 | Added on Saturday, January 21, 2023 11:30:33 AM<br>Highlight: There’s always an exception, an incredible wunderkind who rides a unicorn to the moon, but most successful entrepreneurs are in their late thirties and forties. There’s a reason why investors prefer to back second-time entrepreneurs even if they failed the first time around. It’s because these founders spent their twenties screwing up and learning. Most follow the same path I did: they work hard, fail and fail, take risks and go to doomed startups and try out giant companies and take the wrong job and luck into an amazing team and quit too early or don’t quit soon enough. They bounce around like a pinball, constantly smacking their heads into something. They learn. Trial by fire.<br>----------------------------------------<br>4. Book info: Build (Tony Fadell)<br>- Highlight metadata: Your Highlight on Location 340-349 | Added on Saturday, October 22, 2022 10:31:35 PM<br>Highlight: By the time General Magic was unraveling around me, I wasn’t just a lowly diagnostics engineer anymore. I’d worked on silicon, hardware, and software architecture and design. When things started to go awry, I’d ventured out and started talking to people in sales and marketing, began learning about psychographics and branding, finally grasped the importance of managers, of process, of limits. After four years, I realized there was a whole world of thinking that was needed before a line of code should be written. And that thinking was fascinating. That thinking was what I wanted to do. The enormous gut punch of our failure, of my failure, of everything I’d worked for falling apart—it made the path in front of me strangely clear: General Magic was making incredible technology but wasn’t making a product that would solve real people’s problems. But I thought I could. That’s what you’re looking for when you’re young, when you think you know everything then suddenly realize you have no idea what you’re doing: a place where you can work as hard as you can to learn as much as you can from people who can make something great. So even if the experience kicks your ass, the force of that kick will propel you into a new stage of your life. And you’ll figure out what to do next.<br>----------------------------------------</pre><p>Result for <em>Make</em>:</p><pre>1. Book info: MAKE Bootstrapper&#39;s Handbook (Pieter Levels)<br>- Highlight metadata: Your Highlight on Location 1426-1431 | Added on Friday, October 27, 2023 6:15:51 AM<br>Highlight: One of the greatest examples of this strategy is Buffer. From the start they&#39;ve shared every little step in the way to getting where they&#39;re now on their blog Buffer Open. Another good example is Drew Wilson who livestreamed the building of his new product Plasso for a whole week. He didn&#39;t just stream his screen, he streamed himself sleeping, waking up and making coffee. It worked because it built attention around him and his product.<br>----------------------------------------<br>2. Book info: MAKE Bootstrapper&#39;s Handbook (Pieter Levels)<br>- Highlight metadata: Your Highlight on Location 965-968 | Added on Sunday, October 15, 2023 3:44:33 PM<br>Highlight: Many people say you should launch where your customers are. And that&#39;s a great point. If you make a food delivery service for pets, are your customers really on Hacker News? Or Product Hunt? Or Reddit? I guess, they could be on all of those. But it&#39;d be probably smart to find an place where pet owners hang out. That could mean advertising on Facebook targeting pet owners, or reaching out to online forums for pets.<br>----------------------------------------<br>3. Book info: MAKE Bootstrapper&#39;s Handbook (Pieter Levels)<br>- Highlight metadata: Your Highlight on Location 308-310 | Added on Thursday, October 5, 2023 6:19:36 PM<br>Highlight: If you&#39;re at a party and someone asks you what you do and you answer you make booking software for African hairdressers, you might think it&#39;s too basic, i.e. you&#39;re not &quot;changing the world&quot; with this. But you shouldn&#39;t.<br>----------------------------------------<br>4. Book info: MAKE Bootstrapper&#39;s Handbook (Pieter Levels)<br>- Highlight metadata: Your Highlight on Location 653-655 | Added on Wednesday, October 11, 2023 10:17:43 PM<br>Highlight: The thing is, I only learn what I need when I need it. Instead of spending months on learning an ENTIRE language, framework or tool. I just learn the bit that I need now. This is a much faster and leaner approach which will save you time and make you more productive. And actually ship your product.<br>----------------------------------------</pre><h3><strong>My reaction to each highlight</strong></h3><h4><strong>Build</strong></h4><blockquote>I got a little seed money and then I was in it. I had to build a company. And not a side-job, small-potatoes college startup. A real company. A serious business.</blockquote><p>Well, I don’t remember which company is Tony referring to in this quote, but it’s a really good starting point to talk about the different approaches both authors have to build startups, the already known discussion between <em>VCs vs. Bootstrapping</em>:</p><p>Tony is more on the side of a conventional path to build startups nowadays: get money from investors or VCs, build an awesome team with a great idea and <em>“go big or go home”</em>. On the other side, Pieter Levels presents a substantially different approach, aka the indie way. He says you don’t need to have a big team and a lot of money and expensive expresso machines and an office with a nice view in San Francisco to build something great. You can just use your skills to build something by yourself solving a very specific, niche problem and then iterate on top of what you have built. As evidence, he talks about himself and NomadList, one of his successes:</p><blockquote>There’s been about 5 big direct Nomad List competitors come and go now that have been VC-funded from 1 to 10 million dollars in funding with teams from 10 to 30 people that made the same site as me. But they all didn’t go anywhere.</blockquote><p>Personally, I feel more represented by the indie way, because of the following reasons:</p><ul><li>I’m just a random guy from Argentina with no VC connections. I just know a few people in US (bosses, ex-bosses, coworkers, ex-coworkers, managers, ex-managers) and I have an indirect knowledge of the startup world that’s given to me via social media and sites like WellFound, etc. I never pitched an idea to a VC. I even never visited the US tbh (but I plan to in the future!).</li><li>I still have a full-time job I need to pay my bills.</li><li>I like to create stuff by myself: I’m curious about tangential areas of software development: UI/UX design, marketing, product, management, etc. I think learning stuff from these tangencial areas can make me a better developer. It’s not only technical skills.</li><li>I like the idea of growing organically.</li></ul><p>That being said, I use a bunch of services and apps that were created by startups with VC money. I don’t hate that approach, I think it has really valid applications. But at least for now, I feel a little bit more comfortable with the indie way.</p><blockquote>The amount of energy needed to refute bullshit is an order of magnitude higher than to produce it.</blockquote><p>Oh man, this is fucking important to me. And it’s important because I don’t think I’m doing it well, and I need to improve.</p><p>Some of the key differences between working for yourself and working for someone else is that in the first option you need to <em>decide</em> what to work on. In the second case, the <em>what</em> is given and you need to concentrate your efforts in the <em>how</em>. A common path in our team on my full-time job is:</p><ul><li>The product team decides what features we should implement.</li><li>The manager creates tickets based on that feature.</li><li>We (the engineering team) refine, estimate, implement and ship those features.</li></ul><p>As I mentioned previously, I’m working on a fitness related side project with two persons: a back-end/front-end dev and a marketing guy. We all are the product owner, and we need to decide the <em>what</em> and the <em>how</em> in every single step of the process. And the ideas and necessities are infinite. Can we integrate `HealthKit`? Yes, we can. Can we integrate `GPT-4` to ship some fancy AI-feature? Yes, we can. Should we integrate `HealthKit` and `GPT-4` <em>right now</em>? Hmm, I’m not sure.</p><p>Some hacks we have to prioritize or say “no” to ideas that come up:</p><ul><li>We have a Notion board to keep track of everything we need to work. We have a “Priority” field that can be `Low`, `Medium` or `High`, and we have status columns: `Backlog`, `Not started`, `In progress`, `On hold` and `Completed`. For each new idea, we set the priority and decide if we should put it in the `Backlog` or in the `Next up` column. An idea that’s low priority and is in the `Backlog` column is a great candidate to be cleaned up/deleted. But, as I said, I have the tendency to put tasks with medium/high priority on `Next up` column.</li><li>We have a high level product roadmap in which we divide epics in app versions. An epic can be, for example, “social sharing integration”, and app versions can be `MVP (1.0.0)`, `2.0.0`, etc. With this, we can see if we need to put our current focus on a feature right now or in the future.</li></ul><blockquote>There’s always an exception, an incredible wunderkind who rides a unicorn to the moon, but most successful entrepreneurs are in their late thirties and forties. There’s a reason why investors prefer to back second-time entrepreneurs even if they failed the first time around. It’s because these founders spent their twenties screwing up and learning. Most follow the same path I did: they work hard, fail and fail, take risks and go to doomed startups and try out giant companies and take the wrong job and luck into an amazing team and quit too early or don’t quit soon enough. They bounce around like a pinball, constantly smacking their heads into something. They learn. Trial by fire.</blockquote><p>I remember why I highlighted this quote. It’s in the beginning of a chapter called <em>“Are you ready?”</em>. The paragraph before this quote, to give more context:</p><blockquote>The archetypal entrepreneur is a twenty-year-old kid who lucks into a brilliant idea in their mom’s basement and watches it turn into a thriving company overnight. In the movie version, they parlay their technical genius into a flawed but effective leadership approach and watch the millions roll in. Then they buy a fancy car before learning the true value of friendship. But that is not reality.</blockquote><p>That stereotype of the successful entrepreneur never identified me, because of obvious reasons: I don’t consider myself a genius, I didn’t have a revolutionary idea at my 20’s, I didn’t grew up and also I don’t live in a first class country like Mark Zuckerberg, for example.</p><p>When I was young, probably because mass media and that commodified image of an entrepreneur, I thought that if I didn’t show anything interesting and innovative to the world pretty early in my career, I was done. The path was: start collage, get bored, drop, have an <em>*eureka*</em> moment that gives you an awesome idea and build something on top of that, then the product becomes a company and that’s it. Success.</p><p>But then I found that most of those experiences are exceptions. Not all entrepreneurs are Steve Jobs. There is a full range of possible life experiences behind each entrepreneur. And the quote I highlighted illustrates it: counterintuitively, there are a lot of good entrepreneurs that spent most of the time before their 30’s learning and trying and failing. That’s what I did since I finished my collage studies: learn new things, try side projects, gain experience at big tech companies (Venmo) and middle size ones (past experiences). Probably I still need a really good experience in a VC backed startup, yes. But that will come up.</p><p>The thing is the quote identified me.</p><blockquote>By the time General Magic was unraveling around me, I wasn’t just a lowly diagnostics engineer anymore. I’d worked on silicon, hardware, and software architecture and design. When things started to go awry, I’d ventured out and started talking to people in sales and marketing, began learning about psychographics and branding, finally grasped the importance of managers, of process, of limits. After four years, I realized there was a whole world of thinking that was needed before a line of code should be written. And that thinking was fascinating. That thinking was what I wanted to do.</blockquote><blockquote>The enormous gut punch of our failure, of my failure, of everything I’d worked for falling apart — it made the path in front of me strangely clear: General Magic was making incredible technology but wasn’t making a product that would solve real people’s problems. But I thought I could.</blockquote><blockquote>That’s what you’re looking for when you’re young, when you think you know everything then suddenly realize you have no idea what you’re doing: a place where you can work as hard as you can to learn as much as you can from people who can make something great. So even if the experience kicks your ass, the force of that kick will propel you into a new stage of your life. And you’ll figure out what to do next.</blockquote><p>This quote is the final part of an amazing chapter of the book. It’s called <em>“Adulthood”.</em> In it, Tony talks about his twenties, and specifically about his first experience as an employee at General Magic.</p><p>I’m on my twenties (at the end of my twenties, I should say, sadly), that’s why It’s interesting to me to see how he thoughts about this period of life. You finished you studies, you started to live without your parents, you started to take responsibility of your entire self and future, which is scary. In his words:</p><blockquote>From the moment you’re born until you move out of your parents’ house, almost all your choices are made, shaped, or influenced by your parents. And I’m not just talking about the obvious decisions — which classes to take, which sports to play. I mean the millions of hidden decisions you’ll discover when you leave home and start doing things for yourself:</blockquote><blockquote>What type of toothpaste do you use?</blockquote><blockquote>What kind of toilet paper?</blockquote><blockquote>Where do you put the silverware?</blockquote><blockquote>How do you arrange your clothes?</blockquote><blockquote>What religion do you follow?</blockquote><blockquote>All these subtle things that you never made a decision about growing up are already implanted in your brain. Most kids don’t consciously examine any of these choices. They mimic their parents. And when you’re a kid, that’s usually fine. It’s necessary. But you’re not a kid anymore. And after you move out of your parents’ house, there’s a window — a brief, shining, incredible window — where your decisions are yours alone. You’re not beholden to anyone — not a spouse, not kids, not parents. You’re free. Free to choose whatever you’d like.</blockquote><blockquote>That is the time to be bold.</blockquote><blockquote>Where are you going to live?</blockquote><blockquote>Where are you going to work?</blockquote><blockquote>Who are you going to be?</blockquote><p>At this age, you usually don’t have dependency on other people (parents) and other people don’t depend on you (no kids). After 30’s or 40’s, things can become a little bit more complex:</p><blockquote>When you’re in your thirties and forties, the window begins to close for most people. Your decisions can no longer be entirely your own. That’s okay, too — great even — but it’s different. The people who depend on you will shape and influence your choices. Even if you don’t have a family to support, you’ll still accumulate just a little more each year — friends, assets, social standing — that you won’t want to risk.</blockquote><p>For that reason, this period is the perfect time to try and fail, to take risks. As we say in Spanish: <em>“darse la cabeza contra la pared una y otra vez”</em>.</p><p>And that’s what he did on General Magic. He took a risk, started to work on a unknown startup at that time, and learn a ton of stuff. They failed. They built a product that no one acquired. It was obviously frustrating (“<em>I woke up and couldn’t get out of bed. I felt it in my chest. Everything we had done ended in failure. Everything.”</em>). But after some time, he was able to reflex on it in a positive way: think failures as learning experiences. Like Marie Forleo said in <em>Everything is figureoutable</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sol4JAl-3OFtISIJSsDdYg.jpeg" /></figure><p>It’s challenging and difficult to have this mindset, specially in the moment of the failure. But there is no book on how to live life. And if there were, life would be so boring that it would lose the meaning of being lived. We are all here to both succeed and make mistakes. And every failure is a springboard for a new chapter:</p><blockquote>So even if the experience kicks your ass, the force of that kick will propel you into a new stage of your life. And you’ll figure out what to do next.</blockquote><h4><strong>Make</strong></h4><blockquote>One of the greatest examples of this strategy is Buffer. From the start they’ve shared every little step in the way to getting where they’re now on their blog Buffer Open. Another good example is Drew Wilson who livestreamed the building of his new product Plasso for a whole week. He didn’t just stream his screen, he streamed himself sleeping, waking up and making coffee. It worked because it built attention around him and his product.</blockquote><p>The book has 7 chapters, each of them represents a particular stage in the startup journey:</p><ul><li>Idea</li><li>Build</li><li>Launch</li><li>Grow</li><li>Monetize</li><li>Automate</li><li>Exit</li></ul><p>This part is inside <em>Grow</em>, an interesting chapter that explains the indie way of growing companies. The author is an advocate of growing <em>organically</em>. Do things yourself. Don’t hire people if there is no revenue yet. Be ethical. Don’t fill your website with ads. Please, DON’T buy fake users. Etc.</p><p>There are a lot of strategies to grow your product in an organic way. One of them is to just tell stories around it. Storytelling. And one particular form of storytelling is inside the #buildinpublic movement. Write stories while building. It’s more or less what I’m doing here. Have like a journal to complement your product, and share experiences, successes and failures. You had problems integrating a third party SDK? Write a post about it! Probably someone outside will find it useful for their projects. It’s what I did on my previous post about Fastlane and Homebrew.</p><p><a href="https://buffer.com/resources/open/">Buffer Open</a> and Drew Wilson livestream are great examples that illustrate the idea. I’m not able to share the link of the livestream because it seems like Pieter forgot to provide the real one 😂:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDnBMiwIOHAEQxyN_Hyekw.png" /></figure><blockquote>Many people say you should launch where your customers are. And that’s a great point. If you make a food delivery service for pets, are your customers really on Hacker News? Or Product Hunt? Or Reddit? I guess, they could be on all of those. But it’d be probably smart to find an place where pet owners hang out. That could mean advertising on Facebook targeting pet owners, or reaching out to online forums for pets.</blockquote><p>Obviously, this quote is part of the <em>Launch</em> chapter. When you have a product ready to deploy, you’ll need to think of distribution strategies. Where should I announce my new app?</p><p>Mainstream media for builders is Hacker News, Indie Hackers, Product Hunt, Reddit, etc. But if you want to promote a niche product, probably it’ll be good to find niche media too.</p><p>Our side project is, as I said, a fitness app. The marketing guy in our team found a couple of interesting fitness events/websites in which we can promote our product.</p><blockquote>If you’re at a party and someone asks you what you do and you answer you make booking software for African hairdressers, you might think it’s too basic, i.e. you’re not “changing the world” with this. But you shouldn’t.</blockquote><p>This blowed my mind.</p><p>I was always under the pressure of the <em>“go big or go home”</em> mindset: you need to be like Steve Jobs, if not, you’re a failure. You need to change an entire industry in order to be remembered, if not, you’ll be dust in the wind. You won’t have a place in the select group of <strong>People Remembered Forever and Ever.</strong></p><p>But this is mostly bullshit. A game of the ego. It’s living your life worried about people remembering you or not when you’re dead. You won’t have feelings or consciousness in order to feel bad if they are not remembering you, because you’ll be dead! Non sense.</p><p>It’s better to focus your energy on the short life we have on earth. As Mario Benedetti said:</p><blockquote>I believe life is a parenthesis between two nothings.</blockquote><p>Let’s focus on the <strong>something</strong>, that short range inside parenthesis. The <strong>nothing</strong> will inevitably win, but that’s ok.</p><p>The relationship between Pieter’s booking software for African hairdressers example and my endless philosophical reflection is that sometimes is better to relax a little bit. Don’t try to change the world with your tiny app. Start small. Pick a small problem in a niche community and try to solve it. Then you can grow and add more use cases. But being really good to solve a specific issue in the world is a competitive advantage!</p><blockquote>Niches are specific market segments that are shallow enough to easily access, with not many players in there. Niches are a great start because they’re usually too small in economic value for big companies to attend to. They’re also the perfect size to market a new company towards.</blockquote><blockquote>Niches go against the ridiculous “go big or go home” attitude that the rise of startups in mainstream media pushed from 2006 onward. But that attitude isn’t realistic. Because most big companies started very small. If you start big from day one, it’s the wrong way to go about it. People don’t like niches because they’re too small for people’s ego’s.</blockquote><blockquote>The thing is, I only learn what I need when I need it. Instead of spending months on learning an ENTIRE language, framework or tool. I just learn the bit that I need now. This is a much faster and leaner approach which will save you time and make you more productive. And actually ship your product.</blockquote><p>When you’re working on a side project there is a huge amount of knowledge to acquire: development (backend, DBs, mobile, web, depending on your product’s needs), testing, CI/CD, marketing, product, management, negotiations, legals, taxes… The list goes on. Every time I need to learn something new, I try to be exhaustive, which is the opposite direction of what Pieter suggests.</p><p>I think there should be a balance between both strategies. one thing is clear: you need to ship your product. You cannot spend 3 months on a 3 points ticket. That’s why you need to set time constraints to move shit to the “done” column (for example, sprints). But, from the other side, it’s good to spend some time reading the documentation of some tool you wanna use, or do a complete research of possible ways to solve a particular issue. The idea is to ship a product, but not a crappy product. Your product needs to work. It needs to scale. It needs to solve people’s needs.</p><h4><strong>Wrapping up</strong></h4><p>I hope you liked this weird way of summarizing two nice books. As I said, everything here is me interpreting and applying concepts from both books to my personal journey, so probably it’s crap for someone experiencing a completely different life. But probably not! And if that’s the case, it’s more than enough to make me a little bit more happy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11e0aa94fda0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>