[Programming Encyclopedia] §2 Try using Ruby

Purpose

Although I was enthusiastic about "Let's learn programming !!" Programming seems to be difficult, I can't read English, I'm not good at PC operation itself, For you who were frustrated a long time ago __ Read this article ・ Just move your PC and you'll see "What! Programming is interesting!" The purpose is to make you think. __

I would like to serialize it under the title of Programming Encyclopedia.

Development environment

Ruby program execution

This is a continuation of Last time. Let's run it using Ruby in earnest!

procedure

  1. On the desktop, rename "Right click"-> "New folder"-> "sample.rb"
  2. Open VsCode and press "⌘ + o" to open "Desktop"-> "sample.rb"
  3. Type the following program into VsCode!

sample.rb


puts "Hello World"

Once you've done that, call spotlight with "⌘ + space" and search for "terminal"! Check the following in the terminal.

$ cd desktop 
$ ls #Check the files contained in the desktop.
$ cd sample.rb
$ ruby sample.rb #If the content you typed in Vs Code is reflected here, it will be successful
Hello World

that's all! From here ** puts "Hello World" ** Let's take a look at the contents of.

** puts "Hello World" ** "Hello World" is a character string to be displayed on the PC. The character string is basically enclosed in "" (double quotation marks) or "" (single quotation marks).

** puts "Hello World" ** puts are methods.

What is a method?

A method is a command army that performs processing in programming. By describing the method name in programming, the method processing is executed. There are various method processes, and ten numerical calculations are possible.

What is the puts method?

The puts method used this time is a method that outputs characters to the terminal. Insert a half-width space between puts and the character string.

that's all! This time I just output the character string on the screen, Next time I would like to use operators,

Remarks

─────────────────────────────── ■ Books recommended by the author ───────────────────────────────

"Introduction to Web Technology to Become a Professional"

"How to think about changing jobs"
"High power marketing"
"Courage to be disliked"
"Complete output"

─────────────────────────────── ■ Movies recommended by the author ───────────────────────────────

"My Intern"
"Shin Godzilla"
"Dragon Ball Super Broly"
「School of Roc」

Recommended Posts

[Programming Encyclopedia] §2 Try using Ruby
Try using Cocoa from Ruby
Try using gRPC in Ruby
[Complete programming] §3 Let's calculate using Ruby!
Try using libGDX
Try using Maven
Try using powermock-mockito2-2.0.2
Try using GraalVM
Try using jmockit 1.48
Try using sql-migrate
Try using SwiftLint
Try using Log4j 2.0
Try Ruby Minitest
Try using GPS receiver kit with RaspberryPi3 (Ruby)
Try using JobScheduler's REST-API
Try using java.lang.Math methods
Try using PowerMock's WhiteBox
Try using Talend Part 2
[Programming Encyclopedia] §1 First time programming
Try using Talend Part 1
Try using F # list
Try using each_with_index method
Try using Spring JDBC
Try using the query attribute of Ruby on Rails
Try using RocksDB in Java
Try using GloVe with Deeplearning4j
Try using view_component with rails
Try scraping using java [Notes]
Try using letter_opener_web for inquiries
DB programming using EclipseLink part1
Creating a calendar using Ruby
[Swift] Try using Collection View
Ruby Learning # 99 Personal Programming Notebook
Statically typed Ruby using Sorbet
Create a fortune using Ruby
Try using IntelliJ IDEA once
Try using Spring Boot Security
[Rails] Try using Faraday middleware
[Processing] Try using GT Force.
People using docker Try using docker-compose
Easily try Ruby 3.0.0 type checking (rbs)
Write Ruby methods using C (Part 1)
Try using Redmine on Mac docker
Install Ruby 2.5 on CentOS 7 using SCL
Programming with ruby (on the way)
Try using Redis with Java (jar)
[Java] Try to implement using generics
Try using the messaging system Pulsar
Try using IBM Java method tracing
[Ruby] Search problem using index method
Summary of object-oriented programming using Java
Try using Hyperledger Iroha's Java SDK
[Java] Where did you try using java?