<?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: Eduardo Ribeiro</title>
    <description>The latest articles on DEV Community by Eduardo Ribeiro (@eduardocribeiro).</description>
    <link>https://dev.to/eduardocribeiro</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%2F477973%2F98f1be96-c0b2-435b-b77d-0728ead3a1a0.jpeg</url>
      <title>DEV Community: Eduardo Ribeiro</title>
      <link>https://dev.to/eduardocribeiro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eduardocribeiro"/>
    <language>en</language>
    <item>
      <title>What tech/programming communities are you in?</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 18 Apr 2021 10:25:37 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/what-tech-programming-communities-are-you-in-22o7</link>
      <guid>https://dev.to/eduardocribeiro/what-tech-programming-communities-are-you-in-22o7</guid>
      <description>&lt;p&gt;If you plan on following a career in software engineering, and if you want to learn more and get better every day, it is essential to not go at it alone. Having a group of people with the same interests, ambitions, and goals as you, will not only help you progress a lot faster by interacting and learning with people above your level, but it will also provide you an opportunity to give back to the community. That is why I started blogging and being active on &lt;a href="https://dev.to/"&gt;dev.to&lt;/a&gt; ;)&lt;/p&gt;

&lt;p&gt;I am interested in knowing more about some online communities related to &lt;strong&gt;tech blogging&lt;/strong&gt;, and also &lt;strong&gt;programming&lt;/strong&gt; in general: Discord servers, Facebook groups, etc.&lt;/p&gt;

&lt;p&gt;Are you active in any community? Please let me know in the comments!&lt;/p&gt;

&lt;p&gt;Have a nice day! :)&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>communities</category>
      <category>tech</category>
    </item>
    <item>
      <title>How to get updates from a server in real-time?</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 11 Apr 2021 17:29:31 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/how-to-get-updates-from-a-server-in-real-time-1elp</link>
      <guid>https://dev.to/eduardocribeiro/how-to-get-updates-from-a-server-in-real-time-1elp</guid>
      <description>&lt;p&gt;With the increase of complexity and the overall evolution of new systems and applications, communication between entities is no longer just the client making requests to a server. There are many situations that require the server to inform the clients of certain events, and in some cases that information might even be needed in real-time, with little to no delay. &lt;/p&gt;

&lt;p&gt;Here are some examples of use cases that need real-time communication of updates, from the server to the client:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Messaging Apps.&lt;/strong&gt; Messaging applications let the user send messages to other users, and receive messages in real-time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stock Charting Platforms.&lt;/strong&gt; Applications that keep track of stock prices need to send events to the client-side in real-time, so the latest stock updates can be displayed in a web application, for example.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiplayer Games.&lt;/strong&gt; Online game servers need a way of sending to each user information about other users that are playing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process is not always easy, especially when the system needs to manage a large number of clients, which increases the importance of some concepts like scalability. Let's check out some ways of implementing real-time communication from a server to clients.&lt;/p&gt;

&lt;h1&gt;
  
  
  HTTP Polling
&lt;/h1&gt;

&lt;p&gt;Nowadays, the standard for client-server communication on the web is through the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP" rel="noopener noreferrer"&gt;HTTP&lt;/a&gt; protocol. The process is simple: the client starts the request, initiates the communication with the server, and asks it to either return some information or perform a certain action. When the server receives the request, it parses its content and returns a response to the client.&lt;/p&gt;

&lt;p&gt;This process is appropriate for communication between systems, &lt;em&gt;when that communication is started by the client&lt;/em&gt;. What if the communication needs to be started by the server, to give an update to the client?&lt;/p&gt;

&lt;p&gt;It turns out we can in fact use HTTP requests to get updates from a server, using &lt;strong&gt;HTTP Polling&lt;/strong&gt;. HTTP Polling consists of the client issuing an HTTP request to the server, asking if the server has any updates for it. If it doesn't, the server returns an empty response. If the server does in fact have something to give to the client, the client receives it as the response from its HTTP request. The client will continue to issue HTTP requests periodically, following a time interval, with the intent of collecting the most up-to-date information the server might have for it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fpkpsb2nws65gup78i8na.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fpkpsb2nws65gup78i8na.png" alt="HTTP Polling Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This approach is not very efficient, and has some heavy disadvantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wastes resources.&lt;/strong&gt; Especially if the server updates are sparse, it can happen that the majority of requests made by the client are returned empty. Therefore, there is a large number of requests that are essentially useless and are just wasting resources. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can have a large delay.&lt;/strong&gt; Depending on the time interval used by the client to make requests, the information received from the server might not be the most up-to-date, and messages might be received with a delay basically as big as the time interval.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  HTTP Long Polling
&lt;/h1&gt;

&lt;p&gt;Another solution that also uses HTTP requests and that solves some downsides of HTTP Polling is &lt;a href="https://www.pubnub.com/blog/http-long-polling/" rel="noopener noreferrer"&gt;HTTP Long Polling&lt;/a&gt;.&lt;br&gt;
The difference in this approach is that after an HTTP request from the client, the server &lt;strong&gt;saves and holds that request&lt;/strong&gt; until there is an update to be transmitted to the client. When that happens, the response is sent back to the client, and the client issues another request to the server, that will only return when the server generates the next update.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fm3t9cgugn343evss8meo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fm3t9cgugn343evss8meo.png" alt="HTTP Long Polling Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The disadvantages of HTTP Polling are somewhat mitigated. The overhead of issuing periodic HTTP requests is reduced by the server holding the requests and only returning if there are new updates. The message delays are also taken care of, because as soon as an update is generated, the server will respond to the currently stored request. So HTTP Long Polling can be used to implement real-time communication.&lt;/p&gt;

&lt;p&gt;However, it still has some downsides, mainly when it comes to scalability. The server &lt;strong&gt;needs to store connections for every client&lt;/strong&gt; that wishes to receive real-time updates, and if the number of users is large, that can be a problem. If the server events occur very frequently, then the number of HTTP requests from clients increases a lot.&lt;br&gt;
Another problem is the need for a mechanism that prevents requests to be stored in the server indefinitely. It must be configured in a way so that connections do not stay alive permanently. This can be done with the use of &lt;strong&gt;connection timeouts&lt;/strong&gt;, for example: after a certain amount of time, the server stops holding the request and sends back an empty response. It is then up to the client to issue a new request.&lt;/p&gt;

&lt;h1&gt;
  
  
  WebSockets
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.websocket.org/" rel="noopener noreferrer"&gt;WebSocket&lt;/a&gt; is a standardized communication protocol that provides full-duplex communication (meaning that data can go both ways) over a single TCP connection. It enables &lt;strong&gt;2-way communication between a web browser and a web server&lt;/strong&gt; with lower latency than polling, by setting up a &lt;strong&gt;permanent connection between both&lt;/strong&gt; and allowing information to be sent in both directions. Both are capable of sending messages anytime. The connection stays open until any of the two explicitly finishes it.&lt;/p&gt;

&lt;p&gt;Unlike HTTP Polling or Long Polling, by having a WebSocket connection between a client and a server we can have the server issue updates to the client without it being first requested by the latter.&lt;/p&gt;

&lt;p&gt;WebSocket is distinct from HTTP, however it uses HTTP initially to setup the connection between the client and the server. That HTTP connection is then upgraded to a full-duplex permanent WebSocket connection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fldyme92l24l7jq9bxm7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fldyme92l24l7jq9bxm7g.png" alt="Websocket Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of applications that need real-time communication are using WebSockets, from online games like &lt;a href="https://agar.io/" rel="noopener noreferrer"&gt;agar.io&lt;/a&gt; to messaging apps like &lt;a href="https://slack.com/" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The main advantages of using WebSockets are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It is part of the HTML5 specification.&lt;/strong&gt; Basically all modern browsers support the use of WebSockets.&lt;/li&gt;
&lt;li&gt;It is &lt;strong&gt;full-duplex&lt;/strong&gt;, so not only the server can send messages to the client, but the other way around can happen too. In contrast, the other solutions that we saw until now are only half-duplex, because the process needed to be started by the client.&lt;/li&gt;
&lt;li&gt;WebSockets are &lt;strong&gt;not blocked by firewalls and traverse proxies&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It allows the implementation of other protocols and technologies on top of it, like &lt;strong&gt;Publish &amp;amp; Subscribe&lt;/strong&gt; (which we will see next).&lt;/li&gt;
&lt;li&gt;It eliminates latency problems that may arise from Long Polling, especially if the server generates a lot of updates. There is only one permanent connection between each client and the server, with no need to issue requests and responses back and forth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, some downsides may still be visible in some systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It may still be hard to scale on the server-side, because it will need to handle one open connection for each client.&lt;/li&gt;
&lt;li&gt;Now the client will also have an open connection at all times, and in less powerful devices that can be a problem (example: battery management on phones or IoT devices).&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Publish &amp;amp; Subscribe (Server-Sent Events)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/pubsub/docs/overview" rel="noopener noreferrer"&gt;Publish-Subscribe&lt;/a&gt; is a messaging pattern in which the entities involved can be classified as either &lt;strong&gt;publishers&lt;/strong&gt; or &lt;strong&gt;subscribers&lt;/strong&gt;. Subscribers show interest in certain types of messages. Publishers produce updates and events and, when a certain message needs to be sent, they will send it to everyone who subscribed to that type of message.&lt;br&gt;
Using this pattern, the publishers do not send the message explicitly to each subscriber, but instead classify the messages according to their type and send it to one or more data streams called &lt;strong&gt;channels&lt;/strong&gt; or &lt;strong&gt;topics&lt;/strong&gt;. This way, each publisher has no information about who are the subscribers (if any) that will receive the published message. Similarly, each subscriber is not aware of which publishers (if any) there are; they subscribe to channels/topics of interest, so they can be notified when a new message has been published by a publisher.&lt;/p&gt;

&lt;p&gt;By using this pattern, publishers and subscribers are decoupled and do not communicate directly, only through channels. This way, each publisher does not need to maintain a connection with all the subscribers, and only needs to care about sending messages to the channel. Similarly, each subscriber only needs to listen to the channels of interest in order to get the latest updates.&lt;/p&gt;

&lt;p&gt;In practice, there is often an intermediary layer called a &lt;strong&gt;message broker&lt;/strong&gt;, that handles the distribution and filtering of the messages. Some popular message broker technologies are &lt;a href="https://www.rabbitmq.com/" rel="noopener noreferrer"&gt;RabbitMQ&lt;/a&gt;, &lt;a href="https://kafka.apache.org/" rel="noopener noreferrer"&gt;Apache Kafka&lt;/a&gt;, and the &lt;a href="https://aws.amazon.com/pt/amazon-mq/" rel="noopener noreferrer"&gt;AWS Amazon MQ&lt;/a&gt;. However, not every message broker is designed for real-time communication; some of them focus more on reliability and ordering of messages, for example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcrl43r7gi91f11v5yvn6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcrl43r7gi91f11v5yvn6.png" alt="PubSub Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, how can we use the PubSub pattern to implement real-time communication from the server to the client?&lt;/p&gt;

&lt;p&gt;The server will be the publisher: each event that is generated and that needs to be communicated will be encapsulated in a message and sent to the message broker. Every client is a subscriber and will be listening for events through the message broker, receiving them with little to no delay.&lt;/p&gt;

&lt;p&gt;An advantage of using this approach for real-time communication is that &lt;strong&gt;it is very scalable&lt;/strong&gt;. The server does not need to have a connection to every client, it only needs to send the events to the message broker. However, the message broker also adds more complexity, as it is another service that needs to be managed.&lt;br&gt;
If we need full-duplex messaging, even though this can work the other way around if the server is a subscriber and the client is a publisher, an approach using WebSockets may be more advantageous.&lt;/p&gt;

