<?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: Thinh Tran</title>
    <description>The latest articles on DEV Community by Thinh Tran (@thinhtran130290).</description>
    <link>https://dev.to/thinhtran130290</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%2F965735%2F09b8d333-dc5c-4252-a04b-8bab84d90334.png</url>
      <title>DEV Community: Thinh Tran</title>
      <link>https://dev.to/thinhtran130290</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thinhtran130290"/>
    <language>en</language>
    <item>
      <title>[ Classes of Ruby ] Things are Classified for Convenience of Life Management, Not by Their Values</title>
      <dc:creator>Thinh Tran</dc:creator>
      <pubDate>Mon, 07 Nov 2022 04:31:33 +0000</pubDate>
      <link>https://dev.to/thinhtran130290/classes-of-ruby-nbh</link>
      <guid>https://dev.to/thinhtran130290/classes-of-ruby-nbh</guid>
      <description>&lt;p&gt;Previous chapter: &lt;a href="https://dev.to/thinhtran130290/boxes-of-ruby-43lo"&gt;[ Boxes of Ruby ]&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And then, our new concern is about how to create custom structured boxes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So far, we've known that an application is nothing more than some blocks of code which are so called &lt;code&gt;procedure&lt;/code&gt;s and get called at some time to perform certain tasks.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new { |name, age, online|
   if online
      puts "Hello, World!"
      puts "I'm #{name} and #{age} times cycled around the Sun."
   else
      puts "You're offline now."
      puts "Go online first."
   end
}

main.call "Semi-Art", 32, true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we also get that any &lt;code&gt;box&lt;/code&gt; may contains information and other boxes as &lt;code&gt;main&lt;/code&gt;. And if we simplify the example code above in an abstract view with the block of custom code replaced like this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new custom_code_block

main.call "Semi-Art", 32, true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we see that the &lt;code&gt;Proc.new&lt;/code&gt; is the actual action to create a bundle which encloses our custom code and the box &lt;code&gt;call&lt;/code&gt;. So, something like the definition of &lt;code&gt;Proc.new&lt;/code&gt; is what we truly seek.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new { |name, age, online|
   semi = Person.new name, age, online
   semi.greet
}

main.call "Semi-Art", 32, true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;main.rb:2:in `block in &amp;lt;main&amp;gt;': uninitialized constant Person (NameError)
    from main.rb:6:in `&amp;lt;main&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Oh.. that's &lt;code&gt;Person.new&lt;/code&gt; is just a feeble wish and not yet to be defined. And now, we're gonna learn the basic grammar to express stuff like so.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Class
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person

   # - Person.new name, age, online
   def initialize (name, age, online)
      @name = name
      @age = age
      @online = online
   end

   # - Person.greet
   def greet
      if @online
         puts "Hello, World!"
         puts "I'm #{@name} and #{@age} times cycled around the Sun."
      else
         puts "You're offline now."
         puts "Go online first."
      end # if
   end

end # Person


# - main - - - - - - - - - - - - - - - - - -

main = Proc.new { |name, age, online|
   semi = Person.new name, age, online
   semi.greet
}

main.call "Semi-Art", 32, true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hash symbols &lt;code&gt;#&lt;/code&gt; are used to write comments in the code so that the computer will just ignore some words. So, you may need some moments to get familiar with those comments to exclude them from the real code.&lt;/p&gt;

&lt;p&gt;There we have a &lt;code&gt;class Person&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;class Person
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a couple of definitions for &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;greet&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;class Person

   def initialize (name, age, online)
   end

   def greet
   end

end # Person
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These all are just parts of a sketch to describe a person who has a &lt;code&gt;name&lt;/code&gt;, is currently at some &lt;code&gt;age&lt;/code&gt;, v.v... and has ability to perform an act of &lt;code&gt;greet&lt;/code&gt;-ing.&lt;/p&gt;

&lt;p&gt;And all these things just come a little more real when we invoke the code at &lt;code&gt;main&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;semi = Person.new name, age, online
semi.greet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before the &lt;code&gt;greet&lt;/code&gt; is invoked. All the information we gave into the &lt;code&gt;new&lt;/code&gt; is bundled with the pattern we've sketched before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def initialize (name, age, online)
   @name = name
   @age = age
   @online = online
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, the inner boxes are just a little more special because of the prefix symbol &lt;code&gt;@&lt;/code&gt;. It means that all of these boxes are stored &lt;code&gt;at&lt;/code&gt; the same particular outer &lt;code&gt;box&lt;/code&gt; which is created when we invoke &lt;code&gt;Person.new&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And that prefix symbol is also the way we access those boxes in the definition of &lt;code&gt;greet&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;def greet
   if @online
      puts "Hello, World!"
      puts "I'm #{@name} and #{@age} times cycled around the Sun."
   else
      puts "You're offline now."
      puts "Go online first."
   end # if
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  And Classification of The Mind
&lt;/h2&gt;

&lt;p&gt;Then &lt;code&gt;information&lt;/code&gt; may come from other sources like static files on the Desktop folder. And an application may stimulate different lifetimes to work towards the liberation plane.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main = Proc.new { |*options|
   semi = Person.new "Semi", 32, true
   semi.greet
   puts "- - - - - - - - - -"
   marc = Crafter.new "Marc", 21, true
   marc.greet
   marc.craft
   puts "- - - - - - - - - -"
   fred = Teacher.new "Steven", 21, true
   fred.greet
   fred.teach
}

main.call
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yes, we know that &lt;code&gt;Crafter&lt;/code&gt; and &lt;code&gt;Teacher&lt;/code&gt; are just &lt;code&gt;Person&lt;/code&gt; to be classified. And each of these people may perform different labor act like &lt;code&gt;craft&lt;/code&gt; and &lt;code&gt;teach&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;class Person
   def initialize ...
   def greet ...
end # Person


class Crafter &amp;lt; Person
   def craft
      puts "#{@name} is crafting..."
   end
end # Crafter


class Teacher &amp;lt; Person
   def teach
      puts "#{@name} is teaching..."
   end
end # Teacher
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;Hello, World!
I'm Semi and 32 times cycled around the Sun.
- - - - - - - - - -
Hello, World!
I'm Marc and 21 times cycled around the Sun.
Marc is crafting...
- - - - - - - - - -
Hello, World!
I'm Steven and 21 times cycled around the Sun.
Steven is teaching...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yet, like the &lt;code&gt;Proc.new&lt;/code&gt; we've seen at first. The &lt;code&gt;class&lt;/code&gt;es are not only used to stimulate real world entities but also used to construct applications with conceptual elements of code. Things should go well when we have a little purpose to write more code of the uses. Do you want to create a simple Tic-Tac-Toe console app?&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Terms
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;class&lt;/code&gt; - a definition of a &lt;code&gt;class&lt;/code&gt; which group a certain kind of entities which have the same properties and abilities to perform acts.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;instance&lt;/code&gt; or &lt;code&gt;object&lt;/code&gt; - an actual &lt;code&gt;box&lt;/code&gt; encloses real information which is created by &lt;code&gt;Class.new&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;property&lt;/code&gt; - an inner &lt;code&gt;box&lt;/code&gt; which represent a piece of information stored &lt;code&gt;@&lt;/code&gt;t a certain &lt;code&gt;object&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;method&lt;/code&gt; - a &lt;code&gt;def&lt;/code&gt;inition of a block of code which describe the ability to perform an act.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;inheritance&lt;/code&gt; - the possibility of defining a new &lt;code&gt;class&lt;/code&gt; which make use of the definition of an existing &lt;code&gt;class&lt;/code&gt; to reduce repetitive code.&lt;/p&gt;

&lt;p&gt;See you in the next chapter: [ Gets in Ruby ]&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>tutorial</category>
      <category>fundamental</category>
      <category>beginners</category>
    </item>
    <item>
      <title>[ Boxes of Ruby ] The Starter Way to Manage Living Information in Applications</title>
      <dc:creator>Thinh Tran</dc:creator>
      <pubDate>Mon, 07 Nov 2022 04:29:26 +0000</pubDate>
      <link>https://dev.to/thinhtran130290/boxes-of-ruby-43lo</link>
      <guid>https://dev.to/thinhtran130290/boxes-of-ruby-43lo</guid>
      <description>&lt;p&gt;Previous chapter: &lt;a href="https://dev.to/thinhtran130290/introduction-to-ruby-2e46"&gt;[ Introduction to Ruby ]&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So, we pop up the calculator app, push some buttons to input some &lt;code&gt;information&lt;/code&gt; related to our living situations, and expect some output results. What's really happened behind the screen?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For most of us who are using a tech gadget in daily life, the common reason behind the whole world of technology is &lt;code&gt;information&lt;/code&gt;. I mean what we're truly seeking in the functions of the gadgets is always the ability to take care of our living &lt;code&gt;information&lt;/code&gt; in various aspects.&lt;/p&gt;

&lt;p&gt;Some may want a gadget to help simplifying calculations that ones need to perform on a living &lt;code&gt;information&lt;/code&gt; block. Some may want a gadget to help updating &lt;code&gt;information&lt;/code&gt; of the world around the Sun. And in our current time these all tasks may be taken of by a single device like a phone or a laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Box of Information
&lt;/h2&gt;

&lt;p&gt;It's hard to guess what's really happened behind the screen when we've not seen the &lt;code&gt;Hello, World!&lt;/code&gt; app. But, later then, things are simplified down as just a single tiny &lt;code&gt;box&lt;/code&gt; which can enclose almost every kind of &lt;code&gt;information&lt;/code&gt; that we put there.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new { |box|
   puts "Hello, #{box}!"
}

main.call 2023
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;ruby main.js

Hello, 2023!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, to write code to create a program may have the slimmest meaning as we're gonna create boxes after boxes to transmit and manipulate all kinds of &lt;code&gt;information&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Types of Information
&lt;/h2&gt;

&lt;p&gt;It's all started from our daily life and all the tasks that our mind has to engaged in. By updating and analyzing &lt;code&gt;information&lt;/code&gt;, our mind is generally dealing with some words, numbers, and sometimes logical identification results.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new { |name, age, online|
   if online
      puts "Hello, World!"
      puts "I'm #{name} and #{age} times cycled around the Sun."
   else
      puts "You're offline now."
      puts "Go online first."
   end
}

main.call "Semi-Art", 32, true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;ruby main.js

Hello, World!
I'm Semi-Art and 32 times cycled around the Sun.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Structured Types for Convenience
&lt;/h2&gt;

&lt;p&gt;Things like the &lt;code&gt;main&lt;/code&gt; in the example code is also a &lt;code&gt;box&lt;/code&gt;. We've used it to store an instance of a &lt;code&gt;procedure&lt;/code&gt; at first. And then we've use the dot notation &lt;code&gt;.&lt;/code&gt; to make a &lt;code&gt;call&lt;/code&gt; using the &lt;code&gt;procedure&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;call&lt;/code&gt; itself is a &lt;code&gt;box&lt;/code&gt;, too. It stored the core definition of the &lt;code&gt;procedure&lt;/code&gt; instance that we can apply to the listed pieces of information there. What a magical &lt;code&gt;box&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It also means that we can use one &lt;code&gt;box&lt;/code&gt; to wrap some others to represent things in our nature living world and things in software environment. And then that one &lt;code&gt;box&lt;/code&gt; which enclosed others is now called a structured type for convenience to express our mind into the code.&lt;/p&gt;

&lt;p&gt;Nope. We're not gonna make an example or the structured one here. These all are just to make our mind more comfortable with the unknown elements of the code. Just call everything &lt;code&gt;box&lt;/code&gt; until we start specify things by their own convenience.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Terms
&lt;/h2&gt;

&lt;p&gt;Since we're learning technical stuff, then technical terms are just necessary as slang words in our local living. And we'll just settle these words at the end of each posts to use in the next.&lt;/p&gt;

