<?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>Forem: Marcos Mendes</title>
    <description>The latest articles on Forem by Marcos Mendes (@iamdevmarcos).</description>
    <link>https://forem.com/iamdevmarcos</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%2F875334%2F40dd194c-b1a6-45f5-b9a8-9777fda46168.jpeg</url>
      <title>Forem: Marcos Mendes</title>
      <link>https://forem.com/iamdevmarcos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iamdevmarcos"/>
    <language>en</language>
    <item>
      <title>Why Rust it's so good?</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Thu, 26 Dec 2024 13:16:22 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/why-rust-its-so-good-4nmh</link>
      <guid>https://forem.com/iamdevmarcos/why-rust-its-so-good-4nmh</guid>
      <description>&lt;h2&gt;
  
  
  Why is Rust such a beloved programming language?
&lt;/h2&gt;

&lt;p&gt;If you've heard of Rust, you might know it's one of the most loved programming languages among developers. But what makes Rust win over so many devs? There are several reasons for this, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficient memory management&lt;/strong&gt;: Rust provides extremely effective control, leading to fewer bugs and security vulnerabilities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Active and welcoming community&lt;/strong&gt;: The Rust community is renowned for supporting new developers on forums and social platforms like Reddit and Discord.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High-quality documentation&lt;/strong&gt;: Learning Rust is made easier by its detailed and accessible documentation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concurrency support&lt;/strong&gt;: Rust simplifies the use of multiple threads safely and efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rust for Beginners?
&lt;/h3&gt;

&lt;p&gt;Despite the advantages mentioned above, Rust is not the most recommended language for beginners. Its ownership system and safety checks require a solid understanding of programming basics, making it better suited for those with prior experience.&lt;/p&gt;

&lt;p&gt;A highly recommended resource to ease the learning process is The Rust Programming Language book, also known as The Rust Book.&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="https://doc.rust-lang.org/book/" rel="noopener noreferrer"&gt;https://doc.rust-lang.org/book/&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Let’s explore these points in more detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rust excels at preventing common issues like memory leaks. During compilation, Rust performs strict checks, catching many errors before the program runs.&lt;/p&gt;

&lt;p&gt;One reason for this safety is the concept of ownership:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every value in Rust has a single owner&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When this owner goes out of scope, the memory is automatically released&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This model eliminates the need for traditional garbage collectors, resulting in more efficient resource management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rust offers low-level memory control similar to languages like C and C++ but with the safety of a modern language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This allows programs written in Rust to be fast and efficient.&lt;/li&gt;
&lt;li&gt;The Rust compiler uses LLVM to generate highly optimized code, achieving performance comparable to C.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;&lt;br&gt;
Rust makes writing concurrent code easier by including safety checks at compile time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;These mechanisms prevent issues like race conditions and make leveraging the power of multicore CPUs safer and more intuitive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tools and Ecosystem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rust comes with powerful tools that enhance developer productivity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compiler&lt;/strong&gt;: Provides clear error messages, simplifying debugging and problem-solving.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cargo&lt;/strong&gt;: Rust's package manager makes building projects and managing dependencies straightforward, functioning similarly to NPM for Rust.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Active Community&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As an open-source project, Rust benefits from contributions from developers worldwide.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The community stands out for creating libraries and tools that enrich the ecosystem.&lt;/li&gt;
&lt;li&gt;Forums and platforms like Reddit and Discord offer support for newcomers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-World Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Major companies like Mozilla, Dropbox, and Cloudflare have adopted Rust for their projects. They have reported several benefits, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enhanced security.&lt;/li&gt;
&lt;li&gt;Improved performance.&lt;/li&gt;
&lt;li&gt;Easier code maintenance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Others companys that use Rust -&amp;gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Code Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory Management with Ownership&lt;/strong&gt;&lt;br&gt;
Here's how the concept of ownership works in practice:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Performance: Counting from 1 to 1 million&lt;/strong&gt;&lt;br&gt;
A simple example demonstrating Rust's efficiency:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Concurrency with Threads&lt;/strong&gt;&lt;br&gt;
Calculate the sum of numbers in parallel safely:&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Using Cargo to Create and Run a Project&lt;/strong&gt;&lt;br&gt;
Creating and running a new project is simple:&lt;/p&gt;

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

&lt;p&gt;Conclusion&lt;br&gt;
Rust combines safety, performance, and productivity in a modern programming language. Its robust ecosystem and engaged community make learning it more accessible to those with some programming experience. Although challenging at first, Rust's benefits make the effort highly rewarding.&lt;/p&gt;