&lt;h1&gt;
  
  
  Honorable Mention: Webhooks
&lt;/h1&gt;

&lt;p&gt;A &lt;a href="https://en.wikipedia.org/wiki/Webhook" rel="noopener noreferrer"&gt;Webhook&lt;/a&gt; is a method of implementing a custom callback to some event. A server might provide a Webhook for a certain type of event, meaning that when that event happens, the custom callback is triggered. This custom callback comes in the form of an HTTP Request to some URL provided to that server, meaning that &lt;strong&gt;when the event occurs, the server will issue a request to the given URL, providing information about it&lt;/strong&gt;.&lt;br&gt;
While this can be used for client-server communication (browsers have a hacky way to have a JavaScript server running), it is most commonly used for server-server messaging.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Nowadays, web applications and systems in general are becoming more and more complex. In an era governed by data, it is essential to know how to design a system that can present to the user large quantities of information in real-time. In this article, we have covered several ways to do that, using various technologies, protocols and approaches, and discussing their pros and cons.&lt;br&gt;
As always, I hope you have learned something new with this, and that it motivated you to research more about this topic! See you next time 😃&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=k56H0DHqu5Y" rel="noopener noreferrer"&gt;YouTube video: HTTP Request vs HTTP Long-Polling vs Websockets vs Server-Sent Events&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blog.intive-fdv.com/websockets-vs-long-polling/" rel="noopener noreferrer"&gt;WebSockets vs Long Polling&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.pubnub.com/learn/glossary/what-is-publish-subscribe/" rel="noopener noreferrer"&gt;What is Publish-Subscribe (Pub/Sub)?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systems</category>
      <category>architecture</category>
      <category>websockets</category>
      <category>pubsub</category>
    </item>
    <item>
      <title>Get Started with Scala</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 04 Apr 2021 11:45:39 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/get-started-with-scala-4jf8</link>
      <guid>https://dev.to/eduardocribeiro/get-started-with-scala-4jf8</guid>
      <description>&lt;p&gt;This article was originally posted on my &lt;a href="https://eduardocribeiro.com/"&gt;blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;In the last few weeks, I started learning the basics about the &lt;a href="https://www.scala-lang.org/"&gt;Scala&lt;/a&gt; programming language. I wanted to learn a language that was popular and effective in concurrent programming and distributed applications. In this article, I will talk about the basics of Scala, some cool aspects and features of the language that separate it from the most common languages like Java and Python, and provide a set of amazing resources to learn Scala and go from beginner to expert.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Scala?
&lt;/h1&gt;

&lt;p&gt;Scala is a general-purpose language that combines two programming paradigms: &lt;strong&gt;object-oriented programming&lt;/strong&gt; and &lt;strong&gt;functional programming&lt;/strong&gt;. Scala source-code can be compiled to Java bytecode, so it can run on the Java Virtual Machine (JVM), and is compatible with existing Java programs and libraries.&lt;/p&gt;

&lt;p&gt;If you are familiar with more traditional OOP languages like Java, you will find most Scala code as not too difficult to read and understand. In Scala there are classes, methods, fields, and the overall syntax is not too different from Java. However, one difference between these two languages is that in Scala, &lt;strong&gt;everything is an object&lt;/strong&gt;: even Java primitive types like &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt;. Every variable is an object and every operator is a method.&lt;/p&gt;

&lt;p&gt;As it was mentioned, Scala also combines the OOP paradigm with the advantages of functional programming. Functions are treated like "first-class citizens", as they are also variables (and therefore, objects). You can pass them as an argument to other functions or use them as a return value, for example.&lt;/p&gt;

&lt;p&gt;Some other features of Scala that are worth mentioning are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type inference.&lt;/strong&gt; You can, but don't need to explicitly specify the data type of a variable or the return type of a function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Immutability.&lt;/strong&gt; In Scala we usually operate with immutable values/objects. Any modification should just return another object. This is a major advantage for multithreaded or distributed environments, as it prevents a lot of race conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lazy Computation.&lt;/strong&gt; Lazy computation means evaluating an expression or calculating something not when the expression is declared, but only when the result is needed in another computation. You can declare a lazy variable using the keyword &lt;code&gt;lazy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Good set of collections.&lt;/strong&gt; Scala provides various classes and traits to collect and manage data, like &lt;code&gt;List&lt;/code&gt;, &lt;code&gt;Seq&lt;/code&gt;, &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;Map&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency support and control.&lt;/strong&gt; Scala provides in its standard library the &lt;code&gt;Actor&lt;/code&gt; class, which gives a higher level of abstraction for writing concurrent and distributed systems because we don't have to directly deal with explicit locking and thread management. There are also tools that support Scala in distributed and concurrent applications, like the &lt;a href="https://akka.io/"&gt;Akka&lt;/a&gt; toolkit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While Scala is a general-purpose language that can be used for a lot of things, and can basically be used for anything Java can be used for, its main application seems to be in &lt;strong&gt;concurrent programming and distributed applications.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  A Simple Example
&lt;/h1&gt;

&lt;p&gt;Here is a very simple example in Scala, where we use a list to calculate the sum of a set of numbers. We then create a new list by appending a new element to the already existing list, and calculating the new sum of elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;object&lt;/span&gt; &lt;span class="nc"&gt;Example&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;lsum&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;sum&lt;/span&gt;
        &lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="s"&gt;"$l - Sum: $lsum"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l2&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;:+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
        &lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l2sum&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;l2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;sum&lt;/span&gt;
        &lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="s"&gt;"$l2 - Sum: $l2sum"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is a short description of the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We define a &lt;code&gt;main&lt;/code&gt; function inside the Example &lt;code&gt;object&lt;/code&gt;, where all the code is contained.&lt;/li&gt;
&lt;li&gt;Declaring an &lt;code&gt;object&lt;/code&gt; is like declaring a new class, and creating the singleton instance for it.&lt;/li&gt;
&lt;li&gt;We then use the &lt;code&gt;val&lt;/code&gt; keyword to declare an immutable variable (constant), and we create a new &lt;code&gt;List&lt;/code&gt; with the elements 1, 2 and 3.&lt;/li&gt;
&lt;li&gt;We use &lt;code&gt;l.sum&lt;/code&gt; to calculate the sum of all the list elements.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;println()&lt;/code&gt; function is then invoked to print to the console the contents of the file and the sum of all elements. We use &lt;strong&gt;string interpolation&lt;/strong&gt; to insert in the string the value of the variables, using the &lt;code&gt;$&lt;/code&gt; character.&lt;/li&gt;
&lt;li&gt;We use &lt;code&gt;:+&lt;/code&gt; to append an element to the list. Notice that &lt;code&gt;l&lt;/code&gt; is not modified, instead we use a new immutable variable &lt;code&gt;l2&lt;/code&gt; to store the result.&lt;/li&gt;
&lt;li&gt;We then repeat the same operations for the new list &lt;code&gt;l2&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's say this program was stored on a file called &lt;code&gt;FirstExample.scala&lt;/code&gt;. We first need to compile the contents of the file to Java bytecode, and then we can execute the generated bytecode.&lt;/p&gt;

&lt;p&gt;To compile, we can use &lt;code&gt;scalac&lt;/code&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; scalac FirstExample.scala
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And to execute the generated bytecode we can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; scala FirstExample
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what we can see on the console after we execute the program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List(1, 2, 3) - Sum: 6
List(1, 2, 3, 4) - Sum: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Some Other Cool Things about Scala
&lt;/h1&gt;

&lt;h2&gt;
  
  
  (Almost) Everything is an expression
&lt;/h2&gt;

&lt;p&gt;For the most part, almost everything in Scala can be classified as an expression, meaning that it evaluates to a certain value. One thing that can be used as an expression in Scala, in contrast to most common languages, is an &lt;strong&gt;if-statement&lt;/strong&gt;. That allows us to do stuff like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;value&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anotherSomething&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;84&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another feature of Scala that also can be used as an expression is &lt;strong&gt;code blocks&lt;/strong&gt;. Code blocks are groups of instructions or statements inside curly brackets; the value returned by the code block is the value generated by its last statement. We can then do stuff like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;aCodeBlock&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;localValue&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;67&lt;/span&gt;
    &lt;span class="n"&gt;localValue&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="c1"&gt;// value returned by the code block&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The variable that is receiving the value from the code block would be assigned with the value 70.&lt;/p&gt;

&lt;h2&gt;
  
  
  map, flatMap, filter and for-comprehensions
&lt;/h2&gt;

&lt;p&gt;The 3 methods &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;flatMap&lt;/code&gt; and &lt;code&gt;filter&lt;/code&gt; are some of the most commonly used methods when dealing with data structures of any kind, and if you've done any significant programming in Scala, you likely already used them at some point. These methods allow us to do some powerful things in very little code, removing the need for many loops and iterations when using things like lists.&lt;/p&gt;

&lt;p&gt;Let's start by creating a very simple &lt;code&gt;List&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can use the &lt;code&gt;map&lt;/code&gt; method like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l2&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// List(2, 3, 4)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a new list, applying the function passed as an argument to &lt;code&gt;map&lt;/code&gt; to every element of the list.&lt;/p&gt;

&lt;p&gt;We can use &lt;code&gt;filter&lt;/code&gt; to select only some elements from the list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l3&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// List(1, 3)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, we create a new list &lt;code&gt;l3&lt;/code&gt; containing only the odd elements of the original list.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;flatMap&lt;/code&gt; method is similar to the &lt;code&gt;map&lt;/code&gt; method, but flattens the result of various lists into just one. Let's say we have the following function in our code, that receives an integer, and outputs a list containing the original value and the square of that value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;toSquare&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="k"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can then use &lt;code&gt;flatMap&lt;/code&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;l4&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;l&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;flatMap&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toSquare&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l4&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// List(1, 1, 2, 4, 3, 9)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, for more complex things, we might need to use a combination of these 3 methods, and the code might not be as readable as we want. Let's take another example, where we have two lists, one with numbers and the other with names, and we want to create strings representing the combination of all names with only the odd numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;names&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Bob"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Shirley"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;numbers&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the methods shown above, we could do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;names&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;flatMap&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;numbers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="py"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="py"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// List(Bob1, Bob3, Shirley1, Shirley3)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, it's not the most readable thing. Another way we can do it is by using &lt;strong&gt;for-comprehensions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;result2&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="k"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;
    &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// List(Bob1, Bob3, Shirley1, Shirley3)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Much better!&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern Matching
&lt;/h2&gt;

&lt;p&gt;This is something that is present in some other programming languages, like &lt;a href="https://www.haskell.org/"&gt;Haskell&lt;/a&gt;, for example.&lt;/p&gt;

&lt;p&gt;If you are familiar with C++, Java, or other popular languages, switch statements are nothing new to you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;value&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;
&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;order&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"first"&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"second"&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"third"&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"th"&lt;/span&gt; &lt;span class="c1"&gt;// default case&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, in Scala we can do what is called &lt;strong&gt;pattern matching:&lt;/strong&gt; instead of trying to match a variable against concrete values, we can match the variable against a certain structure, and then use its inner variables or values in the match expression. &lt;/p&gt;

