<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marco Davalos</title>
    <description>The latest articles on DEV Community by Marco Davalos (@serbixote).</description>
    <link>https://dev.to/serbixote</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F15913%2F22d63e23-e148-437e-beba-a4e84d815f2b.png</url>
      <title>DEV Community: Marco Davalos</title>
      <link>https://dev.to/serbixote</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/serbixote"/>
    <language>en</language>
    <item>
      <title>5 Essential Principles for Highly Productive Developers</title>
      <dc:creator>Marco Davalos</dc:creator>
      <pubDate>Mon, 23 Dec 2024 20:34:10 +0000</pubDate>
      <link>https://dev.to/serbixote/5-essential-principles-for-highly-productive-developers-2o5j</link>
      <guid>https://dev.to/serbixote/5-essential-principles-for-highly-productive-developers-2o5j</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjakmis44yw730g7jjk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhjakmis44yw730g7jjk0.png" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is clear that seniority is not only about how skilled a developer is in a language or framework. It's about how our way of thinking changes through the experience. As a result, we make ours principles that are essential to us. After +10 years in the industry, here are some of principles I believe (IMHO) a developer needs to follow in order to become a highly productive one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Measure Twice, Cut Once
&lt;/h3&gt;

&lt;p&gt;Making sure you're on the right page, and aligned with your team, and other teams involved is a must to avoid: wasting time, money, as well as unnecessary awkward situations.&lt;/p&gt;

&lt;p&gt;The time we spend investigating, evaluating the implications of our approach will be reflected in the quality of the code we write. It will be always faster to iterate your approach with your team, or in your head before you start, than to do it in the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  KISS (Keep It Simple Stupid)
&lt;/h3&gt;

&lt;p&gt;It is easy to write code that adds complexity when solving an already complex problem. This will make the code harder to review, test, and maintain. Complexity can be added by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;implementing unnecessary complex design patterns&lt;/li&gt;
&lt;li&gt;adding a newer or better library without a valid reason&lt;/li&gt;
&lt;li&gt;creating unnecessary abstraction&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common sense should be our guide, leaving our ego out of the equation. Your future self will thank you for it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Least Privilege Principle
&lt;/h3&gt;

&lt;p&gt;Asking for access to environments, repositories, secrets, etc. in order to accomplish your task might be tedious, especially in big companies that have slow processes. Sometimes less experienced developers can even take this personal as a sign of lack of trust.&lt;/p&gt;

&lt;p&gt;Permissions always come with a responsibility, but also with a risk. The less privileges you have, the less damage someone who got access to your account can do. Trust me, you don't want to be the one who created a data breach in your company.&lt;/p&gt;

