<?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: Paul Bosorogan</title>
    <description>The latest articles on DEV Community by Paul Bosorogan (@paulxcodes).</description>
    <link>https://dev.to/paulxcodes</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%2F929062%2Fe1e347d2-f29e-432c-8908-6e5a6dae87e6.jpg</url>
      <title>DEV Community: Paul Bosorogan</title>
      <link>https://dev.to/paulxcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/paulxcodes"/>
    <language>en</language>
    <item>
      <title>And I OOP (Object-oriented Programming)</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Sat, 13 Apr 2024 22:43:34 +0000</pubDate>
      <link>https://dev.to/paulxcodes/and-i-oop-k53</link>
      <guid>https://dev.to/paulxcodes/and-i-oop-k53</guid>
      <description>&lt;p&gt;Hi there! Welcome back to my blog!&lt;/p&gt;

&lt;p&gt;If you have been following along you already know the drill, but if you are new, hi! My name is Paul and I am a former student with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; who is on a journey of discovery and.. job hunting. &lt;/p&gt;

&lt;p&gt;As the title suggests we will be talking about &lt;strong&gt;OOP&lt;/strong&gt; or &lt;strong&gt;object-oriented programming&lt;/strong&gt;. What is OOP? How can we use it? Is it useful? To find the answers to these questions, read along.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I wanted to give a node to the 2019 Meme winner 'And I oop' &lt;a href="https://knowyourmeme.com/memes/jasmine-masters-and-i-oop"&gt;Jasmine Masters&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6a9t032vljcm49vzrv5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6a9t032vljcm49vzrv5i.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;a href="https://helios-i.mashable.com/imagery/articles/02tTwwEQQPKxmBpItB2YgX4/hero-image.fill.size_1200x675.v1614271686.jpg"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is OOP?
&lt;/h2&gt;

&lt;p&gt;Object-oriented programming aka OOP is a fundamental programming model for other programming languages such as C++ and Java. &lt;br&gt;
The OOP is divided in 3 strong concepts: &lt;strong&gt;classes and instances&lt;/strong&gt;, &lt;strong&gt;inheritance&lt;/strong&gt;, and &lt;strong&gt;encapsulation&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;These concepts are pretty familiar with other subjects we've tackled on this blog such as &lt;a href="https://dev.to/paulxcodes/shine-bright-like-a-ruby-25d2"&gt;Ruby&lt;/a&gt;. The model behind object-oriented programming is a collection of objects. Each object representing a particular aspect of a system. Objects are a combination of &lt;strong&gt;functions&lt;/strong&gt; (or as we remember them from Ruby: &lt;em&gt;methods&lt;/em&gt;) and data. Because the object maintains its own private internal state, the system doesn't have to care what might happen inside the object. &lt;/p&gt;
&lt;h2&gt;
  
  
  Classes and instances
&lt;/h2&gt;

&lt;p&gt;When we think about the types of objects we want to include in our system, we create abstract definitions. For example, if you are modeling a university, the professors will represent some objects. Every object is represented by some properties in common: having a name and teaching a subject. Furthermore, a professor can grade papers/projects and can introduce themselves at the beginning of every year. &lt;/p&gt;

&lt;p&gt;That would make the &lt;strong&gt;Professor&lt;/strong&gt; a &lt;strong&gt;class&lt;/strong&gt; in our system. The pseudocode would look like this: &lt;br&gt;
&lt;code&gt;class Professor&lt;br&gt;
   properties &lt;br&gt;
     name&lt;br&gt;
     teaches &lt;br&gt;
   methods&lt;br&gt;
     grade(paper)&lt;br&gt;
     introduceSelf()&lt;br&gt;
&lt;/code&gt; &lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We defined the &lt;strong&gt;Professor&lt;/strong&gt; class with 2 &lt;em&gt;properties&lt;/em&gt; (name and teaches) and 2 &lt;em&gt;methods&lt;/em&gt;( &lt;strong&gt;grade()&lt;/strong&gt; to grade papers and &lt;strong&gt;introduceSelf()&lt;/strong&gt; to introduce themselves)&lt;/p&gt;

&lt;p&gt;Solely by itself, a class won't do much. It will act as a blueprint for creating other objects from the same type. Each professor is created is an &lt;strong&gt;instance&lt;/strong&gt; of the &lt;strong&gt;Professor&lt;/strong&gt; class. The function responsible for creating instances it's called &lt;strong&gt;constructor&lt;/strong&gt;. The values passed to the constructor represent the internal state we want to initialize in the new instance. Example: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;class Professor&lt;br&gt;
   properties &lt;br&gt;
     name&lt;br&gt;
     teaches&lt;br&gt;
   constructor&lt;br&gt;
     Professor(name, teaches)&lt;br&gt;
   methods&lt;br&gt;
     grade(paper)&lt;br&gt;
     introduceSelf()&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the constructor in place, let's create some professors!&lt;br&gt;
P.S programming languages mark the signal for calling a constructor with &lt;strong&gt;new&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
stephenie = new Professor("Stephenie", "Biology")
adam = new Professor("Adam", "History")

stephenie.teaches; // 'Biology'
stephenie.introduceSelf(); //'My name is prof. Stephenie and I will be your Biology professor.' 

adam.teaches; // 'History'
adam.introduceSelf(); //'My name is prof. Adam and I will be your History professor.' 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;Source&lt;/a&gt;&lt;br&gt;
 The command above creates 2 new objects representing instances of the &lt;strong&gt;Professor&lt;/strong&gt; class! How fun is that?!&lt;/p&gt;
&lt;h2&gt;
  
  
  Inheritance
&lt;/h2&gt;

&lt;p&gt;Who else goes to university? Oh yes! Students. What separates students from professors, is that they can't grade &lt;em&gt;(officially)&lt;/em&gt; papers, they don't teach any particular subject and they are usually part of a graduation year. &lt;br&gt;
But, there are some aspects that are common. They also have a name and want to introduce themselves. So the class would look something like this: &lt;br&gt;
&lt;code&gt;class Student&lt;br&gt;
   properties &lt;br&gt;
      name&lt;br&gt;
      year&lt;br&gt;
   constructor&lt;br&gt;
      Student(name, year) //to be able to create instances&lt;br&gt;
   methods&lt;br&gt;
      introduceSelf()&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we can notice that we are repeating ourselves and as respected software engineers we have to keep it D-R-Y! (Don't Repeat Yourself). If only we could find a way to write a code that represents both students and professors on the same kind of level.. Hmm. What about creating a new class called Person where we set the common properties:&lt;/p&gt;

&lt;p&gt;`class Person&lt;br&gt;
    properties &lt;br&gt;
      name&lt;br&gt;
    constructor&lt;br&gt;
      Person(name)&lt;br&gt;
    methods&lt;br&gt;
      introduceSelf()&lt;/p&gt;

&lt;p&gt;class Professor: extends Person &lt;br&gt;
    properties&lt;br&gt;
      teaches&lt;br&gt;
    constructor&lt;br&gt;
      Professor(name, teaches)&lt;br&gt;
    methods &lt;br&gt;
      grade(paper)&lt;br&gt;
      introduceSelf()&lt;/p&gt;

&lt;p&gt;class Student : extends Person&lt;br&gt;
     properties &lt;br&gt;
       year&lt;br&gt;
     constructor &lt;br&gt;
       Student(name, year)&lt;br&gt;
     methods&lt;br&gt;
       introduceSelf()`&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Person&lt;/strong&gt; became a &lt;em&gt;superclass&lt;/em&gt; or &lt;em&gt;parent class&lt;/em&gt; for both &lt;strong&gt;Professor&lt;/strong&gt; and &lt;strong&gt;Student&lt;/strong&gt;. The same way around, &lt;strong&gt;Student&lt;/strong&gt; and &lt;strong&gt;Professor&lt;/strong&gt; are &lt;em&gt;subclasses&lt;/em&gt; or &lt;em&gt;child classes&lt;/em&gt; of &lt;strong&gt;Person&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The introduceSelf() method is repeating itself in all classes as we need to differentiate the type. For example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;susan = new Professor("Susan", "Drama")
susan.introduceSelf(); // 'My name is prof. Susan and I will be your Drama professor.'

john = new Student("John",2)
john.introduceSelf(); // "My name is John and I'm in my 2nd year.'

dan = new Person("Dan")
dan.introduceSelf(); // "My name is Dan."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Encapsulation
&lt;/h2&gt;

&lt;p&gt;Due to its private internal state, the object's internal methods cannot be accessed by other objects. Keeping the internal state of an object private and the clear division from the public interface and private state is called &lt;strong&gt;encapsulation&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Let's say the students can study a certain subject only in their 2rd year or above, how can we make sure we have a system that checks the student's year?&lt;/p&gt;

&lt;p&gt;We can pass a method in the Student objects with the logic: &lt;br&gt;
&lt;code&gt;class Student : extends Person&lt;br&gt;
    properties &lt;br&gt;
       year&lt;br&gt;
    constructor&lt;br&gt;
       Student(name, year)&lt;br&gt;
    methods&lt;br&gt;
       introduceSelf()&lt;br&gt;
       canStudyLiterature() {return this.year &amp;gt; 1 }&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (student.canStudyLiterature()){
  //allow the student into the class
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip!&lt;/strong&gt;&lt;br&gt;
To be sure other code can't access the object's internal state, we can use the property called &lt;strong&gt;private&lt;/strong&gt;. This will throw an &lt;em&gt;error&lt;/em&gt; if some code outside the object tries to access it. &lt;/p&gt;

&lt;p&gt;`class Student : extends Person &lt;br&gt;
    properties &lt;br&gt;
       private year&lt;br&gt;
    constructor&lt;br&gt;
       Student(name, year)&lt;br&gt;
    methods&lt;br&gt;
       introduceSelf()&lt;br&gt;
       canStudyLiterature() {return this.year &amp;gt; 1 }&lt;/p&gt;

&lt;p&gt;student = new Student('Dana', 1)&lt;br&gt;
student.year // error: 'year' is a private property of Student&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;How fun is that?! &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this blog, we went over the basics of object-oriented programming. I hope you enjoyed this and found some parts useful. It's a learning experience for us all and if you want to learn more go ahead to &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming"&gt;mdn web docs&lt;/a&gt; and get more details. &lt;/p&gt;

&lt;p&gt;Till next time, happy coding! &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>oop</category>
    </item>
    <item>
      <title>Action Mailer ✉️- The Saga</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Sun, 26 Nov 2023 23:33:15 +0000</pubDate>
      <link>https://dev.to/paulxcodes/action-mailer-the-saga-3k2k</link>
      <guid>https://dev.to/paulxcodes/action-mailer-the-saga-3k2k</guid>
      <description>&lt;p&gt;Hi there! Welcome back to my &lt;em&gt;channel&lt;/em&gt;! &lt;/p&gt;

&lt;p&gt;If you've been following along you already know the drill, but if you're new, hello! My name is Paul and I am a future former student with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; who was on a journey to learn the basics of software engineering.&lt;/p&gt;

&lt;p&gt;And what a journey! We learned together the pillars of web development (&lt;a href="https://dev.to/paulxcodes/ready-set-go-1aok"&gt;see blog no. 1&lt;/a&gt;), we later found ways to improve the functionality (responsive single page application) and visuals of simple HTML, CSS and vanilla JavaScript with React and the magic of the components (&lt;a href="https://dev.to/paulxcodes/would-you-react-5fc2"&gt;see blog no. 2&lt;/a&gt;). &lt;br&gt;
After we managed to understand the frontend side, we dug deeper &lt;strong&gt;wink-wink&lt;/strong&gt; and we entered the world of Ruby (&lt;a href="https://dev.to/paulxcodes/shine-bright-like-a-ruby-25d2"&gt;see blog no. 3&lt;/a&gt;). Going forward we learned how to "tame" this beast with Rails (&lt;a href="https://dev.to/paulxcodes/rails-of-the-unexpected-5hlp"&gt;see blog no. 4&lt;/a&gt;) and how we can put it to good use by either building a full-stack application or just the backend. &lt;/p&gt;

&lt;p&gt;For the current blog post, I have chosen to talk about a new subject that was not included in the Flatiron School curriculum. &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%2Fkq2oifrsbm7k8yyreec6.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%2Fkq2oifrsbm7k8yyreec6.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Action Mailer ✉️
&lt;/h2&gt;

&lt;p&gt;What is Action Mailer? Ruby's little gem that helps us to send emails from within the application using the mailers classes and views. If you've been juggling with Ruby and Rails for a while, then you must be very familiar with models and controllers. Well, the mailers are very similar to controllers! &lt;/p&gt;

&lt;p&gt;Mailers inherit from the class ActionMailer::Base and can be found in the app/mailers folder. &lt;/p&gt;
&lt;h2&gt;
  
  
  Ready? Set! Mail!
&lt;/h2&gt;

&lt;p&gt;One very easy way to generate a mailer is by running the following command: &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%2Fmnzvviicdjepcjtasdud.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%2Fmnzvviicdjepcjtasdud.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://guides.rubyonrails.org/action_mailer_basics.html" rel="noopener noreferrer"&gt;Source&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now of course there are plenty of other materials on this platform and others that take you step by step with instructions on how to use it. But, this blog is intended to give my personal experiences following them. &lt;/p&gt;

&lt;p&gt;The official documentation can be found here: &lt;a href="https://guides.rubyonrails.org/action_mailer_basics.html" rel="noopener noreferrer"&gt;Action Mailer Basics&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing the email template
&lt;/h2&gt;

&lt;p&gt;Alrighty, lets get going! Now that we have the application, we might want to send an email after a new user has registered (as most websites and applications do). &lt;/p&gt;

&lt;p&gt;How do we do that? &lt;/p&gt;

&lt;p&gt;Inside the class UserMailer we add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class UserMailer &amp;lt; ApplicationMailer
  default from: 'example@gmail.com'

  def welcome_email
    @user = params[:user]
    mail(to: @user.email, subject: 'Welcome to My Awesome Site')
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Legend: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;default&lt;/strong&gt; - is a method that sets the default value for all emails sent from this mailer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;mail&lt;/strong&gt; - is the actual method that creates the email message.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;&lt;br&gt;
After looking over many materials, blogs and google search - it is very indicated to use a valid email address for this! Otherwise we won't be able to use it. &lt;/p&gt;

&lt;p&gt;Further, we have to create the mailer view a.k.a the mail template. Inside the app/views/user_mailer* we will create a file &lt;em&gt;welcome_email.html.erb&lt;/em&gt;. It should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta content='text/html; charset=UTF-8' http-equiv='Content-Type' /&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;Welcome to example.com, &amp;lt;%= @user.name %&amp;gt;&amp;lt;/h1&amp;gt;
    &amp;lt;p&amp;gt;
      You have successfully signed up to example.com,
      your username is: &amp;lt;%= @user.login %&amp;gt;.&amp;lt;br&amp;gt;
    &amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;
      To login to the site, just follow this link: &amp;lt;%= @url %&amp;gt;.
    &amp;lt;/p&amp;gt;
    &amp;lt;p&amp;gt;Thanks for joining and have a great day!&amp;lt;/p&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://guides.rubyonrails.org/action_mailer_basics.html" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Attention&lt;/strong&gt; &lt;br&gt;
The file name must match the method name inside the UserMailer.&lt;br&gt;
P.S Feel free to change text as required. &lt;/p&gt;

&lt;p&gt;Another best practice is to create a mirrored template but as a text. Not all clients like HTML emails so sending both can save us some headaches. &lt;/p&gt;

&lt;p&gt;For that we will go ahead and create a new file &lt;strong&gt;welcome_email.text.erb&lt;/strong&gt; in the same folder app/views/user_mailer with the following text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You have successfully signed up to example.com,
your username is: &amp;lt;%= @user.login %&amp;gt;.

To login to the site, just follow this link: &amp;lt;%= @url %&amp;gt;.

Thanks for joining and have a great day!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's take a look at the folder app/views/layouts. We will be adding 2 files: ** mailer.html.erb** and &lt;strong&gt;mailer.text.erb&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Inside the html type add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;
    &amp;lt;style&amp;gt;
      /* Email styles need to be inline */
    &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;%= yield %&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;..and inside the text:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Perfect!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Paging Mailer
&lt;/h2&gt;

&lt;p&gt;We will call the mailer from inside the UserController by having the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class UsersController &amp;lt; ApplicationController

  # POST /users or /users.json
  def create
    @user = User.new(user_params)
    if @user.save
        # Tell the UserMailer to send a welcome email after save
        UserMailer.with(user: @user).welcome_email.deliver_now
         session[:user_id] = @user.id
         render json: @user, status: created
      else
         render json: {errors: @user.errors.full_messages}, status: :unprocessable_entity
      end
   end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://dev.to/janestack/getting-started-with-action-mailer-3e99"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Preview the email
&lt;/h2&gt;

&lt;p&gt;It's really helpful (and highly advised) to use console in your coding process. For frontend we use &lt;code&gt;console.log&lt;/code&gt; and for the backend we use &lt;code&gt;rail c&lt;/code&gt;. But it would be nice to see the email as well, right?&lt;/p&gt;

&lt;p&gt;Good news! We can. &lt;/p&gt;

&lt;p&gt;If we use the generator for the mailer (and we don't add --no-test-framework) we will notice we have an additional folder &lt;strong&gt;test/mailers/previews/user_mailer_preview.rb.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside this file we will be adding this block of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class UserMailerPreview &amp;lt; ActionMailer::Preview
  def welcome_email
    UserMailer.with(user: User.first).welcome_email
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now comes the fun part! And by fun I mean my own experience to try and make it work.. &lt;/p&gt;

&lt;p&gt;Inside the &lt;strong&gt;config/application.rb&lt;/strong&gt; folder make sure to uncomment or add the line &lt;code&gt;require "action_mailer/railtie"&lt;/code&gt;, then a few scrolls below inside the Application class add the line: &lt;code&gt;config.action_mailer.preview_paths &amp;lt;&amp;lt; "#{Rails.root}/lib/mailer_previews"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Jumping from the application.rb folder into the config/environments/development.rb we will have the following addition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address:              'smtp.gmail.com',
port:                 587,
domain:               'example.com',
user_name:            'example@gmail.com',
password:             '**App Password**',
authentication:       'plain',
enable_starttls_auto: true }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;To configure your Mailer with GMAIL I suggest reading more from &lt;a href="https://dev.to/janestack/getting-started-with-action-mailer-3e99"&gt;Tuyen Ha's blog &lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be sure to have a working email address (don't forget the @gmail.com and paste the password as given from the Google Account security setting - see below for details).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Absolutely follow this tutorial on how to keep your information safe in the development environment:&lt;a href="https://dev.to/jhalfman/action-mailer-in-ruby-on-rails-and-how-to-deploy-1nlm"&gt; Gmail Deployment + Safety instructions &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now. Hoping we have everything set and in place we can go to &lt;a href="http://localhost:3000/rails/mailers" rel="noopener noreferrer"&gt;http://localhost:3000/rails/mailers&lt;/a&gt; and we should be able to see the following: &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%2F0hemupxet7r8tj9ecnun.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%2F0hemupxet7r8tj9ecnun.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As HTML &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%2F506nj6n10uf6mg5tvvj4.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%2F506nj6n10uf6mg5tvvj4.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;..and as text &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%2F7dfscqv6r2jjknrqkkjh.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%2F7dfscqv6r2jjknrqkkjh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ta-daa!&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;I really hope this works out and has the Action Mailer up and running! As with every other subject, these posts barely scratch the surface. There are so many ways to use it and as many ways to play around with them. &lt;/p&gt;

&lt;p&gt;P.S. if you find yourself in a sticky situation and find a solution, share your experience with your fellow coders because &lt;strong&gt;sharing is caring&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;Until next time, &lt;strong&gt;Happy coding!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ruby</category>
      <category>rails</category>
      <category>development</category>
    </item>
    <item>
      <title>“Rails of the unexpected”</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Sat, 19 Aug 2023 16:45:26 +0000</pubDate>
      <link>https://dev.to/paulxcodes/rails-of-the-unexpected-5hlp</link>
      <guid>https://dev.to/paulxcodes/rails-of-the-unexpected-5hlp</guid>
      <description>&lt;p&gt;Hello and welcome (back) to my coding journey!&lt;/p&gt;

&lt;p&gt;For those of you who just happen to stumble upon this post.. Hi! My name is Paul and I am currently a student with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; on a journey to learn the basics of software engineering.&lt;/p&gt;

&lt;p&gt;On my last blog post, I opened the conversation with Ruby and it's gems. For this blog topic, I will go ahed to add to the subject and show you the magic of.. as you could guess by the title - &lt;a href="https://guides.rubyonrails.org/"&gt;Rails&lt;/a&gt;! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4rA_Iezd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xn1ae35r5s9ycfynihzt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4rA_Iezd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xn1ae35r5s9ycfynihzt.jpg" alt="Image description" width="800" height="292"&gt;&lt;/a&gt; &lt;a href="https://d32myzxfxyl12w.cloudfront.net/images/blog_images/be602627973000d99f6ba9a43aba117b82aa5e26.jpg?1649061518"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Rails?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Rails or as you'll commonly find it in your searches, &lt;strong&gt;Ruby on Rails&lt;/strong&gt; is a popular open-source web framework that provides the web developers with &lt;em&gt;everything&lt;/em&gt; they need in order to build a functional application!&lt;/p&gt;

&lt;p&gt;As a little history behind this programming language - Ruby on Rails was created in 2003 by &lt;a href="https://dhh.dk/"&gt;David Heinemeier Hansson&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The purpose of this creation was every developer's dream for their code: to be DRY (a.k.a Don't-Repeat-Yourself). David noticed that as he was building applications with Ruby, he was copying and pasting a lot of code blocks. So by using Rails, we don't have to worry about the small details, a forgotten file or a typo in your folders, we just focus on the 'harder' parts. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why do we need a framework?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I heard this analogy in school and I find it very compelling: why do we use frameworks? Imagine you're interested in a surround sound in your home. What's the first step you would take?&lt;/p&gt;

&lt;p&gt;Spend time researching how to build a speaker, learn how to transfer the sounds through wires and create &lt;em&gt;all&lt;/em&gt; the components in order to put together a surround sound?? I would think not. You will probably save yourself the time and effort and will go with the option to purchase a system from an organization that already had done the previous steps and had put in the time and energy into researching and developing the system for others to enjoy. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;The pillars of Ruby on Rails&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As previously mentioned, Ruby on Rails is a &lt;strong&gt;web framework&lt;/strong&gt;. Taken any application out there is unique in its own way, there are certain parts that can be found in every application (ex: database links, routes etc.). If you use a good web framework you have the &lt;em&gt;resources&lt;/em&gt; to build new applications without having to write the base functionality over and over for each project.&lt;/p&gt;

&lt;p&gt;Ruby on Rails is an open-source library, therefore you can always check the work that goes 'under the hood'. If we were to 'dissect' this programming language, we'd come to realize that &lt;strong&gt;Ruby on Rails&lt;/strong&gt; is in fact a &lt;strong&gt;Ruby gem 💎&lt;/strong&gt;, as it uses &lt;strong&gt;Ruby code libraries&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Rails is using the &lt;strong&gt;MVC (Model-View-Controller)&lt;/strong&gt; architecture pattern. MVC has a specific set of conventions for building the logic for the application managing the code flow as presented in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K4RT14YQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o73hr3cjhulvld09f6q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K4RT14YQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o73hr3cjhulvld09f6q.jpg" alt="Image description" width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://miro.medium.com/v2/0*Qf1s2lG86MjX-Zcv.jpg"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are interested in how this design pattern works and the importance of MVC, you can read more &lt;a href="https://guides.rubyonrails.org/getting_started.html#mvc-and-you"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Rails 'philosophy' - an &lt;strong&gt;opinionated software&lt;/strong&gt;. &lt;br&gt;
What does that mean? Rails gives us the benefit of skipping the decision-making step of how to organize our folder structure, how to name the files and in what order to position them. Also, Rails provides abstraction code that helps us speed up the coding process.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Applications built using Ruby on Rails&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//github.com/"&gt;Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//www.shopify.com"&gt;Shopify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.airbnb.com/"&gt;Airbnb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="//quareup.com"&gt;Square&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.twitch.tv/"&gt;Twitch&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.zendesk.com/"&gt;Zendesk&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://dhh.dk/"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Let's get to coding!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now that we've seen a brief description on what Ruby on Rails is and what websites are built using this language, let's try to run some code of our own!&lt;/p&gt;

&lt;p&gt;So, let's begin by typing the &lt;em&gt;magic words&lt;/em&gt; in the terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install rails&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install Rails globally on your computer and after this you'll be ready to use it from the terminal. Now that the gem is installed, you can start building Rails applications! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Naming conventions&lt;/strong&gt;&lt;br&gt;
When building a Rails application the name of the app should be written in lowercase letters that are separated by a "-" (the same way as it applies with Ruby for naming methods, variable, classes etc.). Best practice advise: keep it nice and simple! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Rails application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To start the application you will type the following in the terminal: &lt;br&gt;
&lt;code&gt;rails new antique-shop --skip-javascript&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;‼️ Disclaimer ‼️&lt;br&gt;
&lt;em&gt;The&lt;/em&gt; &lt;code&gt;--skip-javascript&lt;/code&gt; &lt;em&gt;part just tells Rails that we won't be using JavaScript in our application.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After typing in the magic formula, in a few moments everything you need in order to create your backend application will be installed. &lt;br&gt;
Once the installation is completed, you'll change into your Rails directory and open your text editor.&lt;br&gt;
&lt;code&gt;cd antique-shop&lt;br&gt;
code .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After your text editor will open, you should be able to see the following structure: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U6rTdZRX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zr011y5k35cp64u316y8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U6rTdZRX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zr011y5k35cp64u316y8.png" alt="Image description" width="326" height="922"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a lot of folders and files in there! But don't be scared! Today you'll be working with the &lt;strong&gt;app&lt;/strong&gt; and the &lt;strong&gt;config&lt;/strong&gt; folders.&lt;/p&gt;

&lt;p&gt;To be able to open the Rails server you'll need to type the command &lt;code&gt;rails s&lt;/code&gt; and your terminal should display the following message:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WNHQfzAP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glh9lw87s07rz3sg4nda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WNHQfzAP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glh9lw87s07rz3sg4nda.png" alt="Image description" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can verify if the server is working by navigating to your browser and entering: &lt;a href="http://localhost:3000/"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚠️ Disclaimer ⚠️&lt;/strong&gt;&lt;br&gt;
Now, if you're as &lt;em&gt;lucky&lt;/em&gt; as I am, you'll run into some errors with the &lt;code&gt;msgpack&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's how to fix it&lt;/strong&gt;&lt;br&gt;
Open a new terminal, make sure running &lt;code&gt;arch&lt;/code&gt; outputs &lt;code&gt;arm64&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Comment all the lines of your Gemfile ( command ⌘ + '/' )&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;bundle clean --force&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Revert commenting the lines of your Gemfile&lt;/li&gt;
&lt;li&gt;Install your gems: &lt;code&gt;bundle install&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After this, your &lt;code&gt;rails s&lt;/code&gt; command should work just fine and show the message above.&lt;br&gt;
&lt;a href="https://github.com/msgpack/msgpack-ruby/issues/195"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Moving forward&lt;/strong&gt;&lt;br&gt;
Let's check our antiques in our shop! You can type in &lt;a href="http://localhost:3000/antiques"&gt;http://localhost:3000/antiques&lt;/a&gt; in our browser and.. uh oh. An error!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cgoSb7WB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uin33abq844tzh1sq68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cgoSb7WB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uin33abq844tzh1sq68.png" alt="Image description" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh no! No worries tho! You can fix it. The program is nice enough to let you know you've missed some steps and instead of giving back &lt;strong&gt;nothing&lt;/strong&gt;, it suggests what steps you can take to solve the issue. &lt;/p&gt;

&lt;p&gt;In order to fix this, you need to define a &lt;strong&gt;route&lt;/strong&gt; in your Rails app. Add the following in the &lt;strong&gt;config/routes.rb&lt;/strong&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DCD-vZau--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1gjha0u13mvkkn62s3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DCD-vZau--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1gjha0u13mvkkn62s3g.png" alt="Image description" width="776" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you're going to go in the &lt;strong&gt;app/controllers.rb&lt;/strong&gt; folder and create an &lt;strong&gt;antiques_controller.rb&lt;/strong&gt; file with the following code: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fKSgpFnL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5r9ccrw38heucujnj1ec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fKSgpFnL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5r9ccrw38heucujnj1ec.png" alt="Image description" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This tells our app that when there is a &lt;strong&gt;GET&lt;/strong&gt; request, in the &lt;strong&gt;/antiques&lt;/strong&gt; path it should run the &lt;strong&gt;#index&lt;/strong&gt; method in the &lt;strong&gt;AntiquesController&lt;/strong&gt; leading to this response in your browser: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H59CZZeN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sirzrnfvdtgpcjdp1tsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H59CZZeN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sirzrnfvdtgpcjdp1tsw.png" alt="Image description" width="728" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yay!&lt;/strong&gt; You've just completed a full request-response cycle in Rails! &lt;br&gt;
&lt;em&gt;P.S&lt;/em&gt; To turn off the server, simply press the &lt;code&gt;Control + C&lt;/code&gt; combo.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Shortcuts in Rails&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There are a &lt;strong&gt;lot of gems&lt;/strong&gt;, &lt;strong&gt;shortcuts&lt;/strong&gt; and &lt;strong&gt;macros&lt;/strong&gt; that you could use in Rails. Like remember when I said there are some shortcuts that can help you speed things up? Well, let me show you what I meant.&lt;/p&gt;

&lt;p&gt;Above you had to go and &lt;em&gt;manually&lt;/em&gt; create a new file in the controllers folder. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Boo!&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Why go through all that when you could simply just type the following in your terminal... &lt;/p&gt;

&lt;p&gt;&lt;code&gt;rails g controller Antiques --no-test-framework&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;...and get this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cp4dNZWQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cu187lk841c58y67u8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cp4dNZWQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cu187lk841c58y67u8u.png" alt="Image description" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q3XtSZW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7bhhwnehijj4ouldybn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q3XtSZW6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7bhhwnehijj4ouldybn3.png" alt="Image description" width="800" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;‼️ Disclaimer ‼️&lt;br&gt;
&lt;em&gt;The&lt;/em&gt; &lt;code&gt;--no-test-framework&lt;/code&gt; &lt;em&gt;part just tells Rails to not add any spec files for testing and &lt;code&gt;g&lt;/code&gt; is a shortcut for &lt;strong&gt;generate&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I know, right?!&lt;/strong&gt; And this is just the tip of the iceberg!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final thoughts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;As always, I am happy to take you along the way on my coding journey and I sure hope this subject has sparked some interest in your backend programming quest as it did for me.&lt;/p&gt;

&lt;p&gt;Until next time, &lt;strong&gt;happy coding&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Shine bright like a.. Ruby 💎</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Mon, 29 May 2023 18:05:54 +0000</pubDate>
      <link>https://dev.to/paulxcodes/shine-bright-like-a-ruby-25d2</link>
      <guid>https://dev.to/paulxcodes/shine-bright-like-a-ruby-25d2</guid>
      <description>&lt;p&gt;Hello and welcome to my coding journey! &lt;/p&gt;

&lt;p&gt;For those of you who have seen my previous posts, welcome back! I hope you enjoy and find this one useful. For those of you who just happen to stumble upon this post, hi! My name is Paul and I am currently a student with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; on a journey to learn the basics of software engineering. &lt;/p&gt;

&lt;p&gt;As you can tell by the title, this post will touch subjects as &lt;a href="https://ruby-doc.org/core-2.7.3/"&gt;Ruby&lt;/a&gt;, &lt;a href="https://rubygems.org/"&gt;gems&lt;/a&gt; and a ✨sprinkle✨ of &lt;a href="https://www.sqlite.org/index.html"&gt;SQLite&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cWEbofvv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ublrv42hp3se61cb3ovw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cWEbofvv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ublrv42hp3se61cb3ovw.png" alt="Image description" width="800" height="414"&gt;&lt;/a&gt;&lt;a href="https://www.devopsschool.com/blog/wp-content/uploads/2022/03/eb9e3b7dab09358e7cf13f188f64f9f4.png"&gt;Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've followed along you know I have tapped into the basics of vanilla JavaScript and React. What are those useful for? They allow us to create the 'visuals' or the &lt;strong&gt;client-side&lt;/strong&gt; of a web application. What does Ruby bring to the table? It helps us build the backend part of our application or the &lt;strong&gt;server-side&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;You may ask 'But Paul, how many languages are you supposed to learn in order to build websites?'. And that is a valid question! If it feels like a lot to learn, it's probably because it is. No lie. But, a good lesson we are thought is that a good developer knows how to use &lt;a href="//www.google.com"&gt;Google&lt;/a&gt; to his advantage. Learning a new language may sound scary at first, but it shouldn't be the first thought. If you did it once, you can do it again. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Ruby?  💎
&lt;/h2&gt;

&lt;p&gt;Ruby is a programming language that was created by &lt;a href="https://matz.rubyist.net/"&gt;Yukihiro “Matz” Matsumoto&lt;/a&gt; in 1995. We can think of Ruby and mix of &lt;em&gt;Perl, Smalltalk, Eiffel, Ada, and Lisp&lt;/em&gt;. His goal was trying to make Ruby feel natural, not simple.&lt;/p&gt;

&lt;p&gt;At its core, Ruby is a dynamic object-oriented programming language and due to it's flexibility, we can build different programs (not just web applications) such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Command line interfaces&lt;/li&gt;
&lt;li&gt;Web servers&lt;/li&gt;
&lt;li&gt;Games&lt;/li&gt;
&lt;li&gt;Web scrapers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read more about &lt;a href="https://rubystyle.guide/"&gt;Ruby&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to write and run Ruby
&lt;/h2&gt;

&lt;p&gt;A different aspect of Ruby is that we won't be able to run the code in the browser as we used to with JS and React. We will be using our terminal. &lt;/p&gt;

&lt;p&gt;To get started we need to a create a new file and add the .rb extension. &lt;br&gt;
For example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JuBksiWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kp4gqpfxnwght7af27sn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JuBksiWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kp4gqpfxnwght7af27sn.png" alt="Image description" width="800" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's right. Both work! It is up to us to choose if you want to use the parentheses or not. &lt;br&gt;
&lt;em&gt;However&lt;/em&gt;, as an unwritten rule, most Ruby developers prefer the first syntax as it's more pleasant to look at 😊.&lt;/p&gt;

&lt;p&gt;Now to run this code, we need to type &lt;code&gt;ruby test.rb&lt;/code&gt; (or the directory you're in, for example, my file is in lib so therefor the command is ruby lib/test.rb)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UJzEpLGx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt890gx97hvxx7dk28k1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UJzEpLGx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt890gx97hvxx7dk28k1.png" alt="Image description" width="800" height="84"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And voila! We just ran our first Ruby application!&lt;/p&gt;

&lt;h2&gt;
  
  
  Data types in Ruby
&lt;/h2&gt;

&lt;p&gt;Just like in JavaScript, we have the same types of data we work with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;strings&lt;/li&gt;
&lt;li&gt;numbers&lt;/li&gt;
&lt;li&gt;booleans&lt;/li&gt;
&lt;li&gt;nil &lt;em&gt;(aka null in JS)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;arrays&lt;/li&gt;
&lt;li&gt;hashes &lt;em&gt;(aka objects in JS)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Functions aka methods
&lt;/h2&gt;

&lt;p&gt;In JavaScript we learned about functions: &lt;strong&gt;lowercase&lt;/strong&gt; for vanilla Javascript and &lt;strong&gt;PascalCase&lt;/strong&gt; for React. In Ruby we call them &lt;strong&gt;methods&lt;/strong&gt;. And yes, we can either write our own or we can use the built in methods! (simply add &lt;code&gt;.methods&lt;/code&gt; at the end of your method and see the full list of available methods you can use for your instance.&lt;br&gt;
How cool is that?!&lt;/p&gt;

&lt;p&gt;Example: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0z2-qTmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmfur89cawnppnq3n0h0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0z2-qTmI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmfur89cawnppnq3n0h0.png" alt="Image description" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the results we're getting is --&amp;gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cDEbQSjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm8gri6g3e9nzlq5twap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cDEbQSjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm8gri6g3e9nzlq5twap.png" alt="Image description" width="800" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to write a method, we will be writing the following: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--przfJdSv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmlfh7jxt1lxugvdgjxa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--przfJdSv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmlfh7jxt1lxugvdgjxa.png" alt="Image description" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m5oUfbbN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43gkrbcqoemco4wz9cma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m5oUfbbN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43gkrbcqoemco4wz9cma.png" alt="Image description" width="800" height="61"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Classes and instances
&lt;/h2&gt;

&lt;p&gt;In order to create a class, we simply type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;class Test &lt;br&gt;
end&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What is a class? It's a the blueprint, template or 'a small factory' that creates more objects with the same characteristics. What method create more individual objects? &lt;code&gt;.new&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By using &lt;code&gt;.new&lt;/code&gt; we create new &lt;strong&gt;instances&lt;/strong&gt; (with it's own unique ID).&lt;/p&gt;

&lt;p&gt;_For this example we will be using a Ruby built in REPL called 'pry'. Add &lt;code&gt;require 'pry'&lt;/code&gt; at the top of your file and then &lt;code&gt;binding.pry&lt;/code&gt; at the end of your code. _&lt;/p&gt;

&lt;p&gt;Example: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qUkn118X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ym350ph1jomj9hodipdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qUkn118X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ym350ph1jomj9hodipdl.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TdD-xpNP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ie7jry8ewvowz33xk69x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TdD-xpNP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ie7jry8ewvowz33xk69x.png" alt="Image description" width="624" height="132"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How amazing is that?&lt;/p&gt;

&lt;h2&gt;
  
  
  Gems
&lt;/h2&gt;

&lt;p&gt;As we discussed with React, we are not the first developers therefor there is no need to reinvent the wheel. Programmers before us have been kind enough to save code that we can use to make our lives easier in libraries. Ruby is no exception. We can use templates of code called &lt;strong&gt;gems&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Read more about &lt;a href="https://rubygems.org/"&gt;gems&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  SQL
&lt;/h2&gt;

&lt;p&gt;When we are trying to develop a web application, we usually use data to present it or we take the user's input and store that data. &lt;/p&gt;

&lt;p&gt;How can we store data? Well, if the answer begins with &lt;em&gt;data&lt;/em&gt; and ends with &lt;em&gt;bases&lt;/em&gt;, then you got that right! &lt;strong&gt;Databases&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;One aid we have in storing data is SQL. This won't be the tool we use to write a big complex application, but we can use it to interact with that database. &lt;/p&gt;

&lt;p&gt;SQL (&lt;em&gt;Structured Query Language&lt;/em&gt;) - pronounced 'sequel' or 'S-Q-L' - is the language responsible for managing data in databases. The con is for that we use it for &lt;em&gt;only&lt;/em&gt; talking to the database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PRO TIP&lt;/strong&gt;: If your laptop is on OSX version 10.4 or above, chances are you already have SQLite installed. To double check, run the command &lt;code&gt;which sqlite3&lt;/code&gt; and if you get positive response, you are good to go! Thanks &lt;a href="//www.apple.com"&gt;Apple&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;The database files are ending in .db extension and you can open them in your terminal by running &lt;code&gt;filename.db sqlite3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A few of the SQL commands are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CREATE TABLE&lt;/li&gt;
&lt;li&gt;ALTER TABLE&lt;/li&gt;
&lt;li&gt;DROP TABLE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if we want to create a table we would do the following: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;run &lt;code&gt;sqlite 3 filename.db&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CREATE TABLE table_name ( id INTEGER **PRIMARY KEY***, name STRING, age INTEGER);&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And voila! We have created a SQLite table. &lt;/p&gt;

&lt;p&gt;*****Every table we create must include a primary key to be indexed, just like an Excel Spreadsheet. &lt;/p&gt;

&lt;p&gt;Read more about &lt;a href="https://www.sqlite.org/lang_keywords.html"&gt;SQLite&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;There is so much more to read and learn about this! In this post, I am barely scratching the surface, but I hope it will spark your interest to dive deeper into it and discover the wonders of Ruby, gems and SQLite!&lt;/p&gt;

&lt;p&gt;Until next time, &lt;strong&gt;happy coding&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>ruby</category>
      <category>sinatra</category>
    </item>
    <item>
      <title>Would you REACT? 👨‍💻</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Sat, 04 Mar 2023 22:09:52 +0000</pubDate>
      <link>https://dev.to/paulxcodes/would-you-react-5fc2</link>
      <guid>https://dev.to/paulxcodes/would-you-react-5fc2</guid>
      <description>&lt;p&gt;Hi and, if you have followed along, &lt;strong&gt;welcome back!&lt;/strong&gt; to my journey of &lt;strong&gt;babyStepsIntoCoding&lt;/strong&gt;! If you're new here... Hi there! My name is Paul and I am currently a student with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; on my way to become a software engineer.&lt;/p&gt;

&lt;p&gt;In this blog post, we will cover some information regarding React. I know what you may be thinking: "but Paul, there are so many informational blogs and &lt;a href="//www.youtube.com"&gt;YouTube&lt;/a&gt; tutorials out there.. what can you bring new to the table??". You would be correct. The internet has plenty of useful information for a new web developer to grasp on. But, I hope by taking the time to explain this to you, I will feel more confident in my knowledge and you will learn something new by the end of it. A win-win situation! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D1phaMm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tms3lbjm0fz7x513kppj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D1phaMm_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tms3lbjm0fz7x513kppj.jpg" alt="Image description" width="880" height="370"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.freecodecamp.org/news/react-18-new-features/"&gt;Source&lt;/a&gt; &lt;/p&gt;
&lt;h2&gt;
  
  
  What is React?
&lt;/h2&gt;

&lt;p&gt;React has become of one the most popular frameworks in the front end community these past years, but other popular frameworks worth mentioning are: &lt;em&gt;Next.js, Angular, Vue.js, Gatsby&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Some sources mention that React is not a framework, &lt;em&gt;technically&lt;/em&gt;, but more of a &lt;strong&gt;library&lt;/strong&gt;. While the debate goes on, one thing is sure: React will allow you to build large applications fast and without too much sweat! How fun is that!&lt;/p&gt;
&lt;h2&gt;
  
  
  Here are some fun facts about React
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;React was first released in 2013 and it was created by Jordan Walke.&lt;/li&gt;
&lt;li&gt;Is maintained by Facebook&lt;/li&gt;
&lt;li&gt;You can find updates and new information about React &lt;a href="https://reactjs.org/"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;React has over 100k stars on &lt;a href="//www.github.com"&gt;GitHub&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;It is used for thousands of enterprise apps and mobile apps&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/free-react-course-2022/"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why is React popular? Where is it used?
&lt;/h2&gt;

&lt;p&gt;A few examples of websites that use React: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//www.facebook.com"&gt;Facebook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//www.instagram.com"&gt;Instagram&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.airbnb.com/"&gt;Airbnb&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.dropbox.com/"&gt;Dropbox&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.netflix.com/"&gt;Netflix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://postmates.com/"&gt;Postmates&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How to think in React
&lt;/h2&gt;

&lt;p&gt;You will be amazed to realize that React is in fact a happy combination of HTML and JavaScript called &lt;strong&gt;JSX&lt;/strong&gt;. So, all you learned from vanilla JavaScript can be very useful while learning React!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Destructuring&lt;/li&gt;
&lt;li&gt;Iteration methods (.filter(), .map())&lt;/li&gt;
&lt;li&gt;Fetch (C.R.U.D - methods)&lt;/li&gt;
&lt;li&gt;Event listeners&lt;/li&gt;
&lt;li&gt;Callbacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main advantage of React is that you will be able to divide your code into separate components, similar to building blocks! Why is this an advantage? Because the components give us the opportunity to read the code easier, each component is independent and we can reuse them along the application how many times we wish for! Now that's a great way to stay &lt;strong&gt;D-R-Y&lt;/strong&gt;! aka &lt;strong&gt;Don't-Repeat-Yourself&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another difference of React is the way we use expressions: &lt;strong&gt;declarative&lt;/strong&gt; and &lt;strong&gt;imperative&lt;/strong&gt; (DOM).&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;imperative expression&lt;/strong&gt; will describe every action in a very specific way and &lt;em&gt;how&lt;/em&gt; the program should go step by step. When a &lt;strong&gt;declarative expression&lt;/strong&gt; will describe how the process should look like or what the end result should be, but how to get there? It's up the program.&lt;/p&gt;

&lt;p&gt;Let's create a DOM element to observe the difference between these 2 expressions. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;const greeting = document.createElement('h1')&lt;br&gt;
 greeting.textContent="Hello World!"&lt;br&gt;
 greeting.className="main"&lt;br&gt;
 const header = document.querySelector('header')&lt;br&gt;
 header.append(greeting)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That code takes a lot of lines to write for a simple result. Let's see how React can help us by using JSX syntax.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const greeting = &amp;lt;h1 className="main"&amp;gt;Hello World!&amp;lt;/h1&amp;gt;&lt;br&gt;
 ReactDOM.render(greeting, document.querySelector("header"))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Less code for the same result?? Pretty awesome!&lt;/p&gt;
&lt;h2&gt;
  
  
  How can I use React?
&lt;/h2&gt;

&lt;p&gt;React is basically a JavaScript library for creating front end applications, UI's (user interfaces).&lt;br&gt;
To be able to use React, go on your terminal and create your directory &lt;code&gt;mkdir my-project&lt;/code&gt; and change directory &lt;code&gt;cd my-project&lt;/code&gt;. Now to run React you need to type &lt;code&gt;npx create-react-app my-react-app&lt;/code&gt; and wait for the package to install. This will offer the preconfigured, default project. To run, type in &lt;code&gt;npm start&lt;/code&gt; and you should see the react application page in your browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npm&lt;/strong&gt; is a package manager for JavaScript. &lt;br&gt;
&lt;em&gt;What does that mean?&lt;/em&gt; &lt;br&gt;
It means it allows you to install preexisting blocks of code to help in your projects. Thanks to the hard work of web developers before us, we can make sure to skip duplicate code and make our lives easier!&lt;/p&gt;

&lt;p&gt;If you want to learn more about &lt;strong&gt;npm&lt;/strong&gt; I suggest reading more &lt;a href="https://www.npmjs.com/package/create-react-app"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  You mentioned components, how do they look like?
&lt;/h2&gt;

&lt;p&gt;React let's you define components as classes or functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;In order to differentiate between a vanilla JavaScript function and a React function, you need to use capital letters.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The React functions always return JSX and tells our program how everything should look like. &lt;/p&gt;

&lt;p&gt;Let's see an example for a simple blog application with a title and a content.&lt;/p&gt;

&lt;p&gt;First you need to create the title component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Title() {
 return (
  &amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;A Cooking Blog&amp;lt;/h1&amp;gt;
  &amp;lt;/div&amp;gt;
 );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you go ahead and create the content component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Content(){
 return (
 &amp;lt;div&amp;gt;
  &amp;lt;p&amp;gt; Welcome to my cooking blog! Here you may find some of my
      favorite recipes that I hope will inspire you to start cooking today! &amp;lt;/p&amp;gt;
 &amp;lt;/div&amp;gt;
);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this, you can go ahead and put everything together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Blog() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Title /&amp;gt;
      &amp;lt;Content /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example the Blog component is at the top level and wraps both Title and Content which makes it the &lt;strong&gt;parent component&lt;/strong&gt; of those two.&lt;/p&gt;

&lt;p&gt;This is important because we need to know which component is the parent when we want to pass information or data to the inner components ~ also known as &lt;strong&gt;children&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you are interested in learning more about components, I recommend reading about them &lt;a href="https://reactjs.org/docs/react-component.html"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;In this post I barely scratched the surface of React. There are more to add for sure (&lt;strong&gt;props, hooks, state&lt;/strong&gt; etc.), but I will try to keep it nice and simple for now. &lt;/p&gt;

&lt;p&gt;I hope this opens your eyes and horizons and makes you realize that &lt;strong&gt;you too&lt;/strong&gt; can develop website like &lt;strong&gt;Reddit&lt;/strong&gt;, &lt;strong&gt;WhatsApp&lt;/strong&gt; or &lt;strong&gt;OkCupid&lt;/strong&gt; by starting to learn a bit more about React.&lt;/p&gt;

&lt;p&gt;Until next time, happy coding!&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Ready? Set. Code! 👨‍💻</title>
      <dc:creator>Paul Bosorogan</dc:creator>
      <pubDate>Sat, 03 Dec 2022 22:25:14 +0000</pubDate>
      <link>https://dev.to/paulxcodes/ready-set-go-1aok</link>
      <guid>https://dev.to/paulxcodes/ready-set-go-1aok</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hello&lt;/strong&gt; and &lt;strong&gt;welcome&lt;/strong&gt;! If you are reading this blog post on the huge &lt;em&gt;World Wide Web&lt;/em&gt;, then it means you are thinking about it or you are ready to make a change in your professional career path.&lt;/p&gt;

&lt;p&gt;My name is Paul and I am currently enrolled in the &lt;strong&gt;Software Engineering&lt;/strong&gt; course with &lt;a href="//www.flatironschool.com"&gt;Flatiron School&lt;/a&gt; and this blog is meant to explain the coding experience through my eyes and perhaps it will make it easier for you to get started. &lt;strong&gt;babyStepsIntoCoding!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On this post I will focus more on the &lt;strong&gt;Front-End Web Programming&lt;/strong&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%2F308zuzi2n69hno1wwqck.jpeg" 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%2F308zuzi2n69hno1wwqck.jpeg" alt="Image description" width="320" height="178"&gt;&lt;/a&gt;&lt;br&gt;
source: &lt;a href="https://i0.wp.com/tekraze.com/wp-content/uploads/2018/02/html-css-js-768x427.png?resize=768%2C427&amp;amp;ssl=1" rel="noopener noreferrer"&gt;https://i0.wp.com/tekraze.com/wp-content/uploads/2018/02/html-css-js-768x427.png?resize=768%2C427&amp;amp;ssl=1&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Front-End Web Programming?
&lt;/h2&gt;

&lt;p&gt;If you ask this question to 10 people in one room you might end up with 10 different ways of describing it, but it will always be the same notion at its core. For me what makes sense are these 4 steps: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating documents with HTML.&lt;/li&gt;
&lt;li&gt;Styling and arranging the content of documents using CSS.&lt;/li&gt;
&lt;li&gt;Using JavaScript to add interaction with documents. &lt;/li&gt;
&lt;li&gt;Communicating with remote servers on changes that happen on documents. &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;HTML&lt;/strong&gt;: What is HTML?
&lt;/h2&gt;

&lt;p&gt;HTML is an abbreviation from Hyper Text Markup Language and is the standard markup language for the creation of Web pages.&lt;br&gt;
HTML has the role of shaping and structuring the Web page. How does it do that? By using a series of elements it directs the browser how to display the content ("this is the title/heading", "this is the paragraph", "this is the link to.." etc)&lt;/p&gt;

&lt;p&gt;Here is how a basic HTML structure looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Page Title&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;h1&amp;gt;My First Heading&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;My first paragraph.&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source: &lt;a href="https://www.w3schools.com/html/html_intro.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/html/html_intro.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is the outcome: &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%2F1m4m6on05n8alku8ny8w.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%2F1m4m6on05n8alku8ny8w.png" alt="Image description" width="635" height="361"&gt;&lt;/a&gt;&lt;br&gt;
Source: &lt;a href="https://www.w3schools.com/html/img_chrome.png" rel="noopener noreferrer"&gt;https://www.w3schools.com/html/img_chrome.png&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;CSS&lt;/strong&gt;:What is CSS?
&lt;/h2&gt;

&lt;p&gt;CSS stands for Cascading Style Sheets and it is the language to style the HTML document. CSS will describe how the elements should be displayed. That includes: adding colors, choosing fonts, changing the size of the font, adding a background image or a background color, and so much more!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: lightblue;
}

h1 {
  color: white;
  text-align: center;
}

p {
  font-family: verdana;
  font-size: 20px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source: &lt;a href="https://www.w3schools.com/html/html_css.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/html/html_css.asp&lt;/a&gt;&lt;br&gt;
The possibilities to add elements and design a Web page are endless! &lt;/p&gt;

&lt;p&gt;See below a few W3schools.com templates:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A band Website: &lt;a href="https://www.w3schools.com/w3css/tryw3css_templates_band.htm" rel="noopener noreferrer"&gt;https://www.w3schools.com/w3css/tryw3css_templates_band.htm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Coming soon Website: &lt;a href="https://www.w3schools.com/w3css/tryw3css_templates_coming_soon.htm" rel="noopener noreferrer"&gt;https://www.w3schools.com/w3css/tryw3css_templates_coming_soon.htm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A wedding Website: &lt;a href="https://www.w3schools.com/w3css/tryw3css_templates_wedding.htm" rel="noopener noreferrer"&gt;https://www.w3schools.com/w3css/tryw3css_templates_wedding.htm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Food blog Website: &lt;a href="https://www.w3schools.com/w3css/tryw3css_templates_food_blog.htm" rel="noopener noreferrer"&gt;https://www.w3schools.com/w3css/tryw3css_templates_food_blog.htm&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;JavaScript&lt;/strong&gt;: What is JavaScript?
&lt;/h2&gt;

&lt;p&gt;JavaScript or JS is one of the most popular programming languages. It is a simple language to learn and it is required along &lt;strong&gt;HTML&lt;/strong&gt; and &lt;strong&gt;CSS&lt;/strong&gt; in order to become a &lt;strong&gt;Web Developer&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What can JavaScript do?&lt;/em&gt; I am so glad you asked! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initializing variables.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By using variables you can store information (numbers, strings (words or phrases), arrays, objects etc.) then hand it over to the JavaScript engine which stores this in its memory! If you're wondering how you can access the information once it's stored, it is very simple. You label the variable a.k.a you give it a name.&lt;br&gt;
In order to not mix the variables, you need to follow the rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Always start with a lowercase letter (numbers are not allowed)&lt;/li&gt;
&lt;li&gt;Refrain from using spaces. The name is too long? No worries. We use the camelCase, for example: camelCaseTheVariableNames (like a camel humps).&lt;/li&gt;
&lt;li&gt;JavaScript reserved words or future reserved words are also not valid.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So far so good! In order to initialize a variable, you need to first declare it and then to assign a value to it.&lt;/p&gt;

&lt;p&gt;In order to declare a variable you'll use the following: &lt;strong&gt;var&lt;/strong&gt;, &lt;strong&gt;let&lt;/strong&gt; and &lt;strong&gt;const&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;var&lt;/em&gt; - is the ancestor of let and const and was the only one used until 2015. &lt;br&gt;
It is not as used anymore due to its high bugging risk - it will allow you to redeclare the variable and reassign the value. &lt;/p&gt;

&lt;p&gt;Read more: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;let&lt;/em&gt; - unlike &lt;strong&gt;var&lt;/strong&gt;, it will notify if you used the variable before. This is helpful if you have a lengthy code and wish to avoid errors. However, it is possible to &lt;em&gt;reassign&lt;/em&gt; a value to the variable.&lt;/p&gt;

&lt;p&gt;Read more: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;const&lt;/em&gt; - recommended to be used if possible. By declaring a variable with const you are not able to redeclare nor reassign. &lt;/p&gt;

&lt;p&gt;Read more: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we know how to declare a variable we will learn how to assign a value to it. How? Using '=' which is the assignment operator.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let x = 0&lt;/code&gt; we declared the variable x and we assigned 0 as its value. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Special types of variables&lt;/strong&gt;: array, object.&lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;array&lt;/strong&gt; is a variable that can store in more than one value. The notation for an array is [] to determine the content.&lt;br&gt;
For example: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;const fruit = ["apple", "pear", "grapes"]&lt;/code&gt;  or&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const fruit = [&lt;br&gt;
"lemon",&lt;br&gt;
"strawberry",&lt;br&gt;
"peach"&lt;br&gt;
]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Why would you want to use an array? Because you want to be able to iterate or modify values fast and easy. If you have 10 variables, it would be a piece of cake to modify one or a few of them. But what happens when you have 400 variables? Not that simple. &lt;/p&gt;

&lt;p&gt;An &lt;strong&gt;object&lt;/strong&gt; is also a type of variable that allows multiple values to be stored. The difference between these two is the fact that an object has properties (key and value) and the notation {}.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const cheese = {name: "cheddar"; type: "hard"; color:"orange"}&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const cheese = {&lt;br&gt;
name: "mozarella";&lt;br&gt;
type: "gooey";&lt;br&gt;
color: "white";&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How are objects useful? It makes it easy to store date with multiple properties.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You can see all these things during your day to day activities, and become so familiar with the processes that you don't even realize! &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%2Fydyc5bg67qk9nq2b4tfr.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%2Fydyc5bg67qk9nq2b4tfr.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
source: &lt;a href="https://computermash.com/wp-content/uploads/2022/01/what-is-computer-programming.png" rel="noopener noreferrer"&gt;https://computermash.com/wp-content/uploads/2022/01/what-is-computer-programming.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you found this helpful and my post sparked an interest in this topic for you. Follow along for more information as I navigate through this course. &lt;/p&gt;

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

</description>
      <category>emptystring</category>
    </item>
  </channel>
</rss>