&lt;p&gt;Like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;tuple&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Bob"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// creating a tuple&lt;/span&gt;
&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tuple&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;case&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="s"&gt;"$name is $age years old"&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"Default case"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Bob is 23 years old&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scala"&gt;&lt;code&gt;&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;myList&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;val&lt;/span&gt; &lt;span class="nv"&gt;result&lt;/span&gt; &lt;span class="k"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myList&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;_&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;_&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"This list contains 3 elements and has a 2 as the 2nd element"&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="k"&gt;_&lt;/span&gt; &lt;span class="k"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s"&gt;"Idk what this is"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Some good resources to learn the basics of Scala
&lt;/h1&gt;

&lt;p&gt;If you are interested in exploring what Scala has to offer, you can check out the following resources that I found useful for myself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=-8V6bMjThNo&amp;amp;list=PLmtsMNDRU0BxryRX4wiwrTZ661xcp6VPM"&gt;Scala at Light Speed&lt;/a&gt; - Fast-paced Scala course on YouTube, that covers the absolute basics. A good place to start 🙂&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.scala-lang.org/learn.html"&gt;Scala Online Resources&lt;/a&gt; - The official Scala website and documentation has a curated list of free (!) resources that allow you to master Scala and go from beginner to expert.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scalafiddle.io/"&gt;ScalaFiddle&lt;/a&gt; - Lets you write Scala in your browser. If you want to explore and play with Scala before taking the time to install things locally, or if you just want to do quick experiments and tests, ScalaFiddle might be useful to you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As with all programming languages, learning Scala is not just about watching content. Nothing replaces practice and actually writing code, so you can try to implement some basic algorithms in Scala, or solve some problems on &lt;a href="https://leetcode.com/"&gt;Leetcode&lt;/a&gt; 🙂&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Scala is a language that I definitely want to learn more about in the future. Most importantly it's a door into a new paradigm that I never explored before, which is functional programming.&lt;br&gt;
In the future, I will be doing more Scala posts, when I learn new stuff about the language, and hopefully also share some projects that use it 🙂&lt;/p&gt;

&lt;p&gt;As always, thank you for reading, and until next time!&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.james-willett.com/scala-map-flatmap-filter/"&gt;Map, Flatmap and Filter in Scala&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.javatpoint.com/features-of-scala"&gt;Features of Scala - JavaTPoint&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.scala-lang.org/overviews/scala-book/scala-features.html"&gt;Scala Features - Official Scala Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.scala-lang.org/overviews/collections/overview.html"&gt;Scala Mutable and Immutable Collections&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>scala</category>
      <category>todayilearned</category>
      <category>learning</category>
    </item>
    <item>
      <title>Where should I learn system design &amp; architecture?</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 28 Mar 2021 11:31:43 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/where-should-i-learn-system-design-architecture-3f5c</link>
      <guid>https://dev.to/eduardocribeiro/where-should-i-learn-system-design-architecture-3f5c</guid>
      <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I've been wanting, for some time, to get better at and increase my knowledge in the field of system design and software architecture, covering topics like microservices, design patterns, etc.&lt;/p&gt;

&lt;p&gt;What are some good resources that I can learn from? It can be online courses, books, blogs, YouTube channels...&lt;/p&gt;

&lt;p&gt;Thank you! :)&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>systems</category>
      <category>design</category>
      <category>architecture</category>
    </item>
    <item>
      <title>What are your favorite tech blogs/websites?</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 28 Mar 2021 11:26:59 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/what-are-your-favorite-tech-blogs-websites-240h</link>
      <guid>https://dev.to/eduardocribeiro/what-are-your-favorite-tech-blogs-websites-240h</guid>
      <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;I've been interested in following some tech blogs for a while. Recently I've discovered apps like &lt;a href="https://feedly.com/i/welcome"&gt;Feedly&lt;/a&gt;, which aggregates posts from various blogs and websites that you can "subscribe to", giving you a curated feed with the content from those sources.&lt;/p&gt;

&lt;p&gt;Now I'm looking for some blogs/websites related to programming, software engineering, and tech in general. What are your favorite tech blogs/websites? :)&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>blog</category>
    </item>
    <item>
      <title>How to Start Contributing to Open Source Projects</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Mon, 22 Mar 2021 10:57:42 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/how-to-start-contributing-to-open-source-projects-3a28</link>
      <guid>https://dev.to/eduardocribeiro/how-to-start-contributing-to-open-source-projects-3a28</guid>
      <description>&lt;p&gt;This article was originally posted on my &lt;a href="https://eduardocribeiro.com/"&gt;blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;The concept of &lt;a href="https://opensource.com/resources/what-open-source"&gt;open source software&lt;/a&gt; was introduced to me at the beginning of my software engineering journey, in my first year of university. In fact, my first ever college assignment was related to open source: I had to research about it and briefly present what it was all about. Unfortunately, first-year me didn't pay too much attention to it, but over time I started rediscovering this idea and began getting more interested in it. Lately, I've been doing some research, hoping to find some interesting open source projects to start contributing to, and I figured I might as well share my experience with you 😄&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Open Source?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Open source software is software whose source code is publicly available and accessible for everyone to inspect, modify, and contribute.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In contrast, software that is private and that is only accessible to the people or organization who created it can be described as "closed source" software. &lt;strong&gt;Skype is an example of closed source software.&lt;/strong&gt; It is completely owned by Microsoft and no other organization or person can access its source code, neither to view it nor to modify it.&lt;/p&gt;

&lt;p&gt;But open source is different. Its authors use certain platforms, like &lt;a href="https://github.com/home"&gt;GitHub&lt;/a&gt;, to make the code publicly available, inviting others to not only use the code as they like (to view it, copy it, learn from it, etc), but to also propose changes and enhancements and introduce new functionalities. &lt;strong&gt;An example of open source software is the Mozilla Firefox browser.&lt;/strong&gt; In most cases, open source software is free or at least provides a free version, however they often rival their closed source equivalents, which can cost hundreds of dollars or more.&lt;/p&gt;

&lt;p&gt;As explained in this &lt;a href="https://opensource.com/resources/what-open-source"&gt;article&lt;/a&gt;, just like with closed source software, in order to use open source software the user must accept the terms of a license. However, open source licenses grant permission to use the software for any purpose or context.&lt;/p&gt;

&lt;p&gt;By placing an open source license on a project, a person or organization agrees to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make the entire source code available to anyone&lt;/li&gt;
&lt;li&gt;Allow anyone to modify and enhance the source code and the product&lt;/li&gt;
&lt;li&gt;Allow the creation of derivative works or other projects that build on top of it&lt;/li&gt;
&lt;li&gt;Allow the project to be utilized by anyone, for (pretty much) anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UV2BXlwG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8faluvwu91prsqum4k8v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UV2BXlwG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8faluvwu91prsqum4k8v.jpg" alt="SWE Open Source Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why is Open Source so important?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;"Open source licensing encourages innovation through collaboration. Without it, many of the technologies we take for granted today would never have developed, or would be locked away behind patent law. The open source movement is the reason that technology has developed at such a breakneck pace for the past few decades." - from &lt;em&gt;&lt;a href="https://www.bigcommerce.com/ecommerce-answers/what-open-source-and-why-it-important/"&gt;What is open source, and why is it important?&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The concept of open source allows collaboration and partnerships that would otherwise not be possible. For example, a programmer in San Francisco might open a Pull Request, that would later be reviewed by someone in France, and commented by someone in Japan, while a solution is being proposed by someone in Finland... it lets knowledge and experience easily be shared among a community that can be comprised of people from all over the world. This movement is key for the overall advance of technology, and helps keep the world moving forward. &lt;/p&gt;

&lt;p&gt;Also, like it was previously mentioned, most of the time the software is completely free to use, however in terms of features and performance it can rival some other products in the same market, that are private and owned by a company and that can cost a lot of money. Open Source products sometimes are a cheap alternative for people who don't have the means.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the advantages of contributing to Open Source projects?
&lt;/h1&gt;

&lt;p&gt;Now let's think from a developer's perspective. As a software engineer or someone who is studying software engineering, why should you contribute to open source projects? Here is a list of topics that showcase the advantages that you can get from doing so:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are new to software engineering or programming or just want to start a new project, this is an &lt;strong&gt;excellent way to gain (early) experience, and it looks pretty nice on your CV&lt;/strong&gt;. It can be challenging at first, but remember you are not doing this alone, most project communities are active and have a lot of experienced users who already contributed a lot of times, who are ready to help newcomers if they have any questions.&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;provides you what you can't get with small individual projects&lt;/strong&gt;: you can get experience with large codebases by contributing to real-life, big, production projects that are used by millions of people around the world.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No prior experience is needed&lt;/strong&gt; in order to start contributing to these projects. There are a lot of big, important projects, that label some of their issues as "Good First Issue" or "Beginner", etc, to attract new contributors and people who may not have a lot of experience. Open Source is for everyone!&lt;/li&gt;
&lt;li&gt;You collaborate with people who may have more experience than you. It is a &lt;strong&gt;good way to learn more and increase your networking&lt;/strong&gt;. At the same time, you are able to &lt;strong&gt;increase your recognition&lt;/strong&gt; on platforms like GitHub, for example.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You feel more accomplished and feel like you are doing something useful&lt;/strong&gt;, because once again you can be contributing to big projects that are actually used in real-life.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You feel part of a movement, and of something bigger?&lt;/strong&gt; Open Source software drives the world forward, it's innovation through collaboration. It is also a way to give back to the community. It's fun and gives you personal satisfaction.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How can I contribute to an Open Source project?
&lt;/h1&gt;

&lt;p&gt;If you have never contributed to an open source project, and don't know how to, fear not! The process is standardized over pretty much every project, so if you found an interesting one that you would like to be involved in, here is what you should do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read the contribution guidelines.&lt;/strong&gt; Most of the time, open source projects have in their repository what is called the contribution or coding guidelines. This is normally a document written in Markdown, or a web page, that describes what you should do to familiarize yourself with the codebase and to contribute to the project. Normally it has information about how to do a local setup of all the necessary technologies, the description of methodologies or workflows that are being used (e.g. Git Flow), the coding style or any constraints that you need to have into account while coding, etc. So you should definitely check this out in the beginning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose the issue you want to take care of.&lt;/strong&gt; In the project's repository, there is probably an Issues section that lists all of the currently open issues and tasks that one can choose to do in order to contribute to it. Pick one that you find interesting or that you feel like you can take care of. For beginners, &lt;strong&gt;look for issues that have labels like "Good First Issue" or "Beginner" or similar.&lt;/strong&gt; Almost every medium/large project has issues for newcomers, so don't worry if it's your first time 🙂&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0yUiy0XK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7by35f9qnwi0kc9bq54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0yUiy0XK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7by35f9qnwi0kc9bq54.png" alt="Good First Issues Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fork the repository.&lt;/strong&gt; Now that you have read the guidelines and found an interesting issue, you must fork the repository, in order to have a copy of the codebase that belongs to you and that you can directly change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vqYDGgA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vezs1f5n732k4whdvob9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vqYDGgA3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vezs1f5n732k4whdvob9.png" alt="Fork Button Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a branch to work on your issue.&lt;/strong&gt; In your fork, create a new branch; this is where you will write your code. The naming of the branch should take into account the project's guidelines, and the issue that you are focusing on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code away!&lt;/strong&gt; You will then write the best code of your life. Maybe.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Make a Pull Request.&lt;/strong&gt; Once you're done coding, you must make a Pull Request, with the source branch being the new branch that you created in your fork, and the destination branch being the master branch or develop branch on the original repository (it may depend on the guidelines, so if you are unsure you should take a look at it once again). Here is an example PR from the Visual Studio Code repository:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xCPiQMnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlkbzduygbl97cxwmk8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xCPiQMnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlkbzduygbl97cxwmk8x.png" alt="Example PR Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Get feedback.&lt;/strong&gt; Maybe your PR wasn't perfect and you made some mistakes, but that's okay! If there are things you should change or improve, other contributors and maintainers of the project will comment on your Pull Request and give indications on what you should change. Gather this feedback and make the necessary changes to your code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Approvals!&lt;/strong&gt; Once your code is good enough and you have solved the issue you chose, other contributors will approve your Pull Request, so it can be merged into the main codebase. In the majority of open source projects, you need at least 2 approvals in order to make the merge into the destination branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Profit!&lt;/strong&gt; Congrats! You have just made your first contribution to an open source project! 🎉🎉🎉&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How do I pick an Open Source project to contribute to?
&lt;/h1&gt;