&lt;h3&gt;
  
  
  YAGNI (You Aren't Gonna Need It)
&lt;/h3&gt;

&lt;p&gt;The temptation of adding additional functionality while working a new feature or fixing a bug will always exist.&lt;/p&gt;

&lt;p&gt;However, more functionality also means more time, and most importantly: more chances of introducing new bugs. The later will translate to more time, and can also end up damaging the business side of the company.&lt;/p&gt;

&lt;h2&gt;
  
  
  No Hello
&lt;/h2&gt;

&lt;p&gt;This is not a principle, but a good practice in team communication. Slack fatigue is real, so the fewer messages you send, the better.&lt;/p&gt;

&lt;p&gt;Hence, don't start a conversation only with "Hello", "Hi", "How are you?", etc. Add your question or topic to the very first message to avoid unnecessary context switching for the other person. &lt;a href="https://nohello.net/" rel="noopener noreferrer"&gt;https://nohello.net/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Every developer might have their own principles, but no principle, or good practice is gonna make any difference if you don't know: how to work in a team, how to properly communicate, or how to properly handle/give feedback.&lt;/p&gt;

&lt;p&gt;Soft skills, and being a good-honest person is the base of every highly productive developer.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>beginners</category>
      <category>career</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Merge Faster to Ship Faster ⚡</title>
      <dc:creator>Marco Davalos</dc:creator>
      <pubDate>Mon, 25 Nov 2024 23:12:54 +0000</pubDate>
      <link>https://dev.to/serbixote/automate-pull-request-sharing-from-github-to-slack-4dij</link>
      <guid>https://dev.to/serbixote/automate-pull-request-sharing-from-github-to-slack-4dij</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;Software Engineering teams often share manually their Pull Requests to a Slack channel seeking a code review. This would not only speed up the review process but also &lt;strong&gt;boost productivity, increase team collaboration work visibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A year ago I got tired of copy pasting the PR info into Slack, and not being able to see its status with a quick look. prbot was born as a Hackathon to solve this issue. It ended up being used and loved by most of engineers at work.&lt;/p&gt;

&lt;p&gt;I really enjoyed working on it so I decided to improve it and make it a product to keep coding cool and useful features around it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Product
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://prbot.app?utm_source=devto" rel="noopener noreferrer"&gt;https://prbot.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even though the initial idea was simple, it kept evolving to what it is now:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpi7pwflq9p9z4gbc4wm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhpi7pwflq9p9z4gbc4wm.gif" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Today's &lt;a href="https://prbot.app?utm_source=devto" rel="noopener noreferrer"&gt;prbot&lt;/a&gt; mission is to &lt;strong&gt;enhance and speed up code review process&lt;/strong&gt;, by automating Pull Request sharing, keep them in sync, and much more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Automatic Slack message&lt;/li&gt;
&lt;li&gt;Synced Pull Request Status&lt;/li&gt;
&lt;li&gt;Synced Reviews Status&lt;/li&gt;
&lt;li&gt;Multiple Channel Support&lt;/li&gt;
&lt;li&gt;Customizable Message Format&lt;/li&gt;
&lt;li&gt;Advanced Settings&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;Your config is a yaml file that you can put anywhere.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;slack&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;defaultChannelID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;00000000000"&lt;/span&gt;

  &lt;span class="na"&gt;repositories&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;channelID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;00000000000"&lt;/span&gt;
    &lt;span class="na"&gt;front-end&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;channelID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;00000000000"&lt;/span&gt;

  &lt;span class="na"&gt;messageFormat&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;showSizeEmoji&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;I'm exited about the upcoming features like reminders, codeowners suppot, Microsoft Teams support, etc. However, they won't matter if you won't use it so I would love to know the features you would like to see in the prbot next releases.&lt;/p&gt;

&lt;p&gt;How's your code review workflow? Tell me about it!&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>github</category>
      <category>devops</category>
      <category>codereview</category>
    </item>
    <item>
      <title>How To Organize Golang Cloud Functions Code</title>
      <dc:creator>Marco Davalos</dc:creator>
      <pubDate>Mon, 07 Dec 2020 15:21:43 +0000</pubDate>
      <link>https://dev.to/serbixote/how-to-organize-golang-cloud-functions-code-11k2</link>
      <guid>https://dev.to/serbixote/how-to-organize-golang-cloud-functions-code-11k2</guid>
      <description>&lt;p&gt;On our journey to build the next billion dollar app, we decided to use Cloud Functions to write the backend logic in Golang. So thinking about how the hell we were gonna organize the code, was one of the first things we went through.&lt;/p&gt;

&lt;p&gt;The only thing we knew for sure, was that we wanted all code in a single repository, in order to speed up the development velocity.&lt;/p&gt;

&lt;p&gt;This is what we came up with:&lt;/p&gt;

&lt;h2&gt;
  
  
  A Go module per function
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
└── functions
    ├── awesome
    │   ├── awesome.go
    │   ├── go.mod
    │   └── go.sum
    └── marvelous
        ├── marvelous.go
        ├── go.mod
        └── go.sum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having a Go module per function enables every function to manage its dependencies independently.&lt;/p&gt;

&lt;p&gt;This avoids annoyances like making other functions stick to an older package version, or breaking other functions by upgrading major versions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Relative imports
&lt;/h2&gt;

&lt;p&gt;However, there's shared logic between functions that needs to be in common packages, and not having the functions within the same module makes it tricky to use them from the functions code.&lt;/p&gt;

&lt;p&gt;Here's where the &lt;code&gt;replace&lt;/code&gt; directive comes to the rescue, allowing us point an import path to another module located in VCS (GitHub or elsewhere), or on the local filesystem with a relative or absolute file path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;module&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;functions&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;marvelous&lt;/span&gt;

&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="m"&gt;1.13&lt;/span&gt;

&lt;span class="n"&gt;replace&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;functions&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pkg&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;../../&lt;/span&gt;&lt;span class="n"&gt;pkg&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── functions
│   ├── awesome
│   │   ├── awesome.go
│   │   ├── go.mod
│   │   └── go.sum
│   └── marvelous
│       ├── marvelous.go
│       ├── go.mod
│       └── go.sum
└── pkg
    ├── compliments
    │   └── compliments.go
    └── go.mod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;marvelous&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt;
    &lt;span class="s"&gt;"github.com/example/compliments"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;CallMeMarvelous&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;compliments&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Say&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"marvelous"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Fprint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Vendor directory
&lt;/h2&gt;

&lt;p&gt;Even though for development purposes this will work just fine, when the time to deploy the function comes, this won't cut it.&lt;/p&gt;

&lt;p&gt;Executing &lt;code&gt;gcloud functions deploy&lt;/code&gt; from the function directory, won't upload the &lt;code&gt;pkg&lt;/code&gt; directory since it's located in a higher level, causing the above error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OperationError: code=13, message=Build failed: go: github.com/example/functions/pkg@v0.0.0-00010101000000-000000000000: parsing /pkg/go.mod: open /pkg/go.mod: no such file or directory; Error ID: 03a1e2f7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To avoid this we create the vendor directory before deploying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go mod vendor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and a &lt;code&gt;.gcloudignore&lt;/code&gt; file, to use the vendor approach by not uploading the &lt;code&gt;go.mod&lt;/code&gt; and &lt;code&gt;go.sum&lt;/code&gt; files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go.mod
go.sum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now all the function needs is to be built and run is within the directory. Additionally the &lt;code&gt;**/vendor&lt;/code&gt; path can be added to the root &lt;code&gt;.gitignore&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We are not Golang experts and it might not be a perfect approach, but it's the most elegant we found so far.&lt;/p&gt;

</description>
      <category>go</category>
      <category>serverless</category>
      <category>devops</category>
      <category>googlecloud</category>
    </item>
  </channel>
</rss>
