<?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[Paulo Casaretto Software Developer - Medium]]></title>
        <description><![CDATA[Thoughts from my life as a software developer - Medium]]></description>
        <link>https://medium.com/paulo-casaretto-software-developer?source=rss----82402d69dc27---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Paulo Casaretto Software Developer - Medium</title>
            <link>https://medium.com/paulo-casaretto-software-developer?source=rss----82402d69dc27---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:11:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/paulo-casaretto-software-developer" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Case for Descriptive Application Names: Clarity and Cohesion for the Long Haul]]></title>
            <link>https://medium.com/paulo-casaretto-software-developer/the-case-for-descriptive-application-names-clarity-and-cohesion-for-the-long-haul-b81fe8d578f0?source=rss----82402d69dc27---4</link>
            <guid isPermaLink="false">https://medium.com/p/b81fe8d578f0</guid>
            <dc:creator><![CDATA[Paulo Luis Franchini Casaretto]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 15:08:39 GMT</pubDate>
            <atom:updated>2023-04-12T14:23:09.809Z</atom:updated>
            <content:encoded><![CDATA[<p>As our organization grows in size and the number of developers, and as we accelerate towards a service-oriented architecture, the number of applications we create will inevitably increase. Implementing rules for naming applications can significantly enhance cohesion with minimal effort.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x78dJgCLt4VyhsNNC26shg.png" /></figure><p>In response to a recent <a href="https://ntietz.com/blog/name-your-projects-cutesy-things/">blog post by Nicholas Tietz-Sokolsky</a> advocating for cute and memorable names, I respectfully present an alternative perspective: the benefits of descriptive application names. While creative and cute names can bring an element of fun to the workplace, there are several compelling reasons to choose descriptive names for our applications.</p><h3>Why Descriptive Names Matter</h3><h4>Inclusivity</h4><p>Creative names may require the reader to have additional context, many times cultural. For instance, not everyone is a Minecraft player who would know what a “minecart” project is about. Even though I am white, I have zero knowledge of Norse mythology, and the name “hod” does not carry any meaning to me. I imagine this is worse for people with different backgrounds. This can lead to alienation, reinforced silos, and difficulties when collaborating with other professionals like designers and product managers.</p><h4>Meaning drift</h4><p>Descriptive names act as an “anchor,” stimulating productive discussions about a project’s purpose and helping to prevent bloat. By contrast, because cute names are much too broad, they allow the underlying project to drift or worse, accumulate responsibilities.</p><h4>Cognitive load</h4><p>Creative names may increase cognitive load. For example, developers of a hypothetical API named “Hawkeye” might understand that it’s used for pinpointing anomalies in time series, but others would require further explanation. A more descriptive name like “anomaly-detection-api” could provide immediate clarity.</p><h4>Scalability</h4><p>As the number of applications and services increases within an organization, having descriptive names helps new team members quickly understand the purpose of each component. This can lead to more efficient onboarding and greater ease in maintaining a growing codebase.</p><h4>Consistency</h4><p>Adopting a consistent naming convention makes it easier to identify related services and applications. This can facilitate better organization and collaboration across teams.</p><h3>Finding Fun Beyond Cute Names</h3><p>While the appeal of cute names lies in their ability to bring a sense of fun and whimsy to the workplace, it’s essential to remember that there are other ways to have fun and foster a positive atmosphere.</p><ul><li>Team building and collaboration: Encouraging open communication, celebrating milestones, and organizing team-building activities can help create a sense of camaraderie and fun among team members.</li><li>Tackling challenges: Often, the greatest fun can be found in overcoming obstacles and solving complex problems. Cultivating a culture of learning and experimentation can lead to a more engaged and motivated workforce.</li><li>Customer success: Ultimately, the most rewarding aspect of our work is helping our customers achieve their goals. By focusing on delivering value and ensuring customer satisfaction, we can take pride in our work and find enjoyment in our customers’ success.</li></ul><p>While creative and cute names can bring an element of fun to the workplace, the advantages of descriptive names, such as inclusivity, preventing meaning drift, reducing cognitive load, promoting scalability, and ensuring consistency, make them a more effective choice for application naming conventions.</p><p>By considering descriptive application names, we can keep a clear focus on our primary goal: creating products and services that enable our customers to succeed. Fostering an environment of collaboration, problem-solving, and customer-centricity can help us find fun and fulfillment in our work while maintaining a sense of clarity and cohesion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b81fe8d578f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paulo-casaretto-software-developer/the-case-for-descriptive-application-names-clarity-and-cohesion-for-the-long-haul-b81fe8d578f0">The Case for Descriptive Application Names: Clarity and Cohesion for the Long Haul</a> was originally published in <a href="https://medium.com/paulo-casaretto-software-developer">Paulo Casaretto Software Developer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caching is an orthogonal responsibility]]></title>
            <link>https://medium.com/paulo-casaretto-software-developer/caching-is-an-orthogonal-responsibility-6356ee612419?source=rss----82402d69dc27---4</link>
            <guid isPermaLink="false">https://medium.com/p/6356ee612419</guid>
            <category><![CDATA[orthogonal]]></category>
            <category><![CDATA[single-responsibility]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Paulo Luis Franchini Casaretto]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 16:39:29 GMT</pubDate>
            <atom:updated>2020-02-20T16:39:29.815Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m writing this post to share something I’ve come to realize about caching in terms of software design. This might seem pretty obvious to some, and it certainly feels this way to me now, but I decided to write it anyhow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwcNvtwNHTeRx0JeM4euJQ.jpeg" /></figure><p>Caching an expensive operation is a common strategy to squeeze out performance from a program. From a code organisation perspective, it’s easy to pollute the original code with caching instructions. I’ve found that <strong>caching is always an orthogonal responsibility</strong> when comparing it to the main responsibility of the module and using composition we can design better components.</p><p>(If you are unfamiliar with the term, I’m writing a post on what orthogonality means in software design. Promise i’ll come soon.)</p><p>Let’s compare two simple strategies for adding caching to an existing code.</p><pre>type Client struct {<br>}<br><br>func (c *Client) Fetch(s string) string {<br>        return expensiveOperation()<br>}</pre><p>First, the naive version.</p><pre>type Client struct {<br>	cache map[string][string]<br>}<br><br>func (c *Client) Fetch(s string) string {<br>	if cached, ok := cache[s]; !ok {<br>		cache[s] = expensiveOperation() <br>	}<br>	return cache[s]<br>}</pre><p>Now, let’s compare with a version where we introduce an interface and add caching capabilities trough composition.</p><pre>type Fetcher interface {<br>	Fetch() string<br>}<br><br>type Client struct {<br>}<br><br>func (c *Client) Fetch(s) string {<br>	expensiveOperation()<br>}<br><br>type CachingClient struct {<br>	cache map[string][string]<br>	client Fetcher<br>}<br><br>func (c *CachingClient) Fetch(s) string {<br>	if cached, ok := cache[s]; !ok {<br>		cache[s] = c.Client.Fetch() <br>	}<br>	return cache[s]<br>}</pre><p>Comparing the two versions, we immediately see some obvious disadvantages:</p><ul><li>More code</li><li>Two additional types</li><li>Necessity for boilerplate code to initialise the complete functional client</li></ul><p>Now let’s analyse what we gained:</p><p>The introduction of an interface type adds flexibility to system. The upper levels of the code can depend on the interface instead of a specific implementation. We take advantage of this flexibility to introduce a Fetcher that decorates any other Fetcher, not just this specific one. Because the two are now independent, they are now compose-able and therefore easier to reuse and to test. To sum it up:</p><ul><li>Flexibility</li><li>Inversion of dependencies</li><li>Compose-ability</li><li>Simplification of testing</li></ul><p>The tradeoff is pretty clear and the final decision depends on your specific context.</p><p>While this post focus on caching, we can apply the same pattern on a number of different scenarios to obtain flexible and compose-able modules. We just have to <strong>identify the orthogonal responsibility</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6356ee612419" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paulo-casaretto-software-developer/caching-is-an-orthogonal-responsibility-6356ee612419">Caching is an orthogonal responsibility</a> was originally published in <a href="https://medium.com/paulo-casaretto-software-developer">Paulo Casaretto Software Developer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[git checkout is out, git restore and switch are in]]></title>
            <link>https://medium.com/paulo-casaretto-software-developer/git-checkout-is-out-git-restore-and-switch-are-in-c6ef9fb2123f?source=rss----82402d69dc27---4</link>
            <guid isPermaLink="false">https://medium.com/p/c6ef9fb2123f</guid>
            <category><![CDATA[simplicity]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Paulo Luis Franchini Casaretto]]></dc:creator>
            <pubDate>Tue, 21 Jan 2020 02:30:33 GMT</pubDate>
            <atom:updated>2020-01-21T02:30:33.624Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMtK-Tj38n6kgAYsj4LREw.jpeg" /></figure><p>Git version 2.23 introduced two experimental new commands to help with the confusion around the checkout command.</p><p>Can you answer without any more context what does alpha mean in the following snippet?</p><pre>git checkout alpha</pre><p>Is it a branch or a file? It might be both. If it is a branch, git will <strong>switch</strong> to that branch. If it is a file, git will <strong>restore</strong> its contents to HEAD.</p><p>Immediately we see the two new commands make a lot of sense.</p><p><a href="https://git-scm.com/docs/git-switch/2.23.0">switch</a> is focused on switching branches (or refs in general).</p><p>examples:</p><pre>git switch master                    # take me home<br>git switch -                         # take me back (last branch)<br>git switch -c topic                  # create and switch to &quot;topic&quot;</pre><p><a href="https://git-scm.com/docs/git-restore">restore</a> is about bringing content from other branches to the current workspace</p><p>examples:</p><pre>git restore .                           # throw away all my changes</pre><pre>git restore --source master~2 Makefile  # restore Makefile to the second commit from master</pre><pre>git restore --staged hello.c            # remove hello.c from the staging area</pre><p>The new commands are much clearer and are certainly a movement towards <a href="https://medium.com/paulo-casaretto-software-developer/inheritance-a-case-study-on-easy-versus-simple-e4e526476c77">simple vs eas</a>y. There are more commands, but there is less overlap between them.</p><p>Way to go git! Now there’s just the matter of retraining years of muscle memory 😅.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6ef9fb2123f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paulo-casaretto-software-developer/git-checkout-is-out-git-restore-and-switch-are-in-c6ef9fb2123f">git checkout is out, git restore and switch are in</a> was originally published in <a href="https://medium.com/paulo-casaretto-software-developer">Paulo Casaretto Software Developer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inheritance: A case study on easy versus simple]]></title>
            <link>https://medium.com/paulo-casaretto-software-developer/inheritance-a-case-study-on-easy-versus-simple-e4e526476c77?source=rss----82402d69dc27---4</link>
            <guid isPermaLink="false">https://medium.com/p/e4e526476c77</guid>
            <category><![CDATA[simple]]></category>
            <category><![CDATA[easy]]></category>
            <category><![CDATA[inheritance]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[composition]]></category>
            <dc:creator><![CDATA[Paulo Luis Franchini Casaretto]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 10:01:01 GMT</pubDate>
            <atom:updated>2019-03-07T10:01:00.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Rich Hickey, creator of Clojure, delivered a <a href="https://www.infoq.com/presentations/Simple-Made-Easy">great talk where he discusses the meanings of <strong>easy</strong> vs <strong>simple</strong></a> from a software development point of view. I urge you to watch it before reading this, but just in case you decide to do it later I’ll try to introduce the concepts.</p><p>Rich presents <strong>easy</strong> as something that is <em>within reach</em>, available, familiar. Where <strong>simple</strong> is defined as <em>not complex</em>, that is, something that is not entwined with different concepts.</p><p>Coming from an Object Oriented world, I find <strong>inheritance</strong> and subclassing to be very <strong>easy</strong>. Inheritance is advocated as one of the core constructs of the Object Oriented paradigm. It is how we learn to share implementations of behavior and provide type information to satisfy Polymorphism. However, I’ve come to realize that is also not <strong>simple</strong>.</p><p>Please bear with me as I fabricate an example to illustrate why I think this is true. I’m focusing on one bad aspect of inheritance and won’t even touch the “is a” problem (read up on the Liskov Substitution Principle if you’re interested).</p><p>Let’s imagine you are implementing an email sending module. Our first iteration (using Ruby) might look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/283159401798104391da0329067024e4/href">https://medium.com/media/283159401798104391da0329067024e4/href</a></iframe><p>Great, huh? This is <strong>simple</strong>. This class does one thing and one thing only.</p><p>Soon enough we have a new requirement. Marketing wants us to use different email servers when sending different types of emails. The code that uses our modules must be able to specify which implementation it wants to use. One possible solution to this problem:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7fbf10dc6323e2f2f626cbf095960c1/href">https://medium.com/media/f7fbf10dc6323e2f2f626cbf095960c1/href</a></iframe><p>This looks OK. Inheritance allowed us to share in the behavior of the parent class. The DRY gods are pleased.</p><p>Guess what? A new requirement comes along. Now, for our Transactional mails we’d also like to block email sending if the user’s subscription has expired. Oh, and operations wants us to log every time an email gets sent. Easy enough right?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/00ff518b2425dd44b0c8dc8bf378bdeb/href">https://medium.com/media/00ff518b2425dd44b0c8dc8bf378bdeb/href</a></iframe><p>This is starting to smell funny. Why does the blocking feature needs to know about the existence of the logging code? It could have been the other way around or we could have introduced them as separate concepts. But then, how do you combine them again?</p><p>Because of GDPR pressure, we need to add a data export feature that emails the user their data. <strong>This is true whether their subscription is valid or not</strong>.</p><p>…</p><p>Well, we could introduce a branch in the hierarchy that does not include the block checking feature, but can you see where that leads us? We’ll end up with an explosion of n² classes where n is the number of features. We’ll have a `BlockingLoggingTransactionalMailer` and `LoggingTransactionalMailer` and `BlockingTransactionalMailer`. Imagine keeping track and unit testing all the different combinations. Imagine trying to introduce a change in the base implementation, that is, changing the actual method we use to send emails. That would have a ripple effect on the entire chain.</p><p>So what’s the problem here? Inheritance made our lives initially <strong>easy</strong> but because it <strong>complects</strong> <em>code reuse</em> with <em>hierarchy</em> we eventually reached that very familiar point where the code hampers future developments and slows us down.</p><p>Now, let’s look at an alternative:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ddb7bcf6eea9fcc474830bf6301de5ea/href">https://medium.com/media/ddb7bcf6eea9fcc474830bf6301de5ea/href</a></iframe><p>This alternative used composition to achieve the same result without any of the aforementioned problems. Note I’m not saying this is the best code ever. For example, this chain model is very frail. If any non essential <em>middleware</em> raises an exception it would break the entire chain.</p><p>But as I can tell by the way you’re twisting your nose at it, it’s not <strong>easy</strong>. I can hear you saying “Really? Do I need to instantiate all those classes every time I need to send an email?”. Yes, we could work around that but the fact is that there are <strong>more things</strong> now to deal with. The <strong>cardinality</strong> of the system has increased. But as Rich puts it, <strong>simplicity</strong> does not relate to cardinality. We have more things now but they are no longer entwined.</p><p><strong>Simple</strong> but definitely not <strong>easy</strong>.</p><p>Does that imply a trade-off? I don’t think so. Go decided to eschew inheritance but introduced <a href="https://golang.org/doc/effective_go.html#embedding">embedding</a> to facilitate (make <strong>easy</strong>) the reuse of code. Together with interfaces I think it solves the problem really well and I like the <a href="https://www.youtube.com/watch?v=LJvEIjRBSDA">song goes</a> “I don’t remember why I ever once subclassed”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCHldmjXJhRMkqDQw1aH_g.jpeg" /></figure><p>In short:</p><p>Inheritance is <strong>easy</strong> but not <strong>simple.</strong></p><p>Composition can be <strong>simple</strong>, but often it is not <strong>easy</strong>.</p><p>We as developers have the power to <strong>make simple easier</strong>.</p><p>Thanks for reading this far, please leave a comment with your thoughts on the subject.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e526476c77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paulo-casaretto-software-developer/inheritance-a-case-study-on-easy-versus-simple-e4e526476c77">Inheritance: A case study on easy versus simple</a> was originally published in <a href="https://medium.com/paulo-casaretto-software-developer">Paulo Casaretto Software Developer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>