<?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 Carlos Galarza on Medium]]></title>
        <description><![CDATA[Stories by Carlos Galarza on Medium]]></description>
        <link>https://medium.com/@carloslfu?source=rss-a0ff72427672------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8j3JYv4rncgkHRHaF1shGQ.jpeg</url>
            <title>Stories by Carlos Galarza on Medium</title>
            <link>https://medium.com/@carloslfu?source=rss-a0ff72427672------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:41:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@carloslfu/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[Pragmatic software engineering, decision-making, and tradeoffs]]></title>
            <link>https://medium.com/@carloslfu/pragmatic-software-engineering-decision-making-and-tradeoffs-e6988bc1d32a?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6988bc1d32a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Tue, 16 May 2023 00:35:43 GMT</pubDate>
            <atom:updated>2023-05-16T00:35:43.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Image of two people making decisions" src="https://cdn-images-1.medium.com/max/1024/1*hDuzl512_WIvW2I35xsUHA.png" /><figcaption>Source: <a href="https://undraw.co/">https://undraw.co</a></figcaption></figure><p>How on earth do you choose what’s right for a project? How do you separate the signal from all the noise out there? Every decision you make means you let some opportunities go, <strong>you are always sacrificing something, </strong>and you might not realize what.</p><p>Here are a few notes based on a presentation I did for a company.</p><h3>Let’s start with the basics! Cognitive biases, we all have them!</h3><p>Studying cognitive biases will help you understand human behavior and also will help you avoid them.</p><p>Let’s take a look at this short video:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvKA4w2O61Xo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvKA4w2O61Xo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvKA4w2O61Xo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab79654c7dab4af08a42f4c24695c3d2/href">https://medium.com/media/ab79654c7dab4af08a42f4c24695c3d2/href</a></iframe><p>Interesting video, huh!</p><p>Here are a few things you can do to be more aware of cognitive biases:</p><ul><li>Try to disprove what you think as hard as you can!</li><li>Beware that you might be wrong and might have blind spots.</li><li>“Have degrees of certainty, but don’t be 100% sure about anything. Instead, be open to learning and prove yourself wrong.” — Richard Feynman.</li><li>Know that familiarity is not easily distinguishable from truth, but what looks familiar can be false very often.</li></ul><h3>A few principles</h3><h4>Maintain a radically open mind!</h4><p>Read and watch Richard Feynman, he gives many tips about this! Here is a gem:</p><blockquote>I never think “this is what I like” and “this is what I don’t like”, I think “this is what it is” and “this is what it isn’t”, and whether I like it or I don’t like it is really irrelevant. — Richard Feynman</blockquote><h4>Pragmatism. Be aggressively practical!</h4><p>This is crucial. It is easy to get lost in the sea of ideal solutions. Remember, <em>done is better than perfect</em>.</p><p>This XKCD explains my point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*1ceZ3tCVJ-iRyS7B2THn7Q.png" /><figcaption>The General Problem</figcaption></figure><h4>Don’t be a fan. Not blindly!</h4><p>Be a critical user of your tools. Everything has drawbacks and bad use cases. When you choose something, there are tradeoffs, and there are opportunities you missed!</p><p>For instance, let&#39;s take React as an example. A question I like to ask people during technical interviews is, what type of projects you won’t use React for? And why? This lets me see how much they know about it and how deep their knowledge is.</p><p>React is awesome! It has a great community and a lot of high-quality packages, tools, and projects around it that allow you to iterate fast. And notably, the React model frees you from handling DOM updates manually. However, can you think of any disadvantages of using it?</p><p>Knowing the disadvantages and limitations of your tools lets you make better decisions and is a sign that you really know them. I encourage you to deeply know your tools! You might be surprised how much this separates you from the average engineer.</p><p>React is not perfect! The <a href="https://svelte.dev/blog/virtual-dom-is-pure-overhead">virtual dom is overhead</a>, and it is slow! So a use case that isn’t good for React is performance-intensive UIs, for instance, a text editor UI. Here is an example from the open-source community of a use case in which React is not the best approach:</p><ul><li><a href="https://github.com/atom/atom/pull/1863">https://github.com/atom/atom/pull/1863</a></li><li><a href="https://github.com/atom/atom/pull/5624">https://github.com/atom/atom/pull/5624</a></li></ul><h4>Ask more profound questions, and question the problem!</h4><blockquote>Possibly the most common error of a smart engineer is to optimise a thing that should not exist</blockquote><blockquote>— Elon Musk, video: <a href="https://www.youtube.com/shorts/lzRHTale4uo">https://www.youtube.com/shorts/lzRHTale4uo</a></blockquote><p>So, challenge the problem. Is it really a problem? Are we solving the wrong thing? What is the root problem that we are solving? Is this just plain dumb? Try to push yourself to think outside the box and beware of your biases when answering those questions.</p><h4>Solve the problems you have now!</h4><p>A very common mistake of the average engineer is suggesting solutions to possible future problems that are not relevant now.</p><p>You might think you can predict the future, but you don’t, really! That sounds crazy, right? But, knowing the future is not one of your programming superpowers. I have seen this kind of over-confidence in future-seeking powers go wrong so many times! Please, don’t!</p><p>Also, even if you by chance predict it, it is far more efficient to iterate your way to it than having a complete solution before the problem appears, if it appears… it’s also about the right timing … Kubernetes I am staring at you!!</p><h4>DX matters</h4><p>So many times engineers over-optimize for machine performance and forget about people&#39;s performance.</p><p>Choose DX over machine performance 99% of the time. Don’t overthink this!</p><h4>Engineers tend to overengineer</h4><p>Think deeper about the problem and focus on it first. It’s really all that matters. Don’t think about solutions first. Overengineering is all over the place in our industry, <strong>more than you would think! </strong>Read about it. Related to the XKCD above!</p><p>Here are a couple of software principles to combat it:</p><ul><li>“duplication is far cheaper than the wrong abstraction” — <a href="https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction">https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction</a></li><li>“absence of structure is more structured than bad structure” — <a href="https://www.youtube.com/watch?v=QM1iUe6IofM">https://www.youtube.com/watch?v=QM1iUe6IofM</a></li></ul><h4>Beware of cargo culting!</h4><p>People cargo cult big companies a lot! This is cargo cult:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqmlYe2KS0-Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqmlYe2KS0-Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqmlYe2KS0-Y%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/138ffa5d54dc621748e4c6a4a3ba4a54/href">https://medium.com/media/138ffa5d54dc621748e4c6a4a3ba4a54/href</a></iframe><p>Cargo culting in our context are things along the lines of:</p><ul><li>Google is using Kubernetes. That means it is good and top-notch. It must be good for our company!</li><li>We will use GraphQL because Facebook is using it. If it works for them, it should work for us.</li><li>Netflix uses microservices. We should use them!</li></ul><p>We all want to be like those companies, right?</p><p>Oh! God! This is the biggest money waste I have seen in many companies! It comes from an incomplete view of how technical decisions should be approached. The main mistake is that you are not counting on all the variables. It is not just about tool X solving my problem. It’s also about <strong>the cost of ownership of that tool</strong>.</p><p>How do you avoid it?</p><ul><li><strong>Start with the problem.</strong> Is it real? Is it worth solving? If we solve it, does it make an impact on the business?</li><li><strong>Evaluate alternatives.</strong> Don’t be fancy; come up with the simplest, most boring solutions. It has additional points if one of the alternatives involves no new tools or moving parts.</li><li><strong>Evaluate the cost of ownership of all the options.</strong> It is a very common mistake not to take into account our own time, but indeed that <strong>is the most expensive part of the equation</strong>. I have seen so many engineers and technical leaders fail in this one. Be careful with it!</li></ul><p>Tech/approaches/architectures to be careful with when adopting:</p><ul><li><strong>Microservices / Distributed computing / Polyglot programming</strong></li><li><strong>Kubernetes</strong></li><li><strong>AWS:</strong> Once, I heard a technical leader say “we are on AWS, we finally look like a real company”. This is hardcore cargo culting!</li><li><strong>Kafka</strong></li><li><strong>Cassandra</strong></li><li><strong>GraphQL</strong></li><li><strong>NoSQL:</strong> It looks like it is finally not a buzzword anymore, but be careful.</li><li><strong>Domain Driven Design</strong></li><li><strong>Test Driven Development</strong></li></ul><h4>A few heuristics</h4><p><strong>Monoliths</strong> are great for a lot of use cases, 95%+ of cases, and they are dead simple to operate! Stick with monoliths as much as possible. What are the real reasons to split? Two really, <strong>real</strong> performance problems and team size provoked communication/operation bottlenecks. Those two are the most common ones. Evaluate evolving into a monorepo if you have those problems.</p><p>Using just <strong>one language</strong> is awesome! Do it if you can!</p><p>Having <strong>a hybrid app</strong> that reuses your web app is great! Mobile native is for special cases. <strong>Native is hard, more complex, and more expensive</strong>.</p><p>AWS and self-managed infrastructure is hard but shiny but <strong>ops are hard</strong>. I have done this! Stick to simple and outsourced infra as much as you can! ⚠️ Delegate this as much as you can! If you don’t want Heroku, there are <strong>Heroku-like alternatives </strong>(check out <a href="https://railway.app/">https://railway.app</a>).</p><p>Prefer SaaS over PaaS and PaaS over IaaS, and obviously, prefer IaaS over on-premises!</p><p>Don’t undervalue small process improvements. There are always small things that make us less performant. At the companies I help I have found tons of dumb things people do that they do because everyone does them. <strong>Look for those things and kill them!</strong></p><p>Testing coverage is overrated! Testing core critical services is enough if you are small (90% of cases).</p><h4>Final notes</h4><p>Our job as software engineers and leaders is to tame complexity, make good enough decisions, give value to the business, and keep it doing business!</p><p>Read this article about choosing boring tech: <a href="https://mcfunley.com/choose-boring-technology">https://mcfunley.com/choose-boring-technology</a>. It is one of the best articles about choosing tech ever!</p><p>Also, I highly recommend reading: <a href="https://blog.juliobiason.me/thoughts/things-i-learnt-the-hard-way/">https://blog.juliobiason.me/thoughts/things-i-learnt-the-hard-way/</a>. It has great points such as “Future thinking is future trashing”, and “Understand and stay way of cargo cult”.</p><p>If you have any questions, feel free to ask them in the comments, I would love to love help.</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6988bc1d32a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should my software be open-source? Commercial Open Source Software models.]]></title>
            <link>https://medium.com/@carloslfu/should-my-software-be-open-source-commercial-open-source-software-models-24cc6b0fa003?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/24cc6b0fa003</guid>
            <category><![CDATA[founders]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[licensing]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 04:07:00 GMT</pubDate>
            <atom:updated>2023-06-23T01:57:14.134Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A vector illustration of open source software" src="https://cdn-images-1.medium.com/max/1024/1*xa4y0zgi09JRECcbt6d5Ww.png" /><figcaption>Image source: <a href="https://undraw.co/">https://undraw.co</a></figcaption></figure><p>I am working on a SaaS software that I will be <a href="https://www.frontpad.app/">launching soon</a>, and as an <a href="https://github.com/carloslfu">open-source contributor</a> and enthusiast, I was wondering if it should be open or not 🤔. I collected a few notes about this during my research and realized that many people were wondering the same. So, I thought this might be useful for other people too. Here is what I learned from my research.</p><p>Let&#39;s start by saying that making your software open-source makes more sense in three scenarios:</p><ul><li>Your audience is developers or related technical roles. This will increase adoption.</li><li>You want to appeal to medium-big customers. Open code makes it easier for them to try and use your software and helps them with data privacy and compliance. Like <a href="https://posthog.com/">PostHog</a>.</li><li>Your users would benefit from self-hosting and a flexible, open, and accessible product. Like <a href="http://cal.com/">Cal.com</a>.</li></ul><p>However, there are many drawbacks like more difficult monetization and rip-offs. If you are unsure about it, please read this article by the founder of Cal.com: <a href="https://cal.com/blog/open-source">https://cal.com/blog/open-source</a>. It is great at explaining when to make your software open-source.</p><h3>How do you make it open?</h3><p>I identified a few variants of open software. There is <strong>open-source software (OSS) </strong>that tends to be more liberal. There is <strong>free and open-source software (FOSS), </strong><em>free like libre not just like gratuitous.</em> And there is <strong>open-core software</strong> which is a mix of open and restrictive licenses. Here is a high-level overview of them.</p><p><strong>FOSS (Free and Open Source Software). A</strong>nyone can use the software for free, but if they improve or modify it, they shall publish the modifications. This includes yourself, so you cannot reverse this 👀<strong>. </strong>These licenses are usually referred to as copyleft licenses.</p><p><strong>OSS (Open-source software). </strong>Anyone can use the software for free and do whatever they want without publishing it<strong>. </strong>I am talking about the <a href="https://opensource.org/licenses/MIT">MIT license</a> here because it is the one I am more familiar with. See <a href="https://opensource.org/">https://opensource.org</a>.</p><p><strong>Open-core software. </strong>You can think of it as a mix of open and proprietary software while keeping the open-source spirit. There are two options here, and you can mix them:</p><ul><li><strong>Use the fair-code model:</strong> You have one open license that restricts some things, such as <a href="https://www.elastic.co/blog/why-license-change-aws">AWS stealing your business model</a>. See <a href="https://faircode.io/">https://faircode.io</a>.</li><li><strong>Use the mixed licenses model:</strong> Parts of your code could be OSS or FOSS like MIT or AGPL, other parts can use the fair-code model, and others could have an enterprise license.</li></ul><p>Additionally, there is the option of <strong>not publishing all the code.</strong> This one is simple. Let&#39;s say you publish the core of your product as OSS or FOSS (or as <a href="https://faircode.io/">fair-code</a>) and keep the rest private. For instance, you could keep plugins, a dashboard, or some utilities private.</p><p>Which is better for you? Well, <em>it depends</em>™️ on your use case.</p><p>I want to make clear that my take on this article leans more toward practicality and less toward ideology. However, both sides are interesting, and I recommend you study both.</p><p>On a historical note. It is interesting to me that the way the FOSS community was opposed to OSS is a bit similar to the way some people from the OSS community are opposed to the open-core model right now 🤔. I will leave this here and continue with the article … 👀 😬</p><h3>How do I make money with open-source?</h3><p>There are a few ways, and you can combine them:</p><ul><li>Sell derivative work: UI templates, starter projects, plugins, etc.</li><li>Teach about related specific or deep stuff: webinars, courses, books, workshops, etc.</li><li>Sell premium support and consulting.</li><li>Create a SaaS or hosting company around the project. I recommend going with the open-core model for this one. With this model, a big chunk of the revenue typically comes from enterprise customers.</li></ul><h3>Is it reversible?</h3><p>Yes! But only if you choose the right license. For instance, do not choose copyleft licenses if reversing concerns you. Choose something more liberal, like an MIT license, or use the open-core model. There are two interesting cases here:</p><ul><li>Taking an open source project back to proprietary when the license wasn’t appropriate as Octotree did: <a href="https://github.com/christianbundy/octotree/issues/1">https://github.com/christianbundy/octotree/issues/1</a></li><li>Taking an open source project back to proprietary the right way like Sizzy: <a href="https://kitze.io/posts/github-stars-wont-pay-your-rent">https://kitze.io/posts/github-stars-wont-pay-your-rent</a></li></ul><h3>Companies that are using the open-core model</h3><p>Here are a few interesting projects you can draw inspiration from:</p><ul><li>n8n: <a href="https://github.com/n8n-io/n8n">https://github.com/n8n-io/n8n</a></li><li>Cal.com: <a href="https://github.com/calcom/cal.com">https://github.com/calcom/cal.com</a></li><li>PostHog: <a href="https://github.com/PostHog/posthog">https://github.com/PostHog/posthog</a></li><li>TimescaleDB: <a href="https://github.com/timescale/timescaledb">https://github.com/timescale/timescaledb</a></li><li>Elasticsearch: <a href="https://github.com/elastic/elasticsearch">https://github.com/elastic/elasticsearch</a></li></ul><p>Take a look at their product, licenses, and pricing models; you learn a lot from seeing this in practice.</p><h3>My recommendation (not legal advice 👀)</h3><p>This is the path I will follow, and it is the one that appeals the most to me to build a sustainable business on top of an open project. Create a SaaS offering and choose a fair-code license, then transition to the mixed license model when you have enterprise features like SSO SAML, premium support, uptime SLA, dedicated cloud, compliance checks, etc.</p><p>I hope this helps. If you find any mistakes in this article, feel free to contact me, and I will correct them. I am not a specialist in software licensing, but this info might be useful to founders/makers like me that are wondering about open-sourcing their projects.</p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><h4>Additional resources</h4><p>Interesting articles:</p><ul><li>TimescaleDB open-source model: <a href="https://www.timescale.com/blog/building-open-source-business-in-cloud-era-v2/">https://www.timescale.com/blog/building-open-source-business-in-cloud-era-v2</a></li><li>Elastic vs AWS: <a href="https://www.elastic.co/blog/why-license-change-aws">https://www.elastic.co/blog/why-license-change-aws</a></li><li><a href="https://opensource.com/article/17/11/open-source-or-free-software">https://opensource.com/article/17/11/open-source-or-free-software</a></li><li><a href="https://cal.com/blog/open-source">https://cal.com/blog/open-source</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24cc6b0fa003" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 reasons to use Golang]]></title>
            <link>https://medium.com/@carloslfu/5-reasons-to-use-golang-b7036b395f27?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7036b395f27</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Mon, 22 Jul 2019 18:10:58 GMT</pubDate>
            <atom:updated>2023-05-16T00:56:58.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3Huif4E43KHDro3vv7szTQ.png" /><figcaption>Gopher :)</figcaption></figure><p>There are several reasons to start using <strong>Go</strong>:</p><ol><li>It’s statically, strongly typed with a great way to handle errors, this makes Golang more reliable and robust.</li><li>It compiles down to one binary. Just execute it in wherever you want.</li><li>It’s faster.</li><li>The main reason why I use it is <strong>simplicity</strong>, there is only one way to do things, no more “beauty” and “clever code”, this point increases your code readability. You and your team always know what a piece of code is doing. It is the Golangs <strong>killer-feature</strong> 🔥.</li><li>For the reasons above, it is easier to teach Golang to new devs from scratch and they will get productive in a short time.</li></ol><p>In my case, I used <strong>NodeJS</strong> for a long time and had <strong>Golang</strong> under my eyes once I read an article by <strong>Tj</strong>, an important member of the NodeJS community. If you have used Node, probably you have used ExpressJS or at least read about it. Well, <strong>TJ Holowaychuk</strong> is its creator! I leave here the link to the article:</p><p><a href="https://medium.com/code-adventures/farewell-node-js-4ba9e7f3e52b">Farewell Node.js</a></p><p>In the beginning, Golang is a bit weird and your code gets larger, you have to forget about <em>Array.map</em> .. <em>filter</em> .. and all kinds of “beauty” things of <strong>JavaScript</strong> and other modern languages, also, you have <strong>to handle every possible error</strong>. But, in the long-term, it makes your code more readable, simple and stable.</p><p>For example, the unique way to iterate in Golang is “for” and there is no ternary operator 😮, but this is the Golang strength 💪, simplicity.</p><p>A couple of months ago with my team, we are using Golang for building the <a href="https://licitamatic.com/">LiciMatic</a>’s backend, the platform I work on, and now Golang is my preferred language.</p><p>So, I recommend you learning Glango, you are going to learn a lot and you will have big professional opportunities.</p><p>I want to highlight that Golang is at the top of the best-paid languages of 2019:</p><p><a href="https://lvivity.com/top-highly-paid-programming-languages">Top 8 Highly Paid Programming Languages to Learn in 2019</a></p><p>I leave here 3 free learning resources:</p><ul><li><a href="https://goplay.space/">Online development environment for Golang</a></li><li><a href="https://gobyexample.com/">Golang by example</a></li><li><a href="https://www.youtube.com/watch?v=G3PvTWRIhZA&amp;list=PLQVvvaa0QuDeF3hP0wQoSxpkqgRcgxMqX">Golang video tutorial</a></li></ul><p>If you have any questions, feel free to ask them in the comments, I would love to love help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7036b395f27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 razones para usar Golang]]></title>
            <link>https://medium.com/@carloslfu/5-razones-para-usar-golang-366d721a011e?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/366d721a011e</guid>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Fri, 05 Jul 2019 21:47:45 GMT</pubDate>
            <atom:updated>2019-07-22T21:44:49.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*3Huif4E43KHDro3vv7szTQ.png" /><figcaption>Gopher :)</figcaption></figure><p>Hay varias razones para empezar a usar<strong> Go</strong>:</p><ol><li>Es tipado estáticamente y con un muy buen manejo de errores, esto lo hace más confiable y robusto.</li><li>Te da un binario solo debes ejecutarlo en la maquina que quieras.</li><li>Es más rápido.</li><li>La principal razón por la que lo uso es la <strong>simplicidad</strong>, solo hay una forma de hacer las cosas, nada de código “bonito” y “clever code”, lo que mejora la legibilidad del mismo. Esto se ve reflejado en que siempre sabes que hace un código y que esperar de él. Este es el <strong>killer-feature</strong> de Golang 🔥.</li><li>Por lo anterior, es más facil educar devs desde 0 para el lenguaje y que sean productivos en poco tiempo.</li></ol><p>En mi caso, usé un largo tiempo <strong>NodeJS</strong> y tenía a <strong>Golang</strong> bajo la mira desde que lei un artículo de <strong>Tj</strong>, un contribuidor muy importante de la comunidad de NodeJS. Si has usado Node seguramente has usado ExpressJS o leído de esta librería, pues bien <strong>TJ Holowaychuk</strong> es su creador! te dejo aquí el link al artículo:</p><p><a href="https://medium.com/code-adventures/farewell-node-js-4ba9e7f3e52b">Farewell Node.js</a></p><p>Al pricipio Golang es un poco raro y tu código será más largo, tienes que olvidarte de <em>Array.map</em> .. <em>filter</em> .. y todo tipo de cosas “bonitas” de <strong>JavaScript</strong> y otros lenguajes, también debes <strong>manejar</strong> <strong>cada error posible</strong>. Pero a la larga eso hace que tu código sea más legible, simple y estable.</p><p>Por ejemplo la única forma de iterar en Golang es “for” y con decirte que no tiene ni operador ternario 😮, pero esto mismo es su fortaleza 💪, la simplicidad.</p><p>Hace un par de meses estoy usando Go junto a mi equipo para construir el backend de <a href="https://licitamatic.com/">LiciMatic</a>, la plataforma en la que estoy trabajando, y ahora Go es mi lenguaje preferido.</p><p>Así que te recomiendo aprender Golang, vas a aprender un montón y tendras grandes oportunidades laborales.</p><p>Es de destacar que Golang esta en el top de los lenguajes mejores pagos en 2019:</p><p><a href="https://lvivity.com/top-highly-paid-programming-languages">Top 8 Highly Paid Programming Languages to Learn in 2019</a></p><p>Te dejo <strong>3 recursos gratuitos</strong> de aprendizaje:</p><ul><li><a href="https://www.youtube.com/watch?v=e37Q4SLC-30&amp;list=PLV-IZMSUqzrNkcKRCw2cjKrW0a8l5qvgb">Curso de Golang en español</a></li><li><a href="https://goplay.space/">Entorno de Desarrollo Online</a></li><li><a href="https://gobyexample.com/">Ejemplos de Golang</a></li></ul><p>Quieres saber más acerca de Golang y otros temas muy interesantes?</p><p>Sigueme aquí en <strong>Medium</strong> y en <strong>Twitter</strong>:</p><p><a href="https://twitter.com/carloslfu">Carlos Galarza (@carloslfu) | Twitter</a></p><p>Gracias y feliz aprendizaje! 🙂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=366d721a011e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write accessible code?]]></title>
            <link>https://medium.com/@carloslfu/how-to-write-accessible-code-c122f1fb3c87?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/c122f1fb3c87</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Thu, 23 May 2019 00:44:34 GMT</pubDate>
            <atom:updated>2023-05-16T00:59:51.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*ki49jQZABVE2_C46iBBPIA.png" /></figure><p><strong>1.</strong> Group code blocks in a logical way:<br> - Keep your variables close to where they are used.</p><p><strong>2.</strong> Use short names:<br> - Naming a variable “a” or “b” is fine.<br> - But … I lose context, right? … DO NOT! If you respect rule 1, there is no problem, you will reduce the redundancy and the cognitive load of your code.</p><p><strong>3.</strong> Use names that speak for themselves:<br> - Nothing of “mVal”, “tRows”, etc …</p><p><strong>4.</strong> Use the new lines intentionally:<br> - In the same way that you divide a text into paragraphs, make the new lines in your code communicate something.</p><p>If you want to expand this information I recommend this video, it is based on Go but it applies to other languages as well -&gt;<br>⚡️⚡️⚡️</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcVaDY0ChvOQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcVaDY0ChvOQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcVaDY0ChvOQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c658a3fc9174adc3ec70cad792cae4c0/href">https://medium.com/media/c658a3fc9174adc3ec70cad792cae4c0/href</a></iframe><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c122f1fb3c87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modeling a Screensaver with a Statechart, a real use case.]]></title>
            <link>https://medium.com/@carloslfu/modeling-a-screensaver-with-a-statechart-a-real-use-case-f57301682570?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/f57301682570</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[finite-state-machine]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 17:40:30 GMT</pubDate>
            <atom:updated>2023-05-16T01:01:59.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*HCFrv3uFF3x6ZqYkJLqK6A.png" /><figcaption>Screensaver over the app</figcaption></figure><p>Last year I developed a touchable desktop application for a client (a museum) using Electron, React and a little custom CMS with NodeJS. The client requested that the app should have a Screensaver. The first requirements were:</p><ul><li>The Screensaver should be opened at first.</li><li>When the user touches the Screensaver it should disappear.</li><li>Once disappeared, and if the user doesn’t interact with the app in 90 seconds, it should appear again.</li></ul><p>Easy right? so let’s do it with a timeout 😉. First, we are gonna use 3 seconds as the inactive time instead of 90, I don’t wanna wait 90 seconds to test it out, also I’m gonna call this time SCREENSAVER_DELAY_MS.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fovo12zqo4q&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fovo12zqo4q&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fovo12zqo4q%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/67e2a0d6f7a75616defc8a45219f3492/href">https://medium.com/media/67e2a0d6f7a75616defc8a45219f3492/href</a></iframe><p>At this time, the code doesn’t look so good but it’s not that hard to read. But, after showing how it’ll work, <strong>the client asked me to add one more requirement</strong>.</p><blockquote>While the Screensaver is shown I want it to appear 5 minutes and disappear for 1 minute, and then appear 5 minutes and disappear 1 minute … and so on until the user interacts with the app.</blockquote><p>The reason for this was to show to the user that the app is interactive, so let’s modify the code to meet the new requirement. I gonna call the new constants `SCREENSAVER_ACTIVE_TIME_MS` for the time the Screensaver is shown and `SCREENSAVER_INACTIVE_TIME_MS` for the time the Screensaver is hidden. In the code below I changed the original times, but it works like expected.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F5xrrr09r9k&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F5xrrr09r9k&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F5xrrr09r9k%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/d768c047a189ef260dde6ce9bde6f35f/href">https://medium.com/media/d768c047a189ef260dde6ce9bde6f35f/href</a></iframe><p>As you can see above, the code becomes more complex and difficult to read.</p><h3>Modeling it with a statechart</h3><p>I finally modeled it using a <a href="https://statecharts.github.io/">statechart</a> and implemented it using <a href="https://xstate.js.org/docs/">XState</a>. I used <a href="https://xstate.js.org/docs/guides/delays.html">delayed transitions</a> and found it so useful for this case. See how the final statechart code looks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69txxPhrxWoN50cXizaZUA.png" /></figure><p>The statechart has two main states:</p><ul><li><strong>active</strong>: the Screensaver is shown, and switches between <em>visible</em> and <em>hidden</em> state until the user interacts with the app. When the user interacts with the app, the next state is <em>inactive</em>.</li><li><strong>inactive</strong>: the Screensaver is hidden, and there is a timer for making it appear again.</li></ul><p>I use a <a href="https://statecharts.github.io/glossary/self-transition.html">self-transition</a> in the <strong>inactive state </strong>to reset the timer each time the user interacts with the app.</p><p>Note that the <strong>active</strong> state has two sub-states (is a <a href="https://statecharts.github.io/glossary/compound-state.html">compound state</a>), <strong>visible</strong> and <strong>hidden</strong>, which are used to meet the latest client requirements.</p><p>In the example, I reduced the delays to be able to test it faster. Here the working code:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F3qlmw4m4rq&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F3qlmw4m4rq&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F3qlmw4m4rq%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/f17f48087e8f06b2f68c64d81cad9625/href">https://medium.com/media/f17f48087e8f06b2f68c64d81cad9625/href</a></iframe><p>And that’s it! I achieved a simpler and cleaner code by modeling the Screensaver with a Statechart 🚀.</p><h4>Unit Testing</h4><p>It is so easy to test a statechart 👌, see some unit tests for the Screensaver machine in the <a href="https://codesandbox.io/s/3qlmw4m4rq?module=%2Fsrc%2Fmachine.test.js">machine.test.js file</a>.</p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><p>This article is part of a series about statecharts:</p><ul><li><a href="https://medium.com/@carloslfu/tackling-ui-complexity-with-state-machines-b3f1eb6d1a97">Tackling UI complexity with State Machines</a>.</li></ul><p>Happy hacking! 🤖</p><p>Many thanks to Eric Rabbath and Erik Mogensen for giving me feedback on the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f57301682570" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tackling UI complexity with State Machines]]></title>
            <link>https://medium.com/@carloslfu/tackling-ui-complexity-with-state-machines-b3f1eb6d1a97?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3f1eb6d1a97</guid>
            <category><![CDATA[finite-state-machine]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Tue, 20 Nov 2018 16:25:06 GMT</pubDate>
            <atom:updated>2023-05-16T01:02:37.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*gb1ai2BxbjvGY_7_pq9QHA.png" /><figcaption>A simple on-off state machine</figcaption></figure><p>I’ll tell you my story, maybe is yours too …</p><p>So it’s a great day at my workplace and I start coding an app that seems pretty simple.</p><p>Time passes, I get some tasks done and, at some point, the application starts getting messy.</p><p>I solve the problem by making some tricks because I’m quite smart and experienced developer 😉.</p><p>But, I start feeling dirty and sometimes astonished about how that simple idea, I had in my mind, is getting so complex and verbose to map to code. I think there is no <strong>one-to-one relationship</strong> between my mindmap and the code, it seems like a <strong>one-to-many relationship</strong>.</p><p>I’m the creator. I know how things work and this is not worrying me so much, because I do my best to write understandable and readable code.</p><p>After that, the app starts getting bigger and now I have to work with a colleague to speed things up.</p><p>Right now my colleague has many questions because he doesn’t know how the f*ck the app works! and what’s the idea behind it. I care about his health and I take the time to explain him the code. I’m a kind person I don’t want to make him waste that time 😅.</p><p>Sometime later I’m assigned to other app and, right now, I can understand the pain it was to my dear colleague to understand my code because I have to figure out how the cr*p this new UI code works.</p><p>Some months ago I’m reassigned to the first app for solving a bug, and you know, I should figure out how was my thinking these days.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fa5viI92PAF89q%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fa5viI92PAF89q%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExMGhhZWI4ZjcwOGl4andycHJkY211YXVsdWdkbmpqOXZibXk1ZzhvYiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2Fa5viI92PAF89q%2Fgiphy_s.gif&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="300" frameborder="0" scrolling="no"><a href="https://medium.com/media/46a8a563f1ce9e14a0ffa3b5a4662a93/href">https://medium.com/media/46a8a563f1ce9e14a0ffa3b5a4662a93/href</a></iframe><p>I always thought that there is something I’m missing, some solution that doesn’t come with extended and outdated UI specification documents. Something that makes me and others catch the idea faster and spend less time understanding the code. And yep, I was right, finally, I found it.</p><h3>Introducing Statecharts</h3><p>These problems happen to almost all people involved in any kind of reactive systems development such as UI development and, some people are too used to struggle with it, that it seems unavoidable and natural, but it is not.</p><p>The problem is a well known one, <em>reactive systems are complex because of event orchestration complexity</em>. And, solving this problem is a matter of getting things explicit from the beginning. So, your mental model should be coded in a way that you and others can easily reason about.</p><p>In simple terms, a <strong>Statechart</strong> is a pure function that contains all the logic related to the event-state orchestration in an explicit way. This way we can avoid the most common bugs and, if there are some, it’s easy to find them.</p><p>With statecharts, you have a simple and manageable way to organize this logic by using a graph and some constructions. This gives us the power to reason about complex UI flows, and at the same time, it prevents unexpected behavior to happen. Just FYI this formalism is used at NASA <a href="https://spectrum.chat/?t=9ed1415b-ce18-444e-83aa-55b5e18ce047">for the Mars Science Laboratory Mission</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbYaJAK2KxuJZVoWfi8pRA.jpeg" /><figcaption>Taken from the NASA gallery</figcaption></figure><p>Yep! Curiosity uses statecharts! 😮 😎</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQMYIplAu5DX7E3rS6qYXA.png" /></figure><p>You give to the statechart the <em>current state</em>, the <em>event</em> that happened, and optionally some <em>external data</em>, and it gives you back the <em>next state </em>and the <em>actions</em> that should be performed. An <strong>Action</strong> is a pretty simple concept, you can understand it as commands or functions that should be executed in response to the event that happened.</p><h4>You already have state machines in your code</h4><p>So, you already have this logic in your code but, the problem is that <strong>it is implicit</strong>. Here I have to quote Reginald Braithwaite:</p><blockquote>Any sufficiently complicated model class contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of a state machine. — Reginald Braithwaite in <a href="http://raganwald.com/2018/02/23/forde.html">How I Learned to Stop Worrying and ❤️ the State Machine</a>.</blockquote><p>You already implement all kinds of flows in your UI code, and probably you do it by manually handling all the cases and figuring out the edge cases by doing some exploratory testing. This is known as the <em>bottom-up approach</em> and it is the most common approach to developing UIs these days. We attach event listeners to UI components and perform some kind of action inside it. For instance, in vanilla JS you can have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIGHRJ1unWUZ1f6etex4dA.png" /></figure><p>But what about <strong>Redux</strong>? Well, in Redux-like architectures you split the event handlers in reducers, for state management, and effect handlers. This is a great practice and Redux solves the state management problem, but you still have to struggle with the event orchestration one (state transitions).</p><h4>A matter of paradigms</h4><p>The above approaches are known as the <em>event-action paradigm</em>. In this paradigm, when some event happens you fire an action in response to it. The problem with it is that, in order to coordinate the UI, you have to put a lot of conditions inside your event handlers and even worse you may have nested if-else conditionals, switch cases, and so on.</p><p>In Redux you split this up in the reducer and the effect handlers but you still have the same problem. This paradigm makes your code complex and bug-prone. You as a developer have to maintain all those cases in your mind and be careful to not forget something.</p><p>Statecharts use the <em>event-state-action paradigm</em> which is the nature of complex UIs. And you may say, what’s the difference between statecharts and state diagrams. Long story short:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*53oRryc6vQWH7GnWhAW2Aw.png" /></figure><h3>Building a Statechart 🏗</h3><p>There is a notation for building statecharts using XML called <a href="https://www.w3.org/TR/scxml/">SCXML</a>. We are going to use XState, a JavaScript library which has its own notation but implements most of the things of the SCXML spec. Let’s hands-on building our first statechart.</p><h4>State diagram</h4><p><em>A state diagram is built of nodes and edges.</em> A node represents one of the possible <strong>states</strong> of the machine and, an <strong>edge </strong>represents a transition between states. Transitions are dispatched in response to <strong>events</strong> and, very often those are user events.</p><p>So let’s implement a simple on-off statechart:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off%3Fembed%3D1%26file%3Dindex.js&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off%3Ffile%3Dindex.js&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca151868a0a0a860260d2e3714b766eb/href">https://medium.com/media/ca151868a0a0a860260d2e3714b766eb/href</a></iframe><h4>Nested states</h4><p>Let’s make some nested states. Suppose that when our UI is in the <strong>on</strong> state <strong>traffic lights </strong>are visible and the user can click on them.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off-nested-lights%3Fembed%3D1%26file%3Dindex.js&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off-nested-lights%3Ffile%3Dindex.js&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/940146d227f40cbde1339d8659da3241/href">https://medium.com/media/940146d227f40cbde1339d8659da3241/href</a></iframe><h4>Conditions</h4><p>We can make conditional transitions. For example, I want that the user only turns off the machine while it is on the <strong><em>on.green</em></strong> state. For that let&#39;s use the <strong>In Guard</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off-nested-lights-conditional-off%3Fembed%3D1%26file%3Dindex.js&amp;url=https%3A%2F%2Fstackblitz.com%2Fedit%2Fxstate-example-on-off-nested-lights-conditional-off%3Ffile%3Dindex.js&amp;image=https%3A%2F%2Fc.staticblitz.com%2Fassets%2Ficon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=stackblitz" width="745" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/44a0f1f3098dbf1bcabf68eae24287d5/href">https://medium.com/media/44a0f1f3098dbf1bcabf68eae24287d5/href</a></iframe><h3>Conclusion</h3><p>You may be wondering, but in which cases do I need it? Well, let’s start using it for widgets and stateful components.</p><p>So, when you have to orchestrate events (state + network requests + user interaction + anything), <em>remember the </em><strong><em>Statechart</em></strong><em> is your friend</em>.</p><h3>What’s next</h3><p>Next article I ‘ll show how to create a real-world app as well as explaining some good practices and tips for <em>building statecharts</em> for your apps as well as other Statechart features.</p><p>Read the next article in this series: <a href="https://medium.com/@carloslfu/modeling-a-screensaver-with-a-statechart-a-real-use-case-f57301682570">“Modeling a Screensaver with a Statechart, a real use case.”</a></p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3f1eb6d1a97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do not leak your codebase in private projects]]></title>
            <link>https://medium.com/@carloslfu/do-not-leak-your-codebase-in-private-projects-e99cd2f781c6?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/e99cd2f781c6</guid>
            <category><![CDATA[create-react-app]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Wed, 12 Sep 2018 11:24:21 GMT</pubDate>
            <atom:updated>2023-05-16T01:03:19.458Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes tech people forget to disable source-maps in production, especially when using the create-react-app project.</p><p>This might sound too basic, but I’ve looked this mistake so many times in private production projects.</p><h4>TL&amp;DR … not really, this is a very small article</h4><p>The create-react-app build command is not production ready, before publishing your project you should remove source-maps. However, this applies to any private web project, so, be careful and take a look at your production code maybe you are leaking the whole codebase.</p><p>Related issue: <a href="https://github.com/facebook/create-react-app/issues/2005">https://github.com/facebook/create-react-app/issues/2005</a></p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e99cd2f781c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The way I have learned programming]]></title>
            <link>https://medium.com/@carloslfu/the-way-i-have-learned-programming-cc2d18b6e7cc?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc2d18b6e7cc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[learn-to-code]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Sat, 28 Apr 2018 10:40:07 GMT</pubDate>
            <atom:updated>2023-05-16T01:04:04.716Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*O9V_IOjroAh3rMPs8BE6tQ.png" /></figure><p>I have learned programming 16 years ago and right now I continue to learn things every day. By the way, I improved how I learn. Here, I will teach you how is my process after many years of programming and learning many things.</p><p>For me, there are 3 levels of expertise in the field you want to learn.</p><ul><li><strong>Basic</strong> flow and concepts, for this I recommend <strong>videos</strong></li><li><strong>Intermediate level</strong>, for this I recommend <strong>textual tutorials</strong></li><li><strong>Advanced level</strong>, I recommend <strong>technical documentation</strong> and <strong>blog posts</strong> from <strong>experts</strong> in the field</li></ul><h4>Videos 🎥</h4><p>Videos are really nice when you don’t know how or where to click on the screen. I see video tutorials when I don’t know how to do basic things such as using an IDE or the workflow of a specific tool. In these cases, seeing things in the video is insightful.</p><h4>Textual Tutorials 📚</h4><p>If you have learned the basics, you should read and follow textual tutorials. The main advantage is that reading tutorials is <strong>faster</strong> than seeing videos. Also, <strong>you can copy &amp; paste the </strong>example code and try it out by yourself.</p><h4>Technical Documentation and Expert Blog Posts 📎</h4><p>The best tip for being a better programmer is IMO:</p><blockquote>Gain a deeper understanding of the system. <a href="https://medium.com/u/3ba9db42812d">André Staltz</a></blockquote><p>After experimenting and applying the knowledge you learned in textual tutorials you can go ahead and read <strong>technical documentation</strong> that allows you to go deeper in the field.</p><p>Also, you should see for <strong>expert blogs</strong> that help you with advanced concepts and the <strong>best practices</strong>. Follow them and constantly search for new articles.</p><p>And a bonus step …</p><h4>Iterate over and over ➿</h4><p>Once you have an advanced level in a field, starts seeing for specific things or <strong>complementary topics</strong> you feel <strong>uncomfortable</strong> with and start seeing videos, read textual tutorials and so on.</p><p>There is much <strong>amazing knowledge</strong> out there and you can learn a lot if you are curious and disciplined. So I encourage you to <strong>start learning</strong> something you want right now! A paradise of insights and awesomeness are waiting for you behind your screen.</p><p>I would love to read in the comments what is <strong>the way you learn</strong>, so go ahead and write it!</p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc2d18b6e7cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make a P2P connection in 10 minutes]]></title>
            <link>https://medium.com/@carloslfu/make-a-p2p-connection-in-10-minutes-57d9559fd1c?source=rss-a0ff72427672------2</link>
            <guid isPermaLink="false">https://medium.com/p/57d9559fd1c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[peer-to-peer]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[application-development]]></category>
            <dc:creator><![CDATA[Carlos Galarza]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 18:53:44 GMT</pubDate>
            <atom:updated>2023-05-16T01:04:31.852Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*11jozlTJvUXqdEKNDmI6Iw.png" /></figure><p>This is a short guide on how to make a P2P chat. My aim is to give you only a taste if you like I could write a deeper article explaining how all these things work. That said, let&#39;s start.</p><h4>Preparation</h4><p>The only thing you will need is the latest <a href="https://nodejs.org/">NodeJS</a> and your favorite editor, mine is <a href="https://code.visualstudio.com/">Visual Studio Code</a>. Now create a folder for our project, open a command line, initialize an NPM repo with npm init and install some libraries we will need with:</p><pre>npm i --save discovery-swarm dat-swarm-defaults portfinder get-port</pre><p>I will explain what these libraries do later.</p><h4>Our first P2P connection</h4><p>Let&#39;s start by doing a simple P2P connection, thanks to some great libraries from the Node.js community it is too simple:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93545e259e9417e8343ef359079d9ca4/href">https://medium.com/media/93545e259e9417e8343ef359079d9ca4/href</a></iframe><p>Run this code in two consoles and this is it!. Now you can run it in other devices right in your LAN and should work even without internet, also you can share and run this script in any other computer with internet, it just works, so nice!</p><h4>What’s is next?</h4><p>We will build a P2P chat for our long term project using this code. The chat will have end-to-end encryption and can verify messages.</p><p><em>Make a P2P chat in 10 minutes (Soon …)</em></p><p>I love feedback, ask me questions, comment on your experience with P2P technologies and share your ideas!</p><p>This series is possible thanks to the awesome tools delivered by the <a href="https://datproject.org/">DatProject</a>, <a href="https://webtorrent.io/">Webtorrent</a> and the NodeJS community.</p><p>This article is part of a medium-term project you can find here:</p><p><a href="https://medium.com/p/25a008aa443d"><strong>Create a P2P Real-Time Game App</strong></a></p><p>If you have any questions, please ask them in the comments, I would love to help!</p><p>If you are having process problems, facing hard technical decisions, or struggling with hard tech stuff, I offer tailored help for companies as a Fractional CTO or consultant. DM me on <a href="https://twitter.com/carloslfu">Twitter</a> if you are interested, or follow me, I usually publish interesting tech/software/maker stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57d9559fd1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>