&lt;p&gt;Follow me on social media:&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/iamdevmarcos" rel="noopener noreferrer"&gt;https://github.com/iamdevmarcos&lt;/a&gt;&lt;br&gt;
Linkedin: &lt;a href="https://www.linkedin.com/in/iamdevmarcos/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/iamdevmarcos/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webdev</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>React Hydration Explained</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Tue, 19 Nov 2024 17:17:20 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/react-hydration-explained-3lk0</link>
      <guid>https://forem.com/iamdevmarcos/react-hydration-explained-3lk0</guid>
      <description>&lt;p&gt;Definition of Hydration by Dan Abramov (Create React App and Redux): &lt;em&gt;"Hydration is like watering 'dry' HTML with the 'water' of user interactivity and event handlers."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hydration is an advanced and fundamental topic for better understanding how React works. Before diving deeper into this concept, let’s briefly review some important topics:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Client-Side Rendering (CSR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Client-side rendering occurs when all pages are loaded and rendered directly in the browser using JavaScript. In this way, the browser is responsible for handling all requests (&lt;em&gt;data fetching&lt;/em&gt;), managing loading states, and other interactions.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;2. Server-Side Rendering (SSR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In server-side rendering, pages are generated on the server using JavaScript and sent as HTML to the client. This process optimizes data fetching on the server, improving the user experience. In SSR, the initial HTML is loaded while the JavaScript needed for interactivity is loaded in the background.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;What is React Hydration?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hydration&lt;/em&gt; is the process of taking pre-rendered HTML on the server and making it interactive in the browser. In other words, React checks the existing HTML and associates the necessary JavaScript to activate the components, enabling interactivity.&lt;/p&gt;

&lt;p&gt;This speeds up page loading since the static content (initial HTML) is quickly loaded while interactivity is enabled afterward.&lt;/p&gt;

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

&lt;p&gt;It is worth noting that &lt;em&gt;hydration&lt;/em&gt; does not directly apply to libraries or frameworks that function only on the client (&lt;em&gt;client-only&lt;/em&gt;), such as React when used exclusively on the client side.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why don’t client-only frameworks have Hydration?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Client-only&lt;/em&gt; frameworks or libraries, such as React in a pure CSR model, render pages directly in the browser, generating the DOM from scratch with JavaScript. In this case, there is no pre-rendered HTML from the server to be “hydrated.”&lt;/p&gt;

&lt;p&gt;Thus, &lt;em&gt;client-only&lt;/em&gt; frameworks use a process known as &lt;em&gt;Client-Side Rendering (CSR)&lt;/em&gt;, and the concept of &lt;em&gt;hydration&lt;/em&gt; does not apply to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explained simply&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you have a page ready and already rendered with all visible content, but it does nothing when you click buttons. The role of React Hydration is to bring this page to life, connecting what you see on the screen to the code responsible for making it interactive.&lt;/p&gt;

&lt;p&gt;When React performs the &lt;em&gt;hydration&lt;/em&gt; process, it "animates" the page, linking the visible components to the code, making buttons and other elements functional and interactive in the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hydration in React 19&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React 19, the &lt;code&gt;hydrate&lt;/code&gt; method (responsible for &lt;em&gt;hydration&lt;/em&gt;) was removed and replaced with the &lt;code&gt;hydrateRoot&lt;/code&gt; method. Below is an example of how it was before and how it is now:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hydrate&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;hydrate&lt;/span&gt;&lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;hydrateRoot&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom/client&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;hydrateRoot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;App&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This update was introduced by the React team to improve the &lt;em&gt;hydration&lt;/em&gt; process and compatibility with new APIs in React 19.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main differences:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hydrate&lt;/code&gt; &lt;strong&gt;(React 18 and earlier):&lt;/strong&gt; Starts the &lt;em&gt;hydration&lt;/em&gt; process at the point where the server left off with the HTML.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hydrateRoot&lt;/code&gt; &lt;strong&gt;(React 18 and later):&lt;/strong&gt; Replaces &lt;code&gt;hydrate&lt;/code&gt; and provides a more modern and flexible API, especially to support features like &lt;em&gt;streaming&lt;/em&gt; and transitions in React.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s basically it about hydration ;)&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Content Delivery Network Explained !</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Sun, 21 Apr 2024 00:09:52 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/content-delivery-network-explained-5cpf</link>
      <guid>https://forem.com/iamdevmarcos/content-delivery-network-explained-5cpf</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🇺🇸 English&lt;/li&gt;
&lt;li&gt;🇧🇷 Portuguese&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why does a CDN exist? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Let's imagine we are an Amazon Prime user, located in Sao_Paulo/Brazil, while Amazon is based in the United States.&lt;/p&gt;

&lt;p&gt;Given this setup, all of Amazon's movies and series are stored in the United States, so every time you want to watch something, you will have to make a request over a long distance to Amazon in the United States.&lt;/p&gt;

&lt;p&gt;At first glance, we can see that using this method is not scalable and comes with several problems, such as:&lt;/p&gt;

&lt;p&gt;1 - Latency&lt;br&gt;
2 - Distributing data at speed over very long distances&lt;br&gt;
3 - Data distribution capacity&lt;/p&gt;

&lt;h2&gt;
  
  
  What exactly is a CDN?
&lt;/h2&gt;

&lt;p&gt;A CDN or Content Delivery Network is a distributed network of proxy servers.&lt;/p&gt;

&lt;p&gt;The idea is that the content from Amazon Prime, which is stored in the United States, is replicated across various proxy servers distributed worldwide.&lt;/p&gt;

&lt;p&gt;In practice, when someone located in Sao_Paulo/Brazil, for example, wants to watch a movie or series, a request will be made to the nearest CDN instead of to Amazon’s origin servers.&lt;/p&gt;

&lt;p&gt;This way, latency is greatly reduced, and data distribution happens much faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Functional requirements of a CDN:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve&lt;/strong&gt;: Needs to be able to request content from the origin server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request&lt;/strong&gt;: Must be able to respond to the user when they request content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delivery&lt;/strong&gt;: If the CDN is a Push Model, the origin server needs to be able to push content to the CDN&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search&lt;/strong&gt;: Needs to be capable of searching content within its infrastructure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update&lt;/strong&gt;: Proxies should be able to update each other&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete&lt;/strong&gt;: Must be capable of clearing cache, if necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Non-functional requirements:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Performance&lt;/li&gt;
&lt;li&gt;Availability&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Readability&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How does the CDN work between the Origin and the Client?
&lt;/h2&gt;

&lt;p&gt;To simplify, the Client (User) makes a request, this request communicates with the nearest CDN, if the content is already saved in cache, the CDN returns the response to the user and completes the request.&lt;/p&gt;

&lt;p&gt;If it is new content that is not stored in Cache, the CDN communicates with the Origin Servers to search for the new content, and the origin server delivers this content back to the CDN, which then delivers the content to the user.&lt;/p&gt;

&lt;p&gt;Image below for better understanding:&lt;/p&gt;

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

&lt;p&gt;Well, this is a very simple explanation of how a CDN works and what it is, there are several other topics we can delve into to understand more about CDNs.&lt;/p&gt;



&lt;h2&gt;
  
  
  Porque uma CDN existe? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Vamos imaginar que somos um usuário da Amazon Prime, e estamos localizados em Sao_Paulo/Brazil e a Amazon está localizada nos Estados Unidos.&lt;/p&gt;

&lt;p&gt;Dado essa ideia, todos os filmes e series da Amazon, estão armazenados nos Estados Unidos, então toda vez que voce quiser assistir algo voce vai ter que fazer uma requisição de uma longa distancia para a Amazon que está nos estados unidos.&lt;/p&gt;

&lt;p&gt;A primeira vista, já percebemos que usar essa forma não é escalável e tem vários problemas, tais como:&lt;/p&gt;

&lt;p&gt;1 - Latência&lt;br&gt;
2 - Distribuir dados com velocidade entre distancias muito longas&lt;br&gt;
3 - Capacidade de distribuição de dados&lt;/p&gt;

&lt;h2&gt;
  
  
  O que é uma CDN de fato?
&lt;/h2&gt;

&lt;p&gt;Uma CDN ou Content Delivery Network é uma rede distribuída de servidores proxy.&lt;/p&gt;

&lt;p&gt;A ideia é que o conteúdo da Amazon Prime que está nos Estados Unidos, seja replicada em vários servidores proxy distribuídos no mundo inteiro.&lt;/p&gt;

&lt;p&gt;Na pratica, quando alguém que estiver localizado em Sao_Paulo/Brazil por exemplo, quiser assistir um filme ou serie, será realizada uma requisição para uma CDN que estiver mais próxima do usuário, ao invés de fazer uma requisição para os servidores de origem da Amazon.&lt;/p&gt;

&lt;p&gt;Desse modo, a latência é muito menor e a distribuição de dados acontece muito mais rápido.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requisitos funcionais de uma CDN:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve&lt;/strong&gt;: Precisa ser capaz de solicitar conteúdo do servidor de origem&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request&lt;/strong&gt;: Precisa ser capaz de responder ao usuário quando ele solicitar conteúdo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delivery&lt;/strong&gt;: Caso a CDN seja uma Push Model, o servidor de origem precisa ser capaz de dar push no conteúdo para a CDN&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search&lt;/strong&gt;: Precisa ser capaz de buscar conteúdo dentro da infra da mesma&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update&lt;/strong&gt;: Proxy's devem ser capazes de fazer update entre si&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Delete&lt;/strong&gt;: Deve ser capaz de limpar cache, caso necessário.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Requisitos não funcionais:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Perfomance&lt;/li&gt;
&lt;li&gt;Disponibilidade&lt;/li&gt;
&lt;li&gt;Escalabilidade&lt;/li&gt;
&lt;li&gt;Legibilidade&lt;/li&gt;
&lt;li&gt;Segurança&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Como a CDN funciona entre o Origin e o Client ?
&lt;/h2&gt;

&lt;p&gt;Para simplificar, o Client (Usuário) faz uma requisição, essa mesma requisição se comunica com a CDN mais próxima, se o conteúdo já estiver salvo em cache, a CDN devolve a resposta para o usuário e finaliza a requisição.&lt;/p&gt;

&lt;p&gt;Caso seja um conteúdo novo que não esteja armazenado em Cache, a CDN se comunica com os servidores de Origem (Origin Server) para buscar pelo novo conteúdo, e o origin server devolve esse conteúdo para a mesma, e a CDN devolve o conteúdo para o usuário.&lt;/p&gt;

&lt;p&gt;Imagem abaixo para melhor entendimento:&lt;/p&gt;

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

&lt;p&gt;Bom isto é uma explicação bem simples de como funciona e o que é uma CDN, existem vários outros tópicos que podemos nos aprofundar para entendermos mais sobre a CDN.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>career</category>
      <category>security</category>
    </item>
    <item>
      <title>Test-Driven Development</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Thu, 26 Oct 2023 16:50:12 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/test-driven-development-43p3</link>
      <guid>https://forem.com/iamdevmarcos/test-driven-development-43p3</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🇺🇸 English&lt;/li&gt;
&lt;li&gt;🇧🇷 Portuguese&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's TDD ? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;TDD or Test-driven development it's a software development practice that emphasizes creating automated tests before writing the actual code. The TDD process follows a repetitive cycle of three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write a test&lt;/strong&gt;: Initially, you write an automated test that describes the behavior you want to implement in the code. This test typically fails initially because the functionality is not yet implemented.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write code that satisfies the test&lt;/strong&gt;: Next, you write the production code needed to make the test pass. The goal is to make the code pass the test and nothing more. This promotes incremental development and a focus on the requirement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Refactor the code&lt;/strong&gt;: After making the test pass, you can refactor the code, improving its structure and quality without changing its external behavior. Existing tests help ensure that changes do not break existing functionality.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;The TDD cycle is repeated multiple times, with each new test covering a specific aspect of the functionality being developed. This ensures comprehensive testing of the code and that the functionality meets the established requirements. TDD also promotes the creation of a robust set of automated tests that can be run regularly to verify code integrity.&lt;/p&gt;

&lt;p&gt;TDD is often associated with agile software development practices and is considered an effective approach to improving code quality and maintainability.&lt;/p&gt;




&lt;h2&gt;
  
  
  O que é TDD ? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;TDD é a sigla para Test-Driven Development. É uma prática de desenvolvimento de software que enfatiza a criação de testes automatizados antes da implementação real do código. O processo TDD segue um ciclo repetitivo de três passos:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Escrever um teste&lt;/strong&gt;: Inicialmente, você escreve um teste automatizado que descreve o comportamento que você deseja implementar no código. Esse teste geralmente falha inicialmente, pois a funcionalidade ainda não está implementada.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Escreva o código que satisfaça o teste&lt;/strong&gt;: Em seguida, você escreve o código de produção necessário para fazer o teste passar. O objetivo é fazer o código passar no teste e nada mais. Isso promove um desenvolvimento incremental e focado no requisito.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Refatorar o código&lt;/strong&gt;: Após fazer o teste passar, você pode refatorar o código, melhorando sua estrutura e qualidade sem alterar seu comportamento externo. Os testes existentes ajudam a garantir que as alterações não quebram a funcionalidade existente.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;O ciclo TDD é repetido várias vezes, com cada novo teste cobrindo um aspecto específico da funcionalidade que está sendo desenvolvida. Isso ajuda a garantir que o código seja testado de forma abrangente e que a funcionalidade atenda aos requisitos estabelecidos. TDD também promove a criação de um conjunto de testes automatizados robustos que podem ser executados regularmente para verificar a integridade do código.&lt;/p&gt;

&lt;p&gt;O TDD é frequentemente associado a práticas ágeis de desenvolvimento de software e é considerado uma abordagem eficaz para melhorar a qualidade do código e a manutenibilidade do software.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Java works ?</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Fri, 20 Oct 2023 22:57:50 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/how-java-works--44i6</link>
      <guid>https://forem.com/iamdevmarcos/how-java-works--44i6</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🇺🇸 English&lt;/li&gt;
&lt;li&gt;🇧🇷 Portuguese&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Java works ? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;One of the main characteristics of Java is its ability to &lt;strong&gt;write once, run anywhere&lt;/strong&gt;, therefore Java is a language with the concept of being cross-platform, this means that we can write code on a certain platform (MacOS for example), and we have the ability to use the same code on different platforms (Windows or Linux).&lt;/p&gt;

&lt;p&gt;For example, we have a simple code written in Java and we use MacOS as the platform:&lt;/p&gt;

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

&lt;p&gt;Let's suppose we need to run this same code in a Windows or Linux environment, what should we do?&lt;/p&gt;

&lt;p&gt;By default, our machine (Windows, Mac or Linux) cannot understand code written in Java, after writing our source code, we need to convert this code to a format that our machine needs to understand, and at that moment we need a little guy called &lt;strong&gt;JavaC (Java Compiler)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Compiler (JavaC)
&lt;/h2&gt;

&lt;p&gt;JavaC will receive our source code and compile it to &lt;strong&gt;ByteCode&lt;/strong&gt;, after compilation we still cannot use it directly on our platforms.&lt;/p&gt;

&lt;p&gt;After compiling our source code to &lt;strong&gt;ByteCode&lt;/strong&gt;, another little guy comes into action, called &lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Virtual Machine (JVM)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt; is a virtual machine that interprets and executes our &lt;strong&gt;ByteCode&lt;/strong&gt; generated by &lt;strong&gt;JavaC&lt;/strong&gt; at run time, and one of the main characteristics of the &lt;strong&gt;JVM&lt;/strong&gt; is the Its ability to guarantee the portability of our ByteCode, allowing the same ByteCode that was generated on MacOS to be executed on a Windows JVM or a Linux JVM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compiled or Interpreted ?
&lt;/h2&gt;

&lt;p&gt;So in the end, is Java a compiled or interpreted language? Java is a compiled and then interpreted language.&lt;/p&gt;

&lt;p&gt;This occurs because our source code is first compiled by JavaC and generated the ByteCode, and then this same ByteCode will be interpreted by the JVM in a way that the platforms can execute.&lt;/p&gt;

&lt;p&gt;1 - Source code compiled by JavaC and generated ByteCode.&lt;br&gt;
2 - ByteCode is interpreted by the JVM and executed.&lt;/p&gt;

&lt;p&gt;And now after understanding this entire concept above, how do we install the JVM on our machine?&lt;/p&gt;

&lt;p&gt;Now we have &lt;strong&gt;two options&lt;/strong&gt;, install the JRE or JDK.&lt;/p&gt;

&lt;h2&gt;
  
  
  JRE
&lt;/h2&gt;

&lt;p&gt;The Java Runtime Environment (JRE) is the execution environment for Java.&lt;/p&gt;

&lt;p&gt;The JRE will provide the JVM, but it will only be what we need to run our application.&lt;/p&gt;

&lt;p&gt;What will I have inside the JRE?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM.&lt;/li&gt;
&lt;li&gt;Libraries to be able to run our application.&lt;/li&gt;
&lt;li&gt;Supports and resources needed to run our application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JDK
&lt;/h2&gt;

&lt;p&gt;The Java Development Kit (JDK), as the acronym itself says, is the development kit for Java.&lt;/p&gt;

&lt;p&gt;The JDK is a set of tools and utilities necessary for us to be able to develop our application, and it will also provide &lt;strong&gt;everything that the JRE implements&lt;/strong&gt;, that is, when we install the JDK we also install the JRE, and also we have other utilities such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaC (Java Compiler).&lt;/li&gt;
&lt;li&gt;Debugger.&lt;/li&gt;
&lt;li&gt;Utilities to assist us in our development.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this we have an understanding of the concept of how Java is compiled and interpreted and its utilities.&lt;/p&gt;




&lt;h2&gt;
  
  
  Como funciona o Java ? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Uma das principais características do Java é a capacidade que ele tem de ser um &lt;strong&gt;Write once, Run anywhere (Escreva uma vez, execute em qualquer lugar)&lt;/strong&gt;, então o Java é uma linguagem com conceito para ser multi-plataforma, isso significa que nós podemos escrever um código em uma determinada plataforma (MacOS por exemplo), e nós temos a capacidade de usar o mesmo código em diversas plataformas (Windows ou Linux). &lt;/p&gt;

&lt;p&gt;Por exemplo nós temos um código simples escrito em Java e utilizamos o MacOS como plataforma:&lt;/p&gt;

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

&lt;p&gt;Vamos supor que nós precisamos rodar esse mesmo código em um ambiente Windows ou Linux, o que devemos fazer ?&lt;/p&gt;

&lt;p&gt;Por padrão a nossa maquina (Windows, Mac ou Linux) não consegue entender um código escrito em Java, após escrever o nosso código fonte, nós precisamos converter esse código para um formato que nossa máquina precisa entender, e nesse momento precisamos de um carinha chamado &lt;strong&gt;JavaC (Java Compiler)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Compiler (JavaC)
&lt;/h2&gt;

&lt;p&gt;O JavaC vai receber o nosso código fonte e vai compilar para &lt;strong&gt;ByteCode&lt;/strong&gt;, após a compilação ainda não conseguimos utilizar ele diretamente nas nossas plataformas.&lt;/p&gt;

&lt;p&gt;Após a compilação do nosso código fonte para &lt;strong&gt;ByteCode&lt;/strong&gt;, um outro carinha entra em ação, chamado &lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Virtual Machine (JVM)
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;JVM (Java Virtual Machine)&lt;/strong&gt; é uma maquina virtual que interpreta e executa nosso &lt;strong&gt;ByteCode&lt;/strong&gt; gerado pelo &lt;strong&gt;JavaC&lt;/strong&gt; em tempo de execução, e uma das principais características da &lt;strong&gt;JVM&lt;/strong&gt; é a capacidade que ela tem de garantir a portabilidade do nosso ByteCode, permitindo que o mesmo ByteCode que foi gerado no MacOS consiga ser executado em uma JVM do Windows ou uma JVM do Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compilada ou Interpretada ?
&lt;/h2&gt;

&lt;p&gt;Então no fim das contas, o Java é uma linguagem compilada ou interpretada ? O Java é uma linguagem compilada e depois interpretada.&lt;/p&gt;

&lt;p&gt;Isso ocorre, devido o nosso código fonte ser primeiro compilado pelo JavaC e gerado o ByteCode, e depois esse mesmo ByteCode vai ser interpretado pela JVM de uma forma que as plataformas consigam executar.&lt;/p&gt;

&lt;p&gt;1 - Código fonte compilado pelo JavaC e gerado o ByteCode.&lt;br&gt;
2 - ByteCode é interpretado pela JVM e executado.&lt;/p&gt;

&lt;p&gt;E agora depois de entender todo esse conceito acima, como a gente faz para instalar a JVM na nossa máquina ?&lt;/p&gt;

&lt;p&gt;Agora temos &lt;strong&gt;duas opções&lt;/strong&gt;, instalar o JRE ou o JDK.&lt;/p&gt;

&lt;h2&gt;
  
  
  JRE
&lt;/h2&gt;

&lt;p&gt;O Java Runtime Environment (JRE) é o ambiente de execução do Java.&lt;/p&gt;

&lt;p&gt;O JRE fornecerá a JVM, mas será apenas o que precisamos para executar nossa aplicação.&lt;/p&gt;

&lt;p&gt;O que eu vou ter dentro do JRE ?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM.&lt;/li&gt;
&lt;li&gt;Bibliotecas para ser possível executar nossa aplicação.&lt;/li&gt;
&lt;li&gt;Suportes e recursos necessários para executar nossa aplicação.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JDK
&lt;/h2&gt;

&lt;p&gt;O Java Development Kit (JDK) como a própria sigla já diz, é o kit de desenvolvimento para Java.&lt;/p&gt;

&lt;p&gt;A JDK é um conjunto de ferramentas e utilitários necessários para que a gente consiga fazer o desenvolvimento da nossa aplicação, e também vai fornecer &lt;strong&gt;tudo que a JRE implementa&lt;/strong&gt;, ou seja, quando instalamos a JDK também instalamos a JRE, e também temos outros utilitários como:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaC (Java Compiler).&lt;/li&gt;
&lt;li&gt;Debugger.&lt;/li&gt;
&lt;li&gt;Utilitários para nos auxiliar no nosso desenvolvimento.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Com isso temos um entendimento do conceito de como o Java é compilado e é interpretado e seus utilitários.&lt;/p&gt;

</description>
      <category>java</category>
      <category>backend</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Node.js - O que é, como funciona</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Tue, 08 Aug 2023 23:58:45 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/nodejs-o-que-e-como-funciona-gmk</link>
      <guid>https://forem.com/iamdevmarcos/nodejs-o-que-e-como-funciona-gmk</guid>
      <description>&lt;h2&gt;
  
  
  O que é o Node.js?
&lt;/h2&gt;

&lt;p&gt;Diferente do que muitos pensam o &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; não é uma linguagem de programação, e sim uma plataforma (runtime) que permite rodar código &lt;a href="https://developer.mozilla.org/pt-BR/docs/Web/JavaScript" rel="noopener noreferrer"&gt;JavaScript&lt;/a&gt; (que no caso é uma linguagem de programação) no Servidor.&lt;/p&gt;

&lt;p&gt;Bom, inicialmente o JavaScript foi criado para rodar apenas em Browsers, porém em 2008 foi lançada uma nova versão do Google Chrome e junto com essa nova versão veio o &lt;a href="https://v8.dev/" rel="noopener noreferrer"&gt;V8&lt;/a&gt; que é um &lt;a href="https://blog.geekhunter.com.br/metodos-de-traducao-compiladores-ou-interpretadores/#O_que_e_compilador" rel="noopener noreferrer"&gt;interpretador de código&lt;/a&gt; JavaScript.&lt;/p&gt;

&lt;p&gt;E em 2009, um engenheiro de software chamado &lt;a href="https://github.com/ry" rel="noopener noreferrer"&gt;Ryan Dahl&lt;/a&gt; executou o V8 no Servidor, ou seja, fez com que o código JavaScript fosse interpretado no lado do Servidor em vez do lado do Cliente (Browsers), e com isso nasceu o que a gente conhecem hoje como Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  Como o Node.js executa nosso código?
&lt;/h2&gt;

&lt;p&gt;Vamos começar entendendo sobre Call Stack, Thread Pool, Event Loop e Callback Queue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call Stack&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A call stack é a pilha de processamento do nosso código, ou seja, todas as funções que executarmos irão para essa pilha (stack).&lt;/p&gt;

&lt;p&gt;Vamos a um exemplo prático da Call Stack e vamos analisar o código abaixo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function multiply(x, y) {
  return x * y;
}

function printSquare(x) {
  const square = multiply(x, x);
  console.log(square);
}

printSquare(5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ao rodarmos o código acima, o JavaScript irá ler de cima para baixo, declarar as duas funções (&lt;code&gt;multiply&lt;/code&gt; e &lt;code&gt;printSquare&lt;/code&gt;) e ao final de tudo, irá invocar a função &lt;code&gt;printSquare&lt;/code&gt; passando o valor 5 no argumento.&lt;/p&gt;

&lt;p&gt;Veja a imagem abaixo para melhor compreensão.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Step 1. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Quando invocamos a função &lt;code&gt;printSquare&lt;/code&gt;, é aqui que entra a nossa Call Stack em ação, como mencionei anteriormente, todas as funções que executamos no nosso código vão para a nossa call stack (pilha de processamento), então a função printSquare já está lá.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Step 2. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Dentro da função &lt;code&gt;printSquare&lt;/code&gt;, a gente chama na primeira linha a função &lt;code&gt;multiply&lt;/code&gt;, então a função &lt;code&gt;multiply&lt;/code&gt;, também entra na pilha de chamadas.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Step 3. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Bem, dentro da função &lt;code&gt;multiply&lt;/code&gt; não vamos mais a nenhum lugar, não chamamos nenhuma outra função ou algo do tipo, simplesmente pegamos os argumentos x e y multiplicamos um pelo outro e retornamos o resultado, então a partir do momento que a função &lt;code&gt;multiply&lt;/code&gt; está retornando o resultado, o papel dela é concluído e ela sai da nossa pilha de chamadas.&lt;/p&gt;

&lt;p&gt;E agora, voltando para dentro da função &lt;code&gt;printSquare&lt;/code&gt;, chamamos um &lt;code&gt;console.log()&lt;/code&gt; para mostrar o resultado, então a função &lt;code&gt;console.log&lt;/code&gt; entra na nossa pilha de chamadas, é executada e depois sai da pilha.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Step 4 &amp;amp; 5: &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;E agora, como não temos mais nada para fazer dentro da função &lt;code&gt;printSquare&lt;/code&gt;, o processamento do nosso código acabou e a função &lt;code&gt;printSquare&lt;/code&gt; também sai da nossa call stack. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bom, com isso já conseguimos notar uma &lt;strong&gt;característica&lt;/strong&gt; da Call Stack: &lt;code&gt;A primeira função que entra é a última que sai.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A call stack tem muito peso em nosso código e por isso é muito importante sabermos sobre sua existência e entender como ela funciona.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single Thread&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Outra característica do &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; é que ele é Single Thread, ou seja, só pode executar uma tarefa por vez.&lt;/p&gt;

&lt;p&gt;“Mas como assim ele só executa uma tarefa por vez, ouço todo mundo falando que o Node.js é Non-Blocking I/O, ou seja, tem entrada e saída de dados de forma não bloqueante”.&lt;/p&gt;

&lt;p&gt;De fato, o &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; não pode executar mais de uma tarefa por vez, temos apenas 1 call stack, e enquanto ela estiver ocupada, não podemos executar mais nada.&lt;/p&gt;

&lt;p&gt;“Então, por que falam que o Node.js é Non-Blocking I/O e que pode executar mais de uma tarefa ao mesmo tempo?”&lt;/p&gt;

&lt;p&gt;Porque de fato ele é &lt;strong&gt;Non-Blocking I/O&lt;/strong&gt; e também de fato ele pode &lt;strong&gt;executar mais de uma tarefa ao mesmo tempo&lt;/strong&gt;, e ele consegue fazer isto mesmo sendo Single Thread, porque por debaixo dos panos ele roda em uma biblioteca escrita em C chamada &lt;strong&gt;&lt;a href="https://libuv.org/" rel="noopener noreferrer"&gt;libuv&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A libuv implementa o Thread Pool e o Event Loop, também implementa toda a parte do filesystem do Node, DNS e etc. A libuv é uma biblioteca muito completa e dá muitos poderes ao Node.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Se quiser conhecer mais sobre a libuv, aqui estão alguns links uteis:&lt;br&gt;
&lt;a href="https://libuv.org/" rel="noopener noreferrer"&gt;Site oficial&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/libuv/libuv" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/libuv-in-node-js/" rel="noopener noreferrer"&gt;Libuv no Node.js&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bem, vamos prosseguir, considere o seguinte código:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log('Before.');

db.query(query, function callback(error, data) {
  console.log(data);
});

console.log('After.')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Logo na primeira linha temos um &lt;code&gt;console.log&lt;/code&gt; que já entra em nossa pilha de chamadas, é executado e sai dela.&lt;/p&gt;

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

&lt;p&gt;Depois disso, vamos para a linha debaixo, onde temos a função db.query, e é aqui que começa a diversão.&lt;/p&gt;

&lt;p&gt;Essa função db.query é o que chamamos de função bloqueante, o que significa que ela leva um certo tempo para ser executada, pois nesse caso ela precisa se conectar ao banco de dados, executar uma consulta, aguardar a resposta do banco de dados, e trazer as informações de volta, e tudo isso leva um certo tempo, e se o Node não tomasse nenhuma ação em cima disso, essa função db.query ficaria presa em nossa call stack, bloqueando a execução do código, ou seja, não poderíamos passar para a próxima linha até que a função db.query fosse resolvida, e é por essa razão que chamamos ela de função bloqueante, porque ela bloqueia nossa pilha de processamento.&lt;/p&gt;

&lt;p&gt;Porém, o Node.js não deixa isso acontecer, pois ele entende que essa função db.query vai bloquear a call stack, então ele pega e joga essa função para dentro da Thread Pool e a remove da nossa call stack.&lt;/p&gt;

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

&lt;p&gt;Enquanto nossa query está sendo executada dentro da Thread Pool, nosso código continua sendo executado, então ele vai normalmente para nosso &lt;code&gt;console.log()&lt;/code&gt; da última linha, executa e o remove logo em seguida, e a execução do código principal termina.&lt;/p&gt;

&lt;p&gt;Então lá na Thread Pool, a query está sendo executada e após terminar a execução da mesma, a função de callback do db.query é lançada na “Callback Queue”.&lt;/p&gt;

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

&lt;p&gt;Após a função de callback da db.query estar dentro da callback queue, o Event Loop entra em ação, pense nele como um while(true) que fica sempre verificando se existe alguma função pronta para ser executada dentro da callback queue.&lt;/p&gt;

&lt;p&gt;Se o Event loop encontrar alguma função que está pronta para ser executada e nossa pilha de chamadas não tiver mais funções pendentes para serem executadas, ele puxa essa função que está pronta para ser executada para a pilha de chamadas e continua processando o código normalmente.&lt;/p&gt;

&lt;p&gt;Lembra que dentro da função de callback da query.db tínhamos um &lt;code&gt;console.log&lt;/code&gt; ? Então, em seguida, ele será executado e após sua execução será removido da pilha. E agora, como nossa função de callback não tem mais nada para executar, ela também é retirada da pilha.&lt;/p&gt;

&lt;p&gt;E é assim que o Node.js consegue executar código assíncrono.&lt;/p&gt;

&lt;p&gt;Bom, isso é tudo que eu pretendia escrever para esse post, talvez em um próximo post, eu escreva mais do funcionamento do Node e etc.&lt;/p&gt;

&lt;p&gt;Espero que tenha lhe ajudado de alguma forma, seu feedback (positivo ou negativo) é sempre bem-vindo :D&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Five Things Every iOS Developers Must To Know</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Tue, 25 Jul 2023 12:27:48 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/five-things-every-ios-developers-must-to-know-1bjb</link>
      <guid>https://forem.com/iamdevmarcos/five-things-every-ios-developers-must-to-know-1bjb</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Xcode&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Xcode is the official integrated development environment (IDE) for iOS app development. It includes everything needed to design, develop, and test iOS apps, as well as publish them to the App Store. Xcode includes features like a code editor, debugging tools, Interface Builder, and simulators.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Swift&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Swift is Apple’s programming language used for developing iOS apps. It is a fast and efficient language designed to work with Apple’s frameworks and APIs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CocoaPods&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;CocoaPods is a dependency manager for iOS app development. It helps manage third-party libraries and frameworks, making it easy to integrate them into an iOS project. CocoaPods simplifies the process of adding and updating dependencies, and it includes tools for resolving version conflicts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;GitHub is a web-based platform for version control and collaboration. It is a great tool for iOS developers who want to manage their code and work with other developers on a project. GitHub provides features like pull requests, issue tracking, and code reviews.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Firebase&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Firebase is a mobile and web application development platform that provides a suite of tools and services for iOS app development. It includes features like authentication, real-time database, cloud storage, and analytics. Firebase helps iOS developers build high-quality apps quickly and easily.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Swift - Data Types Explained</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Tue, 28 Feb 2023 13:27:24 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/swift-data-types-explained-3oic</link>
      <guid>https://forem.com/iamdevmarcos/swift-data-types-explained-3oic</guid>
      <description>&lt;p&gt;Hello everyone, today I want talk a little bit about Data Types in Swift.&lt;/p&gt;

&lt;p&gt;Data Types are the most important part of any programming language. Swift support six data types: &lt;code&gt;Int&lt;/code&gt;, &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Float&lt;/code&gt;, &lt;code&gt;Double&lt;/code&gt;, &lt;code&gt;Bool&lt;/code&gt; and &lt;code&gt;Character&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So let's start.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;1. Int:&lt;/code&gt; In Swift, the integer is a data type that is used to represent a whole number with no fraction, for example, “2”, “56”, “3”, etc. Integer can be of 8, 16, 32, and 64 signed or unsigned bits. A variable of integer data type can be defined using the Int keyword. Int can be represented as a signed integer and UInt represents an unsigned integer.&lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var age: Int = 22&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;2. String:&lt;/code&gt; In Swift, the string is used to represent a sequence of characters or textual data, for example, “GeeksforGeeks”. The variable of string data type is defined using the String keyword. &lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var firstName: String = "Marcos"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;3. Float:&lt;/code&gt; In Swift, the float data type is used to represent decimal numbers or we can say that float is used to represent 32-bit floating-point numbers, for example, “3.23”, “0.89753”, etc. It stores data with less precision. This data type represents up to 6 decimal places, so it is generally used when the floating-point number is less. If you want to store more decimal places then you can use a double data type. The variable of float data type is defined using the Float keyword.&lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var inputData: Float = 3.43&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4. Double:&lt;/code&gt; Double data type is used to represent a number with fractional components or we can say that double data type is a 64-bit floating-point number, for example, “2.3345656”, “0.24354656”, etc. This data type represents up to 15 decimal places and it is generally used when the floating-point number is large. The variable of double data type is defined using the Double keyword.&lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var inputData: Double = 23.45788&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;5. Bool:&lt;/code&gt; In Swift, bool or boolean is used to represent logical entities. This data type has only two values that is true or false. Here the variable of boolean data type can be defined using the Bool keyword.&lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var isLoading: Bool = true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;6. Character:&lt;/code&gt; In Swift, the character is used to represent a single letter or string literal. For example “G”, “E”, “K”, “S”, etc. A variable of character data type can be defined using the Character keyword.&lt;/p&gt;

&lt;p&gt;Ex: &lt;code&gt;var myInitial: Character = "M"&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to learn Swift in 2023 ?</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Sat, 25 Feb 2023 18:58:11 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/how-to-learning-swift-in-2023--5fj3</link>
      <guid>https://forem.com/iamdevmarcos/how-to-learning-swift-in-2023--5fj3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hi folks, I currently learning iOS Development and the Swift Programming Language, and I like to share with yous more about Swift and how I'm studying and practicing.&lt;/p&gt;

&lt;p&gt;So if you are interested to learning Swift, come with me 👨🏻‍💻&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Swift ?
&lt;/h2&gt;

&lt;p&gt;Swift is an open source programming language created by Apple in June/2014.&lt;/p&gt;

&lt;p&gt;Is a consistent and intuitive language for make apps to Apple Ecossystem (iPhone, Mac &amp;amp; Macbook, Apple TV, Apple Watch)&lt;/p&gt;

&lt;p&gt;Swift combines powerful type inference and pattern matching with a modern, lightweight syntax, allowing complex ideas to be expressed in a clear and concise manner. As a result, code is not just easier to write, but easier to read and maintain as well.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hello World in Swift&lt;/em&gt;:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Great places to Learning Swift
&lt;/h2&gt;

&lt;p&gt;I'm listing some places that I use to learn Swift, which might be useful for you too.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.apple.com/swift/" rel="noopener noreferrer"&gt;Apple Swift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.apple.com/swift/playgrounds/" rel="noopener noreferrer"&gt;Swift Playgrounds&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/swift/" rel="noopener noreferrer"&gt;Apple Swift Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hackingwithswift.com/100" rel="noopener noreferrer"&gt;Hacking with Swift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@iOSAcademy" rel="noopener noreferrer"&gt;iOS Academy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.swift.org/swift-book/documentation/the-swift-programming-language/" rel="noopener noreferrer"&gt;Swift Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://itunes.apple.com/us/book-series/swift-programming-series/id888896989?mt=11" rel="noopener noreferrer"&gt;The Definitive Book
&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why learn Swift ?
&lt;/h2&gt;

&lt;p&gt;Swift is a fast and efficient language, we can write safer and more reliable codes with type inference, we save time, and it is a modern and interactive language.&lt;/p&gt;

&lt;p&gt;It's really cool to create Apps, it's amazing to see applications that we create being used by people and making a difference in their lives.&lt;/p&gt;

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

&lt;p&gt;Swift is cool.&lt;br&gt;
If you learn this language, I believe you won't regret it, both for your evolution as a professional and the job opportunities that may arise for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  My links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/iamdevmarcos" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.marcosmendes.com.br/" rel="noopener noreferrer"&gt;Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/iamdevmarcos/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>swift</category>
      <category>ios</category>
      <category>mobile</category>
    </item>
    <item>
      <title>7 Soft Skills Every Software Engineer Should Have in 2023⚡🧑‍💻</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Mon, 23 Jan 2023 18:15:12 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/7-soft-skills-every-software-engineer-should-have-in-2023-38ni</link>
      <guid>https://forem.com/iamdevmarcos/7-soft-skills-every-software-engineer-should-have-in-2023-38ni</guid>
      <description>&lt;h2&gt;
  
  
  What are Soft Skills?
&lt;/h2&gt;

&lt;p&gt;First, &lt;strong&gt;hard skills&lt;/strong&gt; are basically skills that can be measured or quantified in some way. They are job-specific and can be learned in institutions or through apprenticeship courses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Soft skills&lt;/strong&gt; are less defined and more universal, as they cut across all careers that exist today.&lt;/p&gt;

&lt;h2&gt;
  
  
  1 - Effective and assertive communication
&lt;/h2&gt;

&lt;p&gt;You must communicate clearly, which means you must always put yourself in your listener's shoes, whether they are a user, a product manager or a teammate.&lt;/p&gt;

&lt;p&gt;Show genuine appreciation for people and their work, people can always feel it when you do. These tips lead to a &lt;strong&gt;better work environment&lt;/strong&gt; where everyone feels seen, heard and valued.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 - Self-awareness
&lt;/h2&gt;

&lt;p&gt;This is a very important skill to hone. It involves understanding yourself at all times. Working as a developer, it's important in your day to day life to be very confident to express what you know, and very capable of expressing or communicating what you don't yet know.&lt;/p&gt;

&lt;p&gt;It's a sign of strength to respond with, &lt;strong&gt;"I still have no idea how this works."&lt;/strong&gt; Show honesty and willingness to learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 - Time management
&lt;/h2&gt;

&lt;p&gt;Time management skills are super important in every developer's life, as almost every project you'll be working on has a deadline.&lt;/p&gt;

&lt;p&gt;One tip is to create a schedule for yourself and stick to it. Also, creating healthy breaks and having boundaries can be very helpful. You have to make time to eat, exercise, rest and work.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 - Empathy
&lt;/h2&gt;

&lt;p&gt;This simply means putting yourself in other people's shoes, this would mostly involve your daily interactions at work. Do you remember to make sure the codebase is as readable as possible for the next person accessing it?&lt;/p&gt;

&lt;p&gt;Practice being understanding when teammates underperform, try to find out if they are dealing with anything in their personal lives&lt;/p&gt;

&lt;h2&gt;
  
  
  5 - Responsibility
&lt;/h2&gt;

&lt;p&gt;Taking ownership of your decisions, choices and actions at every point of your journey is also another very important skill to have. Realizing that everyone makes mistakes and failure isn't necessarily a bad thing will help a lot.&lt;/p&gt;

&lt;p&gt;Some of the mistakes you'll make as a developer can be less impactful for the company or team, while others can have a huge negative impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus -&amp;gt; Open Mind
&lt;/h2&gt;

&lt;p&gt;Developers, by nature, are often strongly opinionated, and this applies to everything in your everyday life. Having an open mind can be a great skill to have.&lt;/p&gt;

&lt;p&gt;You can be very stubborn, but you are still open to new things, new ideas and a new framework to achieve your goals better and more effectively.&lt;/p&gt;

</description>
      <category>software</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>⚡ Introduction to Next.js</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Fri, 20 Jan 2023 12:44:01 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/introduction-to-nextjs-5f9b</link>
      <guid>https://forem.com/iamdevmarcos/introduction-to-nextjs-5f9b</guid>
      <description>&lt;h2&gt;
  
  
  What is Next.js ?
&lt;/h2&gt;

&lt;p&gt;Next.js is a &lt;strong&gt;flexible web framework&lt;/strong&gt; built on &lt;strong&gt;React.js&lt;/strong&gt; that provides a lot of functionality to create &lt;strong&gt;high-performance applications&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  More about Next.js
&lt;/h2&gt;

&lt;p&gt;Next.js offers a &lt;strong&gt;better developer experience&lt;/strong&gt;, with several features you need to take your project to production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hybrid rendering (static and server)&lt;/li&gt;
&lt;li&gt;TypeScript support&lt;/li&gt;
&lt;li&gt;CSS-in-JS (Styled components, Styled-JSX)&lt;/li&gt;
&lt;li&gt;Zero Configuration (Routes, Hot Reloading)&lt;/li&gt;
&lt;li&gt;Optimization of Images and Fonts&lt;/li&gt;
&lt;li&gt;Optimized for Production&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some Companies that use Next.js
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tiktok&lt;/li&gt;
&lt;li&gt;Github&lt;/li&gt;
&lt;li&gt;Twitch&lt;/li&gt;
&lt;li&gt;Nike&lt;/li&gt;
&lt;li&gt;Uber&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can see more companies that use next at this link: &lt;a href="https://nextjs.org/showcase" rel="noopener noreferrer"&gt;https://nextjs.org/showcase&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;You can use React to build your user interface and gradually adopt Next.js features to solve common application requirements like routing, data fetching and integrations.&lt;/p&gt;

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

&lt;p&gt;You can use create-next-app to create a project in Next, it automatically configures everything for you.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-next-app@latest --typescript&lt;/code&gt;&lt;br&gt;
&lt;code&gt;yarn create next-app --typescript&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful links
&lt;/h2&gt;

&lt;p&gt;If you want to know more about Next.js&lt;br&gt;
Below are some useful links for you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Official website (&lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;https://nextjs.org/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Documentation (&lt;a href="https://nextjs.org/docs/getting-started" rel="noopener noreferrer"&gt;https://nextjs.org/docs/getting-started&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;What's New in Next.js 13 (&lt;a href="https://nextjs.org/blog/next-13" rel="noopener noreferrer"&gt;https://nextjs.org/blog/next-13&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>⚛️⚡️ Introduction to React Hooks</title>
      <dc:creator>Marcos Mendes</dc:creator>
      <pubDate>Wed, 18 Jan 2023 12:08:12 +0000</pubDate>
      <link>https://forem.com/iamdevmarcos/introduction-to-react-hooks-2m4f</link>
      <guid>https://forem.com/iamdevmarcos/introduction-to-react-hooks-2m4f</guid>
      <description>&lt;p&gt;What are Hooks?&lt;/p&gt;

&lt;p&gt;Let's start by understanding what Hooks are, Hooks are an innovation, a modification that the React team has made available to us since version 16.8&lt;/p&gt;

&lt;p&gt;Hooks are basically a way to create components and create your application's features without creating entire classes with a lifecycle, constructors, defining various states, binding functions, and so on. Now with a simple variable we can create a complete and complex component with the use of Hooks, Hooks have come to change the way we code our features in order to use even less code and with more performance.&lt;/p&gt;

&lt;p&gt;So, if we compare a component created using Hooks with a component created with classes, the one created with Hooks is infinitely smaller in terms of the amount of code, and this is very beneficial both for production time and for your productivity.&lt;/p&gt;

&lt;p&gt;Anyway, Hooks are functions (which always start with the word use) that allow you to “connect” to React's state and lifecycle resources from functional components, and just to point out Hooks don't work inside classes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three important features about Hooks:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They only work on functional components.&lt;/li&gt;
&lt;li&gt;They must always be invoked in the main scope of your component (for example outside ifs and functions).&lt;/li&gt;
&lt;li&gt;And finally, they cannot be linked to any conditional to be executed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React provides some built-in Hooks like useState (we'll see in the next post), but you can also create your own custom Hooks to reuse state behavior between different components.&lt;/p&gt;

&lt;p&gt;Hope this article helped you to understand more about React Hooks&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