&lt;p&gt;[ Basic Types ]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;number&lt;/code&gt; - a technical name of the type to represent information in numbers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;string&lt;/code&gt; - a technical name of the type to represent text information.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;boolean&lt;/code&gt; - a technical name of the type to represent logical identification results as &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nil&lt;/code&gt; - a technical name of the type to represent the absence of information as &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;[ Some Boxes ]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;variable&lt;/code&gt; - a &lt;code&gt;box&lt;/code&gt; which is created on the flow of a series of statements anywhere in the code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;parameter&lt;/code&gt; - a &lt;code&gt;box&lt;/code&gt; which is created in the definition of a code block to take input information when the block gets called.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;object&lt;/code&gt; - a &lt;code&gt;box&lt;/code&gt; which enclosed other boxes then can be accessed using dot notation &lt;code&gt;.&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See you in the next chapter: &lt;a href="https://dev.to/thinhtran130290/classes-of-ruby-nbh"&gt;[ Classes of Ruby ]&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>tutorial</category>
      <category>fundamental</category>
      <category>beginners</category>
    </item>
    <item>
      <title>[ Introduction to Ruby ] The Programming Language Designed for Humanity by Japanese Snr.</title>
      <dc:creator>Thinh Tran</dc:creator>
      <pubDate>Mon, 07 Nov 2022 03:41:09 +0000</pubDate>
      <link>https://dev.to/thinhtran130290/introduction-to-ruby-2e46</link>
      <guid>https://dev.to/thinhtran130290/introduction-to-ruby-2e46</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;So, someone on Earth has told you to learn coding?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are a numerous doorways to get started with the code. But, you know, there's always some special choices which are preferred by lucky people. And one of those is Ruby - the programming language is designed for humanity by Japanese souls.&lt;/p&gt;

&lt;p&gt;For anyone who is starting to learn the code, the most important aspect of the starter tools is always about friendliness. And by the word "friendliness", what really I means is "human readability". The closer the language is to our nature tongue, the easier it is for us to engage in learning to express the logical thinking in the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hello, Ruby!
&lt;/h2&gt;

&lt;p&gt;And the first program that people ever wrote in any programming language is "Hello, World!". Just a seamless transient from our nature speaking language to a computer's one: "Hello, Ruby!"&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/Desktop/main.rb&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;main = Proc.new {
   puts "Hello, Ruby!"
}

main.call
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Does that make a sense? Just like the progress to do any task in our daily life, here we've given the computer a &lt;code&gt;Proc(edure)&lt;/code&gt; - a series of the steps needed to do to cause a result that we wished.&lt;/p&gt;

&lt;p&gt;It may end up with a change happened on the level of a Graphical User Interface application at some point on our learning progress. But, for the start time, it happens with a mere sign of a subtle message which is &lt;code&gt;put&lt;/code&gt; on our Command Line Interface window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Ruby
&lt;/h2&gt;

&lt;p&gt;Feeling eager to run your very first program written in Ruby? Here's the link where you can download the installer for Ruby Runtime Tools: &lt;a href="https://rubyinstaller.org/"&gt;Downloads Ruby Installer for Windows&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're a Linux user then you can search and install it from the default repository. Just a single command in the Terminal, I guess. Some thing like &lt;code&gt;sudo apt install ruby&lt;/code&gt; should work for a Ubuntu user, or &lt;code&gt;sudo dnf install ruby&lt;/code&gt; for a Fedora fellow.&lt;/p&gt;

&lt;p&gt;Got it installed? Then we can just run our very first program:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;cd Desktop
ruby main.rb 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  Hello, fellows coders!
&lt;/h2&gt;

&lt;p&gt;Noticed the point we &lt;code&gt;call&lt;/code&gt; our very first &lt;code&gt;procedure&lt;/code&gt;? That's the place where we can make our very first program a little more flexible. What if we can just bind a name or a kind of friendly word at that place and then the result just happens according to the object of the greeting phrase?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;main.rb&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;main = Proc.new { |name|
   puts "Hello, " + name + "!"
}

main.call "fellow coders"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CMD|Terminal.io&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;clear
ruby main.rb

Hello, fellow coders!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is that just a simple shiny tweak? We've added an input &lt;code&gt;|name|&lt;/code&gt; and use it in the greeting phrase to inject the to-be-bound value at the place when we call the &lt;code&gt;procedure&lt;/code&gt;. And by the time you've got familiar with some only Command Line basics that we ever need. It's good to move on and just learn more stuff only of the language Ruby itself.&lt;/p&gt;

&lt;p&gt;See you in the next chapter: &lt;a href="https://dev.to/thinhtran130290/boxes-of-ruby-43lo"&gt;[ Boxes of Ruby ]&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>tutorial</category>
      <category>fundamental</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