&lt;p&gt;So, now you know what is Open Source, why it's beneficial for you to contribute to OS, and you also know step by step how you can do that. One big question remains: how to find that perfect product/repository to contribute to? I mean, there are &lt;em&gt;tons&lt;/em&gt; of projects out there, but how can you find the right one to focus on, especially if it's your first time?&lt;/p&gt;

&lt;p&gt;Firstly, it's important to mention that just because an open source project is big, does not mean someone with little experience cannot contribute to it! As I've said before, if you never contributed to open source before, &lt;strong&gt;try to find issues that are tagged with "Good First Issue", "Beginner", "Newcomer" and similar.&lt;/strong&gt; It can also happen that the contribution guidelines of the project indicate what are the issue labels you should be looking for, if you are a beginner.&lt;/p&gt;

&lt;p&gt;There are open source projects of all types, that use all types of languages: JavaScript, Java, C++, Python, Scala... there are web projects that use frontend frameworks like React, there's databases, widely used libraries, etc. Choose an area that interests you and that you want to get better at. In order to make a better contribution, My advice is to choose a project that uses languages or frameworks that you are already familiar with, but nothing is stopping you from getting out of your comfort zone and picking something you never used before! 👀&lt;/p&gt;

&lt;p&gt;Despite all this, my main tip for choosing a project to contribute to is: &lt;strong&gt;find a project that resonates with you&lt;/strong&gt;, that speaks to you personally, and that you find useful. Maybe you might even use it already. This way, not only you might already be familiarized with the concept of the project, but more importantly you will be more motivated to actually do the work and finish your contribution. It isn't uncommon for someone to decide to make a contribution to a project, only to lose interest later on and never submitting a Pull Request. So this part is really important! 😄&lt;/p&gt;

&lt;h1&gt;
  
  
  Some good Open Source projects to contribute to
&lt;/h1&gt;

&lt;p&gt;If you need some inspiration to pick a project, is a curated list of projects that you might find interesting:&lt;/p&gt;

&lt;h2&gt;
  
  
  Elasticsearch
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZOVHYG9A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57z24u4c2jmg96h5isqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZOVHYG9A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/57z24u4c2jmg96h5isqg.png" alt="Elasticsearch logo"&gt;&lt;/a&gt;&lt;br&gt;
According to their &lt;a href="https://www.elastic.co/pt/what-is/elasticsearch"&gt;website&lt;/a&gt;, &lt;em&gt;"Elasticsearch is a free, open and distributed data search and analysis engine for all types of data, including textual, numeric, geospatial, structured and unstructured. [...]Known for its simple REST APIs, distributed nature, speed and scalability, Elasticsearch is the central component of Elastic Stack, a set of free and open tools for ingesting, enriching, storing, analyzing and visualizing data."&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.elastic.co/pt/what-is/elasticsearch"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/elastic/elasticsearch"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; Java&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first issue"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 1595&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 54.2k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Habitica
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--axU-jwoN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uya0y0cvbsyscxlckelu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--axU-jwoN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uya0y0cvbsyscxlckelu.png" alt="Habitica logo"&gt;&lt;/a&gt;&lt;br&gt;
Habitica is a productivity app like no other. It's a habit tracker app that treats your goals like a Role Playing Game. Level up as you succeed, lose HP as you fail, earn money to buy weapons and armor.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://habitica.com/static/home"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/HabitRPG/habitica"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; JavaScript, Vue, HTML, CSS, Node, Express, MongoDB &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first issue"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 607&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 8.2k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Visual Studio Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PmtGWeEE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/altlbm1vka194t8ke29t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PmtGWeEE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/altlbm1vka194t8ke29t.png" alt="VSCode logo"&gt;&lt;/a&gt;&lt;br&gt;
If you are a programmer, chances are you already know what VSCode is, and you may even use it. VSCode is one of the most widely used IDEs, that was made by Microsoft but is now also one of the biggest open source projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/microsoft/vscode"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; TypeScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "first timers only"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 1385&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 113k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  freeCodeCamp
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ffgkqlHA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysgva841lz3cxmob3tfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ffgkqlHA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysgva841lz3cxmob3tfe.png" alt="freeCodeCamp logo"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;"freeCodeCamp.org is a friendly community where you can learn to code for free. It is run by a donor-supported 501(c)(3) nonprofit to help millions of busy adults transition into tech. Our community has already helped more than 10,000 people get their first developer job. Our full-stack web development and machine learning curriculum is completely free and self-paced. We have thousands of interactive coding challenges to help you expand your skills."&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/freeCodeCamp/freeCodeCamp"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; JavaScript, React, CSS, Node, D3.js&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "first timers only"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 4222&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 322k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  React.js
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--79aWMVn7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3chyncga1bakj09cn3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--79aWMVn7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z3chyncga1bakj09cn3l.png" alt="React logo"&gt;&lt;/a&gt;&lt;br&gt;
A declarative, efficient, and flexible JavaScript library for building user interfaces. Probably the most popular frontend framework today.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/facebook/react"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first issue"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 1539&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 166k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Node.js
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gLJV-qOY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5f0kvrvaatbjoqipzym8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gLJV-qOY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5f0kvrvaatbjoqipzym8.png" alt="Node logo"&gt;&lt;/a&gt;&lt;br&gt;
Node.js is an open-source, cross-platform, JavaScript runtime environment. It executes JavaScript code outside of a browser.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nodejs/node"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first issue"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 2950&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 77.8k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Jarvis
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P2orQ5ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fj0qsrn8vq5kcxzedeo4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P2orQ5ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fj0qsrn8vq5kcxzedeo4.jpeg" alt="Jarvis logo"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;"Jarvis is a simple personal assistant for Linux, MacOS and Windows which works on the command line. He can talk to you if you enable his voice. He can tell you the weather, he can find restaurants and other places near you. He can do some great stuff for you."&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=PR-nxqmG3V8"&gt;YouTube video showing Jarvis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/sukeesh/Jarvis"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "difficulty/newcomer"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 149&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 1.9k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Brave Browser
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1JKC8_Ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/287lfswitq2yc2lasxni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1JKC8_Ny--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/287lfswitq2yc2lasxni.png" alt="Brave Browser logo"&gt;&lt;/a&gt;&lt;br&gt;
Desktop browser for macOS, Windows, and Linux.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://brave.com/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/brave/brave-browser"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first bug"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 67&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 8.7k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tensorflow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7tIFqM25--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugq35wn50ap9umpfgpfg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7tIFqM25--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ugq35wn50ap9umpfgpfg.png" alt="Tensorflow logo"&gt;&lt;/a&gt;&lt;br&gt;
TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tensorflow.org/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tensorflow/tensorflow"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; C++&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "stat:contributions welcome"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 2934&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 154k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Godot Engine
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A_faGduj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpuo4e98xr9h5hi7wmkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A_faGduj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpuo4e98xr9h5hi7wmkv.png" alt="Godot logo"&gt;&lt;/a&gt;&lt;br&gt;
Godot Engine is a feature-packed, cross-platform game engine to create 2D and 3D games from a unified interface. It provides a comprehensive set of common tools, so that users can focus on making games without having to reinvent the wheel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://godotengine.org/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/godotengine/godot"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; C++&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "junior job"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 1383&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 37.3k&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Kubernetes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WakpXjTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbz3drze2x1qp0rw6xz0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WakpXjTB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbz3drze2x1qp0rw6xz0.png" alt="Kubernetes logo"&gt;&lt;/a&gt;&lt;br&gt;
Kubernetes, also known as K8s, is an open source system for managing containerized applications across multiple hosts. It provides basic mechanisms for deployment, maintenance, and scaling of applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/pt/"&gt;Link to website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kubernetes/kubernetes"&gt;Link to GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary languages/technologies:&lt;/strong&gt; Go&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issue labels for beginners:&lt;/strong&gt; "good first issue"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of contributors:&lt;/strong&gt; 3044&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Number of repository stars:&lt;/strong&gt; 75.5k&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Open Source projects are important not only for people who use them, as some of them can be a great cheap/free alternative to some paid products, but they are also very valuable for programmers and software engineers that want to gain experience and get their hands dirty on real-life, big, production projects. They are an easy way to gain experience, and I think more developers should be contributing to them.&lt;/p&gt;

&lt;p&gt;Besides the projects that I mentioned above, I will leave you with two good resources that I found useful for me, so you can find even more open source projects that may interest you!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/MunGell/awesome-for-beginners"&gt;Awesome First PR Opportunities&lt;/a&gt;: this repository contains a (pretty large) list of beginner-friendly open source projects, separated in different languages. You should definitely check it out! &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.firsttimersonly.com/"&gt;First Timers Only&lt;/a&gt;: website that guides newbies and beginners on how to make their first open source contribution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As always, I hope you learned something from this article, and until next time!&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://opensource.com/resources/what-open-source"&gt;What is Open Source?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://open.lib.umn.edu/informationsystems/chapter/10-4-examples-of-open-source-software/"&gt;4 Examples of Open Source Software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.thebalancecareers.com/what-is-open-source-software-2071941"&gt;How Open Source Software Works&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.bigcommerce.com/ecommerce-answers/what-open-source-and-why-it-important/"&gt;What is Open Source, and why is it important?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>opensource</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Understand Blockchain and Smart Contracts (2/2)</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Sun, 14 Mar 2021 11:07:56 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-2-2-51pg</link>
      <guid>https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-2-2-51pg</guid>
      <description>&lt;p&gt;This article was originally posted in my &lt;a href="https://eduardocribeiro.com/blog/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;This is the second post of a 2-part series in which we talk about the concepts of blockchain and smart contracts, clarifying what they are, how they work, what they are for, and how they can shape the future.&lt;/p&gt;

&lt;p&gt;The first part of the series talks about blockchain; it is important to be familiarized with the concept of blockchain in order to fully understand how smart contracts work, so it would be fantastic if you could go back and take a look at the &lt;a href="https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-1-2-31b0"&gt;first post of the series&lt;/a&gt; 😉 Don't worry, I'll wait.&lt;/p&gt;

&lt;p&gt;Oh? You're back? Did you read the blockchain article? Are you sure? Hm... 🧐&lt;/p&gt;

&lt;p&gt;Okay, I trust you. Let's get started then 😄&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Smart Contract?
&lt;/h1&gt;

&lt;p&gt;Smart Contracts are actually not that recent: in 1994, cryptographer &lt;a href="https://pt.wikipedia.org/wiki/Nick_Szabo" rel="noopener noreferrer"&gt;Nick Szabo&lt;/a&gt; came up with the idea of being able to &lt;strong&gt;record contracts in the form of computer code&lt;/strong&gt;. The main advantage of his idea and this approach was that the contract would be &lt;strong&gt;activated automatically when certain conditions are met&lt;/strong&gt;. It seemed promising, however, it was a new concept that was difficult to execute and put in practice, due to the technology that existed back then.&lt;/p&gt;

&lt;p&gt;The idea of smart contracts was finally able to be properly &lt;strong&gt;put into practice with the introduction of blockchain&lt;/strong&gt; in 2009, and the creation of the first blockchain-based smart contracts came in 2015, after &lt;a href="https://pt.wikipedia.org/wiki/Vitalik_Buterin" rel="noopener noreferrer"&gt;Vitalik Buterin&lt;/a&gt; created &lt;a href="https://ethereum.org/en/" rel="noopener noreferrer"&gt;Ethereum&lt;/a&gt;. Besides currently being the second-largest cryptocurrency on the planet, it is also a &lt;strong&gt;platform that allows other blockchain applications to be built on top of it&lt;/strong&gt;, providing you the ability to create your own smart contracts using &lt;a href="https://ethereum.org/en/eth/" rel="noopener noreferrer"&gt;Ether&lt;/a&gt;, their currency.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyb281vmntorzs7oumrwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyb281vmntorzs7oumrwy.png" alt="Ethereum Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, to put it concisely:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A smart contract is a computer program or a transaction protocol, which represents an agreement between two people or entities. They run entirely on the blockchain, and all transactions are processed there, without the need of a third party. The transactions only occur after the conditions in the agreement are met, and when that happens, they are performed automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It can be seen as a kind of &lt;strong&gt;if-then statement&lt;/strong&gt;: if and only if a certain condition is met, then the transaction or payment is executed. When that "if" condition is validated, the "then" statement is automatically executed, and there is no chance for changing or tampering with these contracts. That "if" statement can be, for example, an expiration date.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ft51x5g77g6oolc7hmt4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ft51x5g77g6oolc7hmt4m.png" alt="Smart Contract Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How exactly do smart contracts work?
&lt;/h1&gt;

&lt;p&gt;Hopefully that gave you a better idea of what smart contracts are actually about, but let's try to understand exactly how they work. And for that, nothing better than a simple example 🙂&lt;/p&gt;

&lt;p&gt;Let's say that Alice, who's been saving up for months, wants to buy Bob's car. Once they agree on a reasonable price, this agreement between both entities can be formed and saved in the Ethereum blockchain, for example, using a smart contract.&lt;/p&gt;

&lt;p&gt;Bob has agreed with Alice that &lt;strong&gt;she needs to pay him 30 Ether&lt;/strong&gt; in order for her to have the car.&lt;/p&gt;

&lt;p&gt;The smart contract can then be described, in a very simple fashion, as:&lt;/p&gt;

&lt;p&gt;"IF Alice pays Bob 30 Ether, THEN Alice will receive full ownership of the car."&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fv56tvpbevcg5tzjyr412.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fv56tvpbevcg5tzjyr412.jpeg" alt="Car Selling"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alice and Bob then create the smart contract using the Ethereum platform.&lt;/p&gt;

&lt;p&gt;Once this smart contract has been registered and put into place, &lt;strong&gt;it cannot be changed&lt;/strong&gt;: there is no way that Alice can modify the contract and lower the price, and the same also applies to Bob, who cannot raise the price or change the benefits given to Alice after the payment.&lt;/p&gt;

&lt;p&gt;Because of that, Alice can feel safe paying the 30 Ether to Bob, because she knows that she will for sure receive ownership of the car. Bob should be pretty relaxed too: he knows that Alice will only get the benefits if she pays the agreed fee of 30 Ether.&lt;/p&gt;

&lt;p&gt;Now, let's think about what would need to happen if Alice and Bob did not decide to use a smart contract, and rather opted for the old-fashioned way.&lt;/p&gt;

&lt;p&gt;Without the use of a smart contract, they would need to pay lots of fees to third-party companies, including the bank, a lawyer and a vehicle broker. The whole process would also take fairly longer to conclude, as opposed to using smart contracts: in that case, after Alice completes the payment, the transition of ownership would be automatic and immediate.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is happening behind the scenes?
&lt;/h2&gt;

&lt;p&gt;It all revolves around &lt;strong&gt;blockchain technology&lt;/strong&gt;. The main advantages and characteristics of the blockchain are the keys to putting the idea of smart contracts in practice.&lt;/p&gt;

&lt;p&gt;As mentioned in my previous post, blockchain platforms are &lt;strong&gt;decentralized&lt;/strong&gt;, so they can be used to decentralize smart contracts and make them trustless, removing control from any central party (like banks, government, etc).&lt;/p&gt;

&lt;p&gt;Smart contracts on the blockchain also take advantage of &lt;strong&gt;immutability&lt;/strong&gt; and &lt;strong&gt;security&lt;/strong&gt;, making them near impossible to hack for the same reasons explained in my &lt;a href="https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-1-2-31b0"&gt;blockchain post&lt;/a&gt; (it's still a good time to check it out! 👀). It is also a &lt;strong&gt;transparent&lt;/strong&gt; and &lt;strong&gt;traceable&lt;/strong&gt; process, meaning that all the information about the contract is easily accessible by the participants.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the main advantages and disadvantages of smart contracts?
&lt;/h1&gt;

&lt;p&gt;To summarize...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomy&lt;/strong&gt; – You are the one who makes and controls the agreement, and as it was said, it executes automatically and immediately on the blockchain, eliminating the need for third parties as intermediaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced cost&lt;/strong&gt; – Speaking of third parties, since they are not necessary when using smart contracts, you save all the money that would otherwise be used on lawyers, brokers, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety/Trust&lt;/strong&gt; – All the safety and security mechanisms of the blockchain play in the favor of smart contacts, to make an unmodifiable and immutable solution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed&lt;/strong&gt; – Smart contracts on the blockchain are automated, shaving a lot of time when compared to a more traditional process with lots of paperwork involved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparency&lt;/strong&gt; – The conditions on the contract are visible and easily accessible by the participants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability&lt;/strong&gt; – Since the smart contract is saved on various nodes on the blockchain, your documents are never lost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accuracy&lt;/strong&gt; – Smart contracts are not only faster and cheaper, but they are also a good way to avoid any human mistakes that could've happened during the process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, they are not a perfect solution. Here are some challenges that come with the use of smart contracts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Difficult to change&lt;/strong&gt; - The unmodifiable aspect of the blockchain and of smart contracts can be both a blessing and a curse. While it does provide security and safety, if for example there is an error on the code of the contract, the process of fixing that error can be time-consuming and expensive.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Translation into code&lt;/strong&gt; - Contracts can include terms that are not always fully understood. Smart contracts are not always able to handle terms and conditions that are vague.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Third parties&lt;/strong&gt; - This one may seem contradictory, since one of the main benefits of smart contracts is the elimination of third parties. However, the issue is more complicated than it seems. It may get rid of the need for brokers or other intermediaries to confirm the agreement, but sometimes, for example, layers may still be needed by developers to understand the terms in order to create the code for smart contracts. Third parties may assume different roles from the ones they take in traditional contracts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other problems may also arise, like legal issues related to how governments should regulate these contracts, how would they tax them, etc.&lt;/p&gt;

&lt;h1&gt;
  
  
  How are smart contracts being currently used?
&lt;/h1&gt;

&lt;p&gt;The scenario of buying/selling goods, like the example that was given earlier, when Alice bought Bob's car, can be a common use for smart contracts but it is far from being their only application. Smart contracts can be used for any type of transaction; it does not have to be financial.&lt;/p&gt;

&lt;p&gt;Let's see how some industries can benefit from the use of smart contracts, and some cases where it's already being used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Insurance Companies&lt;/strong&gt; - Some companies have already started using smart contracts as a way to implement insurance policies. For example, let's say take the example of guarantee insurance, that covers the loss that can arise from dishonesty, disappearance, etc. Essentially, it compensates customers if they do not receive a desired service or product. In this case, let's say that the insurance company creates a smart contract and sends $250 to it, and the customer sends $50, making a total of $300. If the customer does end up receiving the service or product, the smart contract sends the insurance company the $300, otherwise it would be sent to the customer in order to compensate for their loss. This approach saves time and money, and both parties can be 100% sure that if their condition is met, they will get the money automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Supply Chain&lt;/strong&gt; - Supply chain is an area that suffers a lot from paper-based systems that slow down the process and introduce the risk of loss and fraud. Smart contracts can be used as a way to mitigate these issues. By providing a secure, digital version to all parties involved, and by automating tasks and payments, then we can do things like triggering the creation/order of a product in the supply chain after a delivery of some finished product at the end of the chain. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Business Management&lt;/strong&gt; - One way that businesses can use smart contracts is to automate the payment of their employees. Examples can be as simple as "WHEN we reach the end of October, THEN send John 2 Ether". John will always be paid on time, no more no less, and the business does not need to worry about anything.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Healthcare&lt;/strong&gt; - Health systems can use smart contracts to safely store and transfer patient records, allowing no access to third parties. The patients are therefore given full control of their data: if, for example, researchers want to use their data, not only do they have to pay for it, but even then the final decision would be up to the patient, according to if they want to sell it or not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Governments&lt;/strong&gt; - Smart contracts constitute a way to make voting systems less susceptible to manipulation. Moreover, it could increase the actual number of voters, because it contributes to eliminate or at least improve the slow process that is required in some countries for someone to vote.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  "Can I make a smart contract??"
&lt;/h1&gt;

&lt;p&gt;If you liked the concept of smart contracts and want to get your hands dirty right away, fear not! Because getting started and creating your first smart contracts can be very simple.&lt;/p&gt;

&lt;p&gt;Regarding the platform, unless you have any good reason not to, you should use the Ethereum blockchain. It is the most popular and the go-to option for building smart contracts and any application that relies on them. Smart contracts on the Ethereum blockchain can be written using their &lt;strong&gt;special programming language for smart contracts&lt;/strong&gt;, named &lt;a href="https://docs.soliditylang.org/en/v0.8.2/" rel="noopener noreferrer"&gt;Solidity&lt;/a&gt;. Solidity is an object-oriented, high-level language, that is influenced by the likes of C++, Python and JavaScript, so if you already know some of these languages and are familiar with OOP concepts, learning Solidity shouldn't be too hard!&lt;/p&gt;

&lt;p&gt;A great tool to get started with making smart contracts on Ethereum is &lt;a href="https://remix.ethereum.org/" rel="noopener noreferrer"&gt;REMIX IDE&lt;/a&gt;. REMIX IDE is a browser-based IDE that allows you to write Ethereum smart contracts without having to install anything on your computer.&lt;/p&gt;

&lt;p&gt;After introducing the concept of smart contracts, Ethereum and Solidity, and the REMIX IDE, I now leave you a very simple tutorial on how to build your first smart contract using these tools and technologies, that I found useful for myself.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ooN6kZ9vqNQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;So that's it! That concludes the 2-part series that I have regarding blockchain and smart contracts, which I started working with recently and found very fascinating. They both have a lot of potential but there are some issues and challenges that need to be tackled before their mass adoption starts.&lt;/p&gt;

&lt;p&gt;Hopefully you learned something with this, having given you the curiosity to take a deeper dive and explore more about these topics. Until next time!&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Smart_contract" rel="noopener noreferrer"&gt;Smart Contract: Wikipedia&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.bitdegree.org/crypto/tutorials/what-is-a-smart-contract" rel="noopener noreferrer"&gt;What Is a Smart Contract and How Does it Work?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.investopedia.com/terms/s/smart-contracts.asp" rel="noopener noreferrer"&gt;Smart Contracts Definition: Investopedia&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blockgeeks.com/guides/smart-contracts/" rel="noopener noreferrer"&gt;Smart Contracts: The Blockchain Technology That Will Replace Lawyers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://corporatefinanceinstitute.com/resources/knowledge/deals/smart-contracts/" rel="noopener noreferrer"&gt;Smart Contracts - Overview, Uses, Benefits, Limitations&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=ZE2HxTmxfrI" rel="noopener noreferrer"&gt;What are Smart Contracts (Youtube Video)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>smartcontracts</category>
      <category>blockchain</category>
      <category>ethereum</category>
    </item>
    <item>
      <title>Understand Blockchain and Smart Contracts (1/2)</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Mon, 08 Mar 2021 09:58:31 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-1-2-31b0</link>
      <guid>https://dev.to/eduardocribeiro/understand-blockchain-and-smart-contracts-1-2-31b0</guid>
      <description>&lt;p&gt;This article was originally posted on my &lt;a href="https://eduardocribeiro.com/blog/understand-blockchain/" rel="noopener noreferrer"&gt;blog&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Blockchain feels like a term that many people have heard about, but some of them don't actually know what it is. There is a lot of misinformation about it.&lt;/p&gt;

&lt;p&gt;I myself have had curiosity to learn what blockchain is for a long time, but never actually did so until recently, when I started working on a project that will use blockchain technology with smart contracts.&lt;/p&gt;

&lt;p&gt;Blockchain has various applications, but the main one, and the one most people are familiarized with, is cryptocurrency. Now that cryptocurrencies are getting more popular, with Bitcoin hitting the 50k dollar mark, Ethereum 2.0 being developed and newcomers like Dogecoin on the rise, it is increasingly important to understand how the underlying technologies work.&lt;/p&gt;

&lt;h1&gt;
  
  
  So... What is the Blockchain?
&lt;/h1&gt;

&lt;p&gt;To put it concisely...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Blockchain is a technology and architecture based on a distributed ledger, that allows various users to save information (data, transactions, contracts, etc) in blocks that are linked together, achieving a high degree of security and integrity.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fdzvzh3h5kiqx0e621g7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fdzvzh3h5kiqx0e621g7x.png" alt="Blockchain Definition Image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The structure of a blockchain is essentially &lt;strong&gt;append-only&lt;/strong&gt;, meaning that once you write data to the blockchain, it is extremely difficult to change it or delete it, whether if it's done with good or bad intentions. This is achieved by using &lt;a href="https://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="noopener noreferrer"&gt;cryptographic hash functions&lt;/a&gt; (among other things); they are used to calculate a unique hash or identifier for each block. But more on that later.&lt;/p&gt;

&lt;p&gt;To understand why, we need to take a closer look at what each block contains: it contains its &lt;strong&gt;hash&lt;/strong&gt;, the &lt;strong&gt;data&lt;/strong&gt; inside it, and the &lt;strong&gt;hash of the previous block&lt;/strong&gt; in the blockchain (they can contain more information depending on the application where the blockchain is actually being used, but essentially it is this). The fact that each block contains the hash of the previous one is actually what links the blocks together and makes the chain of block exist (thus the name blockchain).&lt;/p&gt;

&lt;p&gt;The data that each block stores depends on the type of blockchain and application that is being considered. For example, in the case of a cryptocurrency, the blockchain would store in each block a set of transactions, each one containing information like the sender account, the receiver account, and the amount of coins transferred.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1uh9a4dl4wddjpjd2yg8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1uh9a4dl4wddjpjd2yg8.png" alt="Crypto Blockchain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why is Blockchain so secure?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Hash Calculation
&lt;/h2&gt;

&lt;p&gt;As mentioned before, one of the aspects and characteristics of blockchain that makes it secure is its use of &lt;strong&gt;hashing&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hashing is the process of converting a given key into another value. A hash function is used to generate the new value according to a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash. A good hash function uses a one-way hashing algorithm, or in other words, the hash cannot be converted back into the original key." - taken from &lt;a href="https://www.educative.io/edpresso/what-is-hashing" rel="noopener noreferrer"&gt;What is hashing?&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But how exactly is it used?&lt;/p&gt;

&lt;p&gt;When a block is created, its hash is calculated based on the content of the block. If anything on the block changes, its hash is recalculated. &lt;/p&gt;

&lt;p&gt;So let's think about what would happen if someone tried to hack the contents of a block. If someone tries to, for example, change the value of a transaction in a block, its hash would change, since its content changed. Because of that, the next block in the blockchain, that had stored the hash of the previous block, now contains an invalid hash. This also applies to any change that the blockchain might suffer, including switching the order of blocks, deleting them, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9exudinso3lnad6zklzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9exudinso3lnad6zklzc.png" alt="Tampered Blockchain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So essentially, the chain is broken, and all the blocks that follow the tampered block would actually need to get their hashes recalculated in order to restore the blockchain and make it valid again. &lt;/p&gt;

&lt;p&gt;The problem is... that's not that hard to do. Machines nowadays have enough computational power to calculate millions of hashes per second, so an attacker could just compute the hashes for all the blocks and make the chain valid again... How to prevent this?&lt;/p&gt;

&lt;h2&gt;
  
  
  Proof of Work
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Proof of Work is a blockchain protocol for verifying transactions on a decentralized network and maintaining consensus across the system. Proof of Work is costly and time-consuming to produce, but easily verifiable by others.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Proof of Work, or PoW for short, is a mechanism/protocol that purposely slows down the creation of new blocks in order to prevent tampering from an attacker. It also avoids things like &lt;a href="https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/" rel="noopener noreferrer"&gt;DDOS&lt;/a&gt; and spam.&lt;/p&gt;

&lt;p&gt;The computing power necessary to do the PoW depends on various factors and is configurable though what is called the &lt;strong&gt;difficulty&lt;/strong&gt; of the PoW. This could be, for example, imposing that the calculated hash of the new block needs to &lt;strong&gt;start with 10 zeros&lt;/strong&gt;. For each block, there is a random number (the &lt;strong&gt;nonce&lt;/strong&gt;) that influences the result of the block hash. If the calculated hash for a block does not have 10 zeros, the nonce is incremented and a new hash is calculated for the block. The process is repeated until the hash does in fact have 10 zeros. This PoW may demand a lot of computing power because the number of hashes thats needs to be computed may be quite big, but at the same time it is easily verifiable by others: when someone wants to know if a block is valid, they simply take the block values, including the final nonce value, and compute the hash for the block. If the hash does start with 10 zeros, they can be extremely confident that whoever calculated the hash actually did the PoW correctly and that the block is valid.&lt;/p&gt;

&lt;p&gt;In this case, the difficulty of the PoW can be modified by changing the number of desired leading zeroes; the more zeroes the hash needs to have at the start, the more difficult and laborious it is to compute a valid hash. In Bitcoins case, the difficulty of the PoW is managed so that it takes about 10 minutes to calculate the required PoW and to add that block to the blockchain. This makes the blockchain more secure because if you tamper with a block, you will need to redo the Proof of Work for all the following blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed property of the blockchain
&lt;/h2&gt;

&lt;p&gt;Apart from hashing and PoW, this is another aspect that makes blockchain so secure.&lt;/p&gt;

&lt;p&gt;Let's take into account a blockchain system that has a set of participants or nodes, that perform transactions and create blocks to expand the blockchain. Instead of using a central entity to manage the blockchain, &lt;strong&gt;each participant will instead keep a local copy of the blockchain&lt;/strong&gt;. When someone creates a block, they will broadcast it into the network so that other participants are aware of its existence. Each one will then check if the block is valid and if it has not been tampered with, and if it is in fact valid it is added to that participant's local copy of the blockchain. Therefore, nodes reach &lt;strong&gt;consensus&lt;/strong&gt; about the node added and the new blockchain state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Focrkujocrdy0eexpasb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Focrkujocrdy0eexpasb3.png" alt="Consensus"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This decentralized property of the blockchain could bring some additional challenges. Let's say you are a participant, and your local copy of the blockchain ends in block A. You receive a new block B, that connects to block A, thus extending the blockchain. However, some time later, you receive a block C, that also connects to block A. So know you have a &lt;strong&gt;fork&lt;/strong&gt;, a separation that resulted in two different blockchains. What happens when you have a &lt;strong&gt;conflict&lt;/strong&gt; and you have two distinct blockchains with conflicting transactions or data, like what happened in this case?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F14v53thncjaj5nb16tu0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F14v53thncjaj5nb16tu0.png" alt="Conflict in Blockchain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rule to solve this situation is to trust the longest blockchain, &lt;strong&gt;the one with the most work put into it.&lt;/strong&gt; Going back to the previous example, eventually we would receive some other blocks that would connect to block B, and maybe some blocks that connect to block C, thus extending both chains. After some time, these chains would probably have different lengths, and we would only keep the longest one, thus resolving the conflict and reaching consensus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2o7dkpc459ustpg9o7vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2o7dkpc459ustpg9o7vt.png" alt="Conflict Resolved"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is why it is almost impossible to tamper and hack a blockchain, specially if the number of participants and nodes is high: after tampering with a block, we would need to redo the PoW for all following blocks, and because of this &lt;strong&gt;consensus algorithm&lt;/strong&gt; we would also need to have at least somewhere close to 50% of the computing power of the whole network, in order to continue computing PoW for new blocks, to maintain the blockchain with the tampered block the blockchain that everyone agrees on. If we do not have that computational power, eventually our tampered blockchain will not be the longest one and it will be discarded.&lt;/p&gt;

&lt;h1&gt;
  
  
  The process of mining
&lt;/h1&gt;

&lt;p&gt;Now that we have understood, from a high-level perspective, how a blockchain works and what are the main characteristics that make it so secure and reliable, let's discuss how new blocks actually get generated and added.&lt;/p&gt;

&lt;p&gt;It can be the case that some users only want to make transactions or use the blockchain without the need of doing the PoW and computing a valid hash for a block. In the case of cryptocurrencies, if someone makes a transaction, they're not necessarily the one who create the block containing that transaction. So who actually does the PoW and generates new blocks?&lt;/p&gt;

&lt;p&gt;Still on the cryptocurrency example, there is another problem related to it: where does the money come from? Seriously, how do I actually get my hands on some Bitcoins and how are new coins generated into the system?&lt;/p&gt;

&lt;p&gt;To answer both of these questions, we need to understand the concept of &lt;strong&gt;mining&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let's take Bitcoin as an example. Each time a new transaction is created, it gets added to the network. Some participants will be "listening" for transactions on the network, and they will group them together in a block, calculate the PoW necessary for the block to be considered valid, and broadcast it so other nodes can add it to their blockchain. This process has the name of &lt;strong&gt;mining&lt;/strong&gt; and the participants who do it are called &lt;strong&gt;miners&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;As a reward for completing this process, miners get a small quantity in Bitcoin, thus introducing new bits of currency into the economy.&lt;/p&gt;

&lt;p&gt;This mining process might be compared to some kind of mini lottery: when a block is created, various miners will compete at the same time in order to perform the PoW and compute a valid hash for the block. Whichever miner completes the PoW first will get the reward for it.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the main advantages that blockchain offers?
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Immutability:&lt;/strong&gt; As said before, the structure in a blockchain is append-only, meaning that you cannot alter or delete data or blocks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; It is extremely secure due to the use of cryptographic hash functions, the PoW protocol and the consensus algorithm.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decentralization:&lt;/strong&gt; It does not have a centralized architecture; each participant keeps a copy of the blockchain. Because of that, data that is lost in a node is easily recoverable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trustless:&lt;/strong&gt; The blockchain technology allows for verification without having to be dependent on third-parties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparency:&lt;/strong&gt; The data present in the blocks is observable. The individuals who are provided authority can view the block's information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traceability:&lt;/strong&gt; Each block can be tracked along the chain to its point of origin. Usually, the blocks are time stamped and recorded in chronological order.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  What can blockchain be used for?
&lt;/h1&gt;

&lt;p&gt;Some examples are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cryptocurrencies and payment processing:&lt;/strong&gt; The main use case for blockchain is the one you probably already know of, that is cryptocurrencies. Currencies like Bitcoin, Ethereum, Ripple, Litecoin, etc, all use the blockchain technology to function. But that is far from being the only application that blockchain has.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data sharing:&lt;/strong&gt; Cryptocurrency &lt;a href="https://www.iota.org/" rel="noopener noreferrer"&gt;IOTA&lt;/a&gt; launched, a few years ago, their Data Marketplace, demonstrating that blockchain could be used as a marketplace to share or sell data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supply chain and logistics monitoring:&lt;/strong&gt; By using blockchain, businesses should be able to quickly detect inefficiencies within their supply chains, as well as locate items in real time. Furthermore, it would allow businesses, and possibly even consumers, to view how products performed from a quality-control perspective.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voting mechanism:&lt;/strong&gt; A blockchain solution would combine the best of both worlds, providing not only the transparency necessary to see all the votes and to detect if something has changed on the network, but also immutability (i.e. unchanging nature of the blockchain).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Medical recordkeeping:&lt;/strong&gt; In addition to storing patient records, the patient, who possesses the key to access these digital records, would be in control of who gains access to that data, thus strengthening patient privacy. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Property title transfers:&lt;/strong&gt; In order to buy or sell land, a house, a car, etc, you will need to transfer or receive a title. Blockchain can store titles on its network, providing a transparent view of this transfer and presenting a clear picture of legal ownership.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Among many others!&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenges that blockchain faces
&lt;/h1&gt;

&lt;p&gt;Even though blockchain is a very promising technology with a lot of potential and various applications, it is far from perfect. It still has several flaws and bottlenecks that prevent its widespread adoption. Some of them are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Energy consumption and computational power:&lt;/strong&gt; The computational power required for a blockchain to operate can be quite expensive. According to &lt;a href="https://www.computerworld.com/article/3191077/what-is-blockchain-the-complete-guide.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt;, "the Bitcoin blockchain harnesses anywhere between 10 and 100 times as much computing power as all of Google's serving farms put together". &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Big issue. Because of this, Bitcoin payments still take somewhere around 10 minutes to 1 hour. In order for blockchain to compete with payment networks and achieve adoption by FinTech companies, it must find a way to boost scalability and throughput, and address latency problems. For example, Bitcoin can only process 3.3 to 7 transactions per second, whereas Visa's VisaNet on average processes 1,700 transactions per second.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited interoperability:&lt;/strong&gt; Another challenge is the lack of interoperability between the large number of blockchain networks. Various projects are using blockchain platforms with different protocols and algorithms, and the lack of universal standards makes it difficult to communicate between networks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article we went over the very basics of blockchain, how it works, how it can be used, and what are its main advantages and problems. There are &lt;em&gt;a lot&lt;/em&gt; of topics that this article did not cover, as blockchain is a very extensive topic. But hopefully it was enough to give you an idea of this technology.&lt;/p&gt;

&lt;p&gt;You have probably noticed that the title of this article says "1 out of 2". That's because there will be a follow-up post to this one, that will cover another application of blockchain networks: &lt;strong&gt;smart contracts&lt;/strong&gt;. Stay tuned for that 😉&lt;/p&gt;

&lt;p&gt;Thank you for reading and until next time!&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=bBC-nXj3Ng4&amp;amp;t=613s" rel="noopener noreferrer"&gt;But how does bitcoin actually work?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=SSo_EIwHSd4" rel="noopener noreferrer"&gt;How does blockchain work&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.investopedia.com/terms/b/blockchain.asp" rel="noopener noreferrer"&gt;What is the Blockchain: Investopedia&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.computerworld.com/article/3191077/what-is-blockchain-the-complete-guide.html" rel="noopener noreferrer"&gt;Blockchain: The Complete Guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://towardsdatascience.com/a-shallow-dive-into-bitcoins-blockchain-part-2-transactions-d4ee83067bae" rel="noopener noreferrer"&gt;A Shallow Dive Into Bitcoin's Blockchain&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.smartdatacollective.com/top-advantages-blockchain-for-businesses/" rel="noopener noreferrer"&gt;Top Advantages of Blockchain for Business&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.fool.com/investing/2018/04/11/20-real-world-uses-for-blockchain-technology.aspx" rel="noopener noreferrer"&gt;20 Real World Uses for Blockchain Technology&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.finextra.com/blogposting/18496/remaining-challenges-of-blockchain-adoption-and-possible-solutions" rel="noopener noreferrer"&gt;Remaining Challenges of Blockchain Adoption, and Possible Solutions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>blockchain</category>
      <category>crypto</category>
      <category>mining</category>
      <category>bitcoin</category>
    </item>
    <item>
      <title>Why and How You Can Build Your Personal Website/Blog</title>
      <dc:creator>Eduardo Ribeiro</dc:creator>
      <pubDate>Mon, 01 Mar 2021 13:25:15 +0000</pubDate>
      <link>https://dev.to/eduardocribeiro/why-and-how-you-can-build-your-personal-website-blog-2apd</link>
      <guid>https://dev.to/eduardocribeiro/why-and-how-you-can-build-your-personal-website-blog-2apd</guid>
      <description>&lt;p&gt;&lt;em&gt;This article was originally posted on my &lt;a href="https://eduardocribeiro.com/blog/how-to-build-personal-website/"&gt;blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Soon after my exams, in late January, I was brainstorming various project ideas in order to pick one to do in my free time before the 2nd semester started. I wanted something simple, interesting, that could be useful in the future and that would help me expose myself to the world.&lt;/p&gt;

&lt;p&gt;Then I came across &lt;a href="https://dev.to/mouhamedaly/how-i-created-my-blog-with-gatsby-1762"&gt;this post&lt;/a&gt;, and this quote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As a software developer, one of the best mediums you can use to market yourself is a blog. It’s my firm belief that every software developer who cares about their career should invest in creating a blog.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These words are from &lt;a href="https://twitter.com/simpleprogrammr"&gt;John Sonmez&lt;/a&gt;, software developer and author of two best selling books on tech and career development.&lt;/p&gt;

&lt;p&gt;I had already come across the idea of building a personal blog, but this reminded me the importance of it, and made me realize that it ticked out all the requirements that I had for a side project. So I decided to do it.&lt;/p&gt;

&lt;p&gt;In this article I will talk about why you may want to build your own personal website or blog, and how you can do it easily using &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why would you build a personal website?
&lt;/h1&gt;

&lt;p&gt;John Sonmez, alongside a lot of other people, talks a lot about blogging and how it is important. &lt;br&gt;
Writing articles on various topics like tech, career, self-improvement or your favorite hobbies (anything really) can help you better understand a certain concept and also help you be a better communicator, as there is a lot of researching and learning behind a blog post.&lt;/p&gt;

&lt;p&gt;It can serve as a way to understand and learn about a certain topic; a good way of making sure you understand or know something is to explain it to other people. At the same time, it also serves as a way to pass the knowledge that you have to others and give back to the community.&lt;/p&gt;

&lt;p&gt;If you are a freelancer or an independent consultant, it can also be helpful, as it can bring a lot of clients and customers your way instead of letting them simply find you by themselves. It pushes you to expose yourself to others, increase your networking skills and meet new people.&lt;/p&gt;

&lt;p&gt;But you may ask yourself, &lt;em&gt;"Why should I waste time on having my own blog when I can simply post on already established platforms like &lt;a href="https://medium.com/"&gt;Medium&lt;/a&gt; or &lt;a href="https://dev.to/"&gt;DEV&lt;/a&gt;?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are several reasons for having your own platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will not be dependent on any other platform. You own it and you have the freedom to do what you want;&lt;/li&gt;
&lt;li&gt;The website is &lt;em&gt;yours&lt;/em&gt;: you can customize it and make it look and function according to your needs and likes;&lt;/li&gt;
&lt;li&gt;You can monetize your blog in the future, if you want, with ads for example;&lt;/li&gt;
&lt;li&gt;You can still publish on platforms like Medium or DEV, and redirect readers to your personal blog!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For me, besides all the reasons stated above, I took this as an &lt;strong&gt;opportunity to start a new Web project&lt;/strong&gt;, so for those of you who are interested in having a small side project in Web Development, this can help you with that 😁&lt;/p&gt;

&lt;p&gt;If that convinced you to maybe try to build your own personal site or blog, I will explain how I did it in the next sections, and how you can too.&lt;/p&gt;

&lt;h1&gt;
  
  
  The technologies/tools I used
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Gatsby
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FNz4Lyvo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b006prg7dhj2uove8laz.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FNz4Lyvo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b006prg7dhj2uove8laz.jpeg" alt="Gatsby"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To put it concisely, &lt;strong&gt;"&lt;a href="https://www.gatsbyjs.com/"&gt;GatsbyJS&lt;/a&gt; is a &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;-based, &lt;a href="https://graphql.org/"&gt;GraphQL&lt;/a&gt; powered, static site generator"&lt;/strong&gt; (taken from &lt;a href="https://www.mediacurrent.com/blog/what-is-gatsbyjs/"&gt;this post&lt;/a&gt;). It uses powerful pre-configuration to build a website that uses only static files (meaning it delivers the same files for all users/visitors) for incredibly fast page loads.&lt;/p&gt;

&lt;h3&gt;
  
  
  What makes Gatsby special?
&lt;/h3&gt;

&lt;p&gt;There were some aspects that made me choose Gatsby for developing my personal blog, as opposed to something like &lt;a href="https://jekyllrb.com/"&gt;Jekyll&lt;/a&gt; or just using &lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt; or any other web technology.&lt;/p&gt;

&lt;p&gt;The first thing to mention is its use of GraphQL. Gatsby uses GraphQL to collect your data from wherever it may be: Markdown, JSON, third party APIs, anywhere! At build time, it creates an internal GraphQL server of all of this data. So, in your React components, all of your data is queried at build time from there.&lt;/p&gt;

&lt;p&gt;Secondly, despite not being around for too long (release in 2017), it has great documentation to help you get acquainted quickly. It also has a lot of different &lt;a href="https://www.gatsbyjs.com/plugins"&gt;plugins&lt;/a&gt; that add functionality and help you customize your site.&lt;/p&gt;

&lt;p&gt;And last but not least, is its dedication to performance, as I've mentioned earlier. Gatsby loads only the critical HTML, CSS, JavaScript and data so your site loads as fast as possible. Once loaded, Gatsby prefetches resources for other pages so clicking around the site feels really fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do I need to know React and GraphQL to use Gatsby?
&lt;/h3&gt;

&lt;p&gt;One of the things I should mention here is that you do not need to know React and GraphQL beforehand in order to use Gatsby. Yes, having some React knowledge won't hurt you, but due to the great documentation and tutorials that Gatsby has available, I'm sure you will be just fine 😁&lt;/p&gt;

&lt;p&gt;In my case, I had previous React experience but had never touched GraphQL before; I still got the hang of things pretty quickly after going through some of the tutorials. &lt;/p&gt;

&lt;p&gt;You can also use this project to your advantage if you want to learn these technologies but don't know where to start. I consider Gatsby a great point of entry to learn both React and GraphQL.&lt;/p&gt;

&lt;p&gt;If you &lt;em&gt;really&lt;/em&gt; can't wait any longer and want to get started right away, you can follow &lt;a href="https://www.gatsbyjs.com/docs/tutorial/part-zero/"&gt;this tutorial&lt;/a&gt; and let your creativity fly. &lt;/p&gt;

&lt;p&gt;React and GraphQL are both crucial for Gatsby, but if you don’t know them, Gatsby is an excellent tool to learn them, and not an excuse not to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some useful plugins that I use
&lt;/h3&gt;

&lt;p&gt;Gatsby provides a lot of &lt;a href="https://www.gatsbyjs.com/plugins"&gt;plugins&lt;/a&gt; that can massively extend the functionalities of your website; you should definitely look into this and use them to your advantage in order to create a unique product more easily. There are plugins for almost anything you can think of, from integrating Google Analytics to letting you use emojis in your blog posts 😉&lt;/p&gt;

&lt;p&gt;Here is a collection of some plugins that I have on my blog, that can also be of use to you. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-typography/"&gt;gatsby-plugin-typography&lt;/a&gt; - plugin for utilizing the &lt;a href="https://kyleamathews.github.io/typography.js/"&gt;Typography&lt;/a&gt; library with minimal configuration.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-transformer-remark/"&gt;gatsby-transformer-remark&lt;/a&gt; - Parses Markdown files using &lt;a href="https://remark.js.org/"&gt;Remark&lt;/a&gt;, allowing you to display them in your website.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-remark-images/"&gt;gatsby-remark-images&lt;/a&gt; - Processes images in Markdown so they can be used in the production build.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-remark-embed-video/"&gt;gatsby-remark-embed-video&lt;/a&gt; - Embed a video from Youtube, Vimeo, etc for the ultimate Markdown experience.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/"&gt;gatsby-plugin-react-helmet&lt;/a&gt; - Component which lets you control your document head using their React component. With this plugin, attributes you add in their component, e.g. title, meta attributes, etc. will get added to the static HTML pages Gatsby builds. This is important for SEO, which I will go over later on in this article.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Gbd0J6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1lnivw0v94ut02tlwz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Gbd0J6z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1lnivw0v94ut02tlwz8.png" alt="Tailwind CSS"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to build this blog, I wanted to explore some frameworks and libraries that could aid me in the CSS department. I had heard about &lt;a href="https://tailwindcss.com/"&gt;TailwindCSS&lt;/a&gt; before, but never used it and didn't know what it was about. So I decided to try it.&lt;/p&gt;

&lt;p&gt;Since then, it has become my favorite CSS framework, and I will definitely use it in many other web projects. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/"&gt;TailwindCSS&lt;/a&gt; is a low-level, customizable CSS framework that gives building blocks and common utility classes like &lt;code&gt;flex&lt;/code&gt;, &lt;code&gt;pt-4&lt;/code&gt; and &lt;code&gt;text-center&lt;/code&gt;, as opposed to providing pre-designed components like &lt;a href="https://getbootstrap.com/"&gt;Bootstrap&lt;/a&gt; does, for example.&lt;/p&gt;

&lt;p&gt;To be fair, you don't really need a CSS framework for building your website/blog, since it is a fairly simple project, but if you want to, here are a couple of reasons why you may want to consider TailwindCSS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It is a utility-first CSS framework meaning that, instead of giving you pre-designed components like &lt;code&gt;card&lt;/code&gt; or &lt;code&gt;carousel&lt;/code&gt;, it provides you with low-level classes like &lt;code&gt;font-medium&lt;/code&gt;, &lt;code&gt;rotate-90&lt;/code&gt; and &lt;code&gt;rounded-full&lt;/code&gt;. It gives you the opportunity to fully customize your site and make sure that it is unique and doesn't look like something that was "pre-defined" or "pre-built", which can happen if you use, for example, Bootstrap headers or cards. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's really easy to use, and you basically never have to leave your HTML. Here is a code snippet of one of the React components from this website:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fw_oYttG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgn5tflbmxd3mshskegh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fw_oYttG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgn5tflbmxd3mshskegh.png" alt="Tailwind Snippet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It helps you build a responsive website. It has special classes for defining different layouts and components at specific breakpoints, so you never have to write media queries. Example: using the classes &lt;code&gt;w-16&lt;/code&gt;, &lt;code&gt;md:w-32&lt;/code&gt; and &lt;code&gt;lg:w-48&lt;/code&gt; on a specific component helps you define different widths for different screen sizes. It also provides other prefixes like &lt;code&gt;hover:&lt;/code&gt; and &lt;code&gt;focus:&lt;/code&gt;. Simple.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Although Tailwind generates a lot of classes, it's build size is small in production, because it has the ability to purge and delete unused classes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It also has great documentation. &lt;a href="https://tailwindcss.com/docs"&gt;Take a look&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Netlify
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt; is, to put it simply, a platform that offers cloud hosting and serverless backend services. I used it to deploy and host my blog. It's free, easy to use, and has many useful features. &lt;/p&gt;

&lt;p&gt;It enables &lt;strong&gt;Continuous Deployment&lt;/strong&gt;, so anytime you push a new commit to your GitHub repository, Netlify automatically deploys the new version of your site. &lt;/p&gt;

&lt;p&gt;It also allows you to add security to your site with its Free SSL option with Let’s Encrypt. With one click install, HTTPS will instantly be available for your site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Namecheap
&lt;/h2&gt;

&lt;p&gt;If you use Netlify, your site will be deployed with a domain name like mywebsite.netlify.com. To change it to something like a .com extension, like I did, you can use &lt;a href="https://www.namecheap.com/"&gt;Namecheap&lt;/a&gt; to easily search and buy domains.&lt;/p&gt;

&lt;h1&gt;
  
  
  Some things I had in mind
&lt;/h1&gt;

&lt;p&gt;There were some things I had in mind and some decisions I made before and while building this project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developing from Scratch
&lt;/h2&gt;

&lt;p&gt;One thing that I decided to do from the beginning was to develop my website &lt;strong&gt;from scratch&lt;/strong&gt;. I made this decision because I wanted to make my website unique and also use it as an opportunity to work on a web development side project, and I felt like using a template was kind of cheating.&lt;/p&gt;

&lt;p&gt;However, if you want to spend less time coding and more time writing, Gatsby has a &lt;a href="https://www.gatsbyjs.com/starters/?"&gt;good collection of templates&lt;/a&gt; that you can use to speed up the process 😃&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimize SEO
&lt;/h2&gt;

&lt;p&gt;Another thing that I had in mind was that I needed to optimize the website's SEO before I made it public.&lt;/p&gt;

&lt;p&gt;SEO stands for &lt;strong&gt;Search Engine Optimization&lt;/strong&gt; and it involves the process of improving your site to increase its visibility for relevant searches. The better you optimize your blog for SEO, the higher your website will be listed on search engine result pages, so more people can find it.&lt;/p&gt;

&lt;p&gt;Gatsby is SEO-friendly, because all pages are server side rendered and all content is available to search engine crawlers. However, to improve my blog's SEO even further, I used the &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/"&gt;gatsby-plugin-react-helmet&lt;/a&gt; plugin to build an SEO component that I added to all pages. You can do the same by following &lt;a href="https://www.gatsbyjs.com/docs/add-seo-component/"&gt;this tutorial&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The topic of SEO is quite an extensive one, and there are a lot of things that you can do to improve it and make sure your site is fully optimized for search engines, so I advice you to research a little more into it 🧐&lt;/p&gt;

&lt;h1&gt;
  
  
  Things I want to do in the future
&lt;/h1&gt;

&lt;p&gt;Even though I am currently happy with my blog, there are still some features on the backlog that I plan to eventually add. They could also be useful for your personal blog, or at least inspire you to think about other features that could be useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  PWA
&lt;/h2&gt;

&lt;p&gt;PWAs, or &lt;strong&gt;Progressive Web Applications&lt;/strong&gt;, are (among other things) web apps that behave like native apps. They have a defined set of pre-requisites like being responsive, have app-like interactions and being installable.&lt;/p&gt;

&lt;p&gt;Gatsby already helps you with the majority of these things. You can use the &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-manifest/"&gt;gatsby-plugin-manifest&lt;/a&gt; to build a web manifest so users can add your site to their home screen on most mobile browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Offline Support
&lt;/h2&gt;

&lt;p&gt;One thing that would be useful and would go in hand with making your blog installable is to have an offline mode where users can navigate and read blog posts without being connected to the Internet. As you can imagine, there is also a plugin for that (Gatsby really is amazing). You can use the &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-offline/"&gt;gatsby-plugin-offline&lt;/a&gt; plugin to do just that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tags
&lt;/h2&gt;

&lt;p&gt;The majority of "blog" platforms where users can create posts and articles have tags that you can use in order to easily identify what are the main topics and subjects of a certain blog post. I feel like this is a useful feature and I intend to implement it on my personal blog in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  RSS Feed
&lt;/h2&gt;

&lt;p&gt;Finally, the last main feature that I have in mind for the future is to create an RSS feed for my blog posts and articles. An &lt;a href="https://en.wikipedia.org/wiki/RSS"&gt;RSS Feed&lt;/a&gt; is a standard XML file listing a website’s content in a subscribable format, allowing readers to consume your content in news aggregators, also called feed reader apps. &lt;/p&gt;

&lt;p&gt;Subscribing to a website's RSS removes the need for the user to manually check the website for new content. Instead, their browser constantly monitors the site and informs the user of any updates.&lt;/p&gt;

&lt;p&gt;You can do this with, you guessed it, a Gatsby plugin. &lt;a href="https://www.gatsbyjs.com/docs/how-to/adding-common-features/adding-an-rss-feed/"&gt;This Gatsby tutorial&lt;/a&gt; helps you create an RSS feed using the &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-feed/"&gt;gatsby-plugin-feed&lt;/a&gt; plugin, so your users never miss a blog post.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This was quite a long post, but I wanted to cover several topics. I wanted to explain why I think having a personal site and/or blog is beneficial for everyone, specially for software engineers and students, and that you can use it as a tool to expose yourself to the world and boost your career. We also went over how to get started building it using Gatsby and its incredible amount of plugins, how to create a unique design customized for your needs using TailwindCSS, and how to deploy and host your website in the end. We also went over some more advanced topics like SEO, RSS feeds and PWAs.&lt;/p&gt;

&lt;p&gt;I hope this article was useful to you and that you learned something with it. Hopefully it inspired you to create your own website or blog, if you don't already have one. Thank you for reading and until next time 🤩&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/mouhamedaly/how-i-created-my-blog-with-gatsby-1762"&gt;How I Created My Blog With Gatsby&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby Official Website&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.mediacurrent.com/blog/what-is-gatsbyjs/"&gt;What is GatsbyJS&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://tailwindcss.com/"&gt;Tailwind CSS Official Website&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://codeburst.io/six-reasons-why-you-should-start-using-tailwind-css-402292c50a70"&gt;Six Reasons Why You Should Start Using Tailwind CSS&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/joserfelix/why-use-tailwind-css-for-your-next-project-39hp"&gt;Why Use Tailwind CSS for Your Next Project&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/ogurinkaben/13-reasons-why-you-should-be-using-netlify-kgl"&gt;13 reasons why you should be using Netlify&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/@amberleyjohanna/seriously-though-what-is-a-progressive-web-app-56130600a093"&gt;Seriously though. What is a progressive web app?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/RSS"&gt;RSS: Wikipedia&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>web</category>
      <category>blog</category>
      <category>gatsby</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
