___|  _ \   |  |    |   |_ _|\ \     / ____|
 |     |   |  |  |    |   |  |  \ \   /  __|
 |   | |   | ___ __|  ___ |  |   \ \ /   |
\____|\___/     _|   _|  _|___|   \_/   _____| 

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

How to write a simple program: "Hello World"

BY: @superfreek | CREATED: Aug. 23, 2016, 5:08 a.m. | VOTES: 30 | PAYOUT: $0.58 | [ VOTE ]

Hello World

https://pixabay.com/static/uploads/photo/2016/05/02/01/32/barbie-1366378_960_720.jpg

Hello world is a small, simple program that is used to demonstrate the syntax of a programming language.

Ruby

http://i.imgur.com/VG0sp1O.png

If you read my last post, I recommended ruby. That will be the programming language we'll be using to write our simple program. You can download ruby here for any platform:
https://www.ruby-lang.org/en/downloads/

The Program

http://i.imgur.com/7aAhti4.jpg
Here is the entire “Hello World” program written in ruby:

puts “Hello World”

If you saved that snippet as hello_world.rb (a ruby file), and ran it in your terminal(or command prompt on windows), it would look like this:

ruby hello_world.rb
Hello World

the first line in the above snippet is running the program hello_world.rb, and the second line is the output from the program, in this case, it is printing Hello World.

Demo

http://i.imgur.com/pyVURiU.png
I made a gif showing me writing this program from the start, I’m using vim as the text editor to write the ruby file, save it, then run it with the same commands I used above:
http://i.imgur.com/TyK7CSV.gif

That’s it! First Program Written. We're all programmers now.

A bit about me

I've been learning about programming for at least a decade, and I probably won't stop. You can check out my intro post and some of the projects I've worked on:

https://steemit.com/introduceyourself/@superfreek/a-developer-introduction-post

And my last post "How to become a self-taught programmer":

https://steemit.com/tag/@superfreek/how-to-become-a-self-taught-programmer

TAGS: [ #programming ] [ #introduceyourself ] [ #steemit ] [ #life ] [ #money ]

Replies

@jarvis | Aug. 23, 2016, 5:13 a.m. | Votes: 0 | [ VOTE ]

What was the best part of your weekend?

@veerprit | Aug. 23, 2016, 5:13 a.m. | Votes: 1 | [ VOTE ]

Spacemacs better than vim. Everyone knows this.

Nice post though

@craigwilliamz | Aug. 23, 2016, 5:14 a.m. | Votes: 0 | [ VOTE ]

Welcome to Steemit! If you would like to see statistics of any post on Steemit, you can use Steemd.com. I have made a bookmark for your convenience in accessing Steemd. https://steemit.com/steemd/@craigwilliamz/steemd-statistics-bookmark-for-easy-access-to-steemd

@me-confucius | Aug. 23, 2016, 5:14 a.m. | Votes: 0 | [ VOTE ]

Boldness, without the rules of propriety, becomes insubordination.

@lizzie | Aug. 23, 2016, 5:41 a.m. | Votes: 0 | [ VOTE ]

Wow! Amazing post! I look forward to reading more.

@veerprit | Aug. 23, 2016, 7:48 a.m. | Votes: 0 | [ VOTE ]

rofl

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>