# Solidity Hello world

This article will show you a quick step-by-step guide to write your first "Hello World" in Solidity.

<iframe width="905" height="510" src="https://www.youtube.com/embed/MC5HC6GOr-w"></iframe>

### Remix IDE

Visit http://remix.ethereum.org, and be sure to select "Default Workspace" if it isn't selected already.

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651458668520/8yPo4Issk.png align="left")](https://youtu.be/MC5HC6GOr-w)

### HelloWorld.sol file

In Solidity, the file extension we use is .sol.

Create a new file called "Hello world.sol" by clicking the icon 🗒️at the top-left

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651458752736/j_gN5MFbJ.png align="left")](https://youtu.be/MC5HC6GOr-w)

Then Populate the HelloWorld.sol file

```javascript
// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.8.7;

contract MyContract {
    string public hello = "Hello World";
}
```

The first line is the license. We write that to avoid compiler warnings.

"pragma solidity" is the version we want to use.

For now, you can think of a "contract" as a class (it's a very similar concept if you are familiar with object-oriented programming).

Personally, I like the fact that Solidity uses reserved keywords such as "contract", and "address", which are very specific to smart contracts and it makes it very clear to understand what's going on.

### Compile the "HelloWorld.sol" file

Click on the Solidity logo on the left to access the Compiler.

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651460845961/l-Epg8j1s.png align="left")](https://youtu.be/MC5HC6GOr-w)

Leave everything as default and click the "Compile HelloWorld.Sol" button

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651459019247/Uj2gAVTYf.png align="left")](https://youtu.be/MC5HC6GOr-w)

### Deploy to test network

One of the reasons why using the Remix IDE is so convenient is that we can deploy automatically on a test network in the browser without setting up a whole environment, which is not very simple for someone getting started writing Solidity code.

Click the "Ethereum-like" icon on the left, that says "Deploy and run transactions".

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651459087258/JOnRjVYwR.png align="left")](https://youtu.be/MC5HC6GOr-w)

Click the orange "Deploy" button:

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651459193857/jcsftnny0.png align="left")](https://youtu.be/MC5HC6GOr-w)

Click the "&gt;" next to "MYCONTRACT AT ..." at the bottom. It's hard to spot if you are not used to that because it's gray. Here is a picture to give you an idea.

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651459242112/szq-Cix7V.png align="left")](https://youtu.be/MC5HC6GOr-w)

### Last step: "Hello World"

Another reason for using Remix is that we can test the value of the variables directly inside the browser!

Click on the "hello" blue button to check the variable's value we just defined.

[![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651459301275/WhEgic5Gg.png align="left")](https://youtu.be/MC5HC6GOr-w)

Do you prefer the Video Version? Just click the link below.

<iframe width="905" height="510" src="https://www.youtube.com/embed/MC5HC6GOr-w"></iframe>

Let me know what you think in the comments

[Francesco](http://francescociulla.com)
