Beginner's Guide to Coding and Data

Level: Beginner

Saving and running programs explained | Hello world for programming beginners (Part 2)

video

expand_more chevron_left

text

expand_more chevron_left

Crafting Our First Programs

After diving into the Hello World lesson, it's time to take things up a notch. We're going to explore how to make our program a bit more permanent across different environments. Let's look at how to do this using PowerShell, JavaScript, and on a Linux machine.

To achieve our goals, we'll proceed through the following steps:

  • Executing Hello World in PowerShell
  • Running Hello World in JavaScript
  • Executing Hello World on a Linux machine

PowerShell: Our First Stop

Our first stop is PowerShell, a robust command-line interface for Windows platforms. To start, let's open Notepad and type the command:

Write-Host 'Hello World';

To save and execute this PowerShell program, we'll follow these steps:

  1. Go to File, then Save As in Notepad
  2. Name the file as HelloWorld.ps1
  3. Open PowerShell and navigate to the location where the file is saved
  4. Run: .\HelloWorld.ps1

JavaScript Programs

Next, we'll shift our focus to JavaScript. Open a new Notepad window and type the following:

<script>
console.log('Hello World');
</script>

Unlike PowerShell, we'll save this code as an HTML file, making it readable by web browsers. After saving, we open the HTML file in a web browser and access the Developer Tools to see the output in the console.

Transitioning to a Linux Machine

Finally, we'll try our hand at a Linux environment. Open a text editor and type:

echo 'Hello World'

To execute this on Linux, we save the file with a .sh extension and follow these steps:

  1. Navigate to the location where the .sh file is saved
  2. Run: sh HelloWorld.sh

And there we have it! We've successfully executed Hello World programs in three different environments. If you have any questions, feel free to hit the comments or check out our other tutorials for more insights.

How Code Looks in Movies

Hollywood always tries to make code execution extra dramatic. This is something funny to consider after knowing how code works.

Here is an example to consider:

quiz

expand_more chevron_left
deeplizard logo DEEPLIZARD Message notifications

Quiz Results

resources

expand_more chevron_left
Hello world programs show us how to communicate with the outside world from inside our programs. Let's look at this in more detail. Saving our programs in files is how we begin to build more sophisticated programs. Once our code is saved, we will interact with the program opposed to the code and data directly, and this will make log messages like hello world necessary for to know what our programs are doing. 1) Save our programs so we can run them at a later time. 2) Group our code into files to create distinct programs. 3) PowerShell, JavaScript, LinuxTerminal (Bash) πŸ•’πŸ¦Ž VIDEO SECTIONS πŸ¦ŽπŸ•’ 00:00 Welcome to DEEPLIZARD - Go to deeplizard.com for learning resources 00:30 Help deeplizard add video timestamps - See example in the description 05:20 Collective Intelligence and the DEEPLIZARD HIVEMIND πŸ’₯🦎 DEEPLIZARD COMMUNITY RESOURCES 🦎πŸ’₯ πŸ‘‹ Hey, we're Chris and Mandy, the creators of deeplizard! πŸ‘€ CHECK OUT OUR VLOG: πŸ”— https://youtube.com/deeplizardvlog πŸ’ͺ CHECK OUT OUR FITNESS CHANNEL: πŸ”— https://www.youtube.com/channel/UCdCxHNCexDrAx78VfAuyKiA 🧠 Use code DEEPLIZARD at checkout to receive 15% off your first Neurohacker order: πŸ”— https://neurohacker.com/shop?rfsn=6488344.d171c6 ❀️🦎 Special thanks to the following polymaths of the deeplizard hivemind: Mano Prime πŸ‘€ Follow deeplizard: Our vlog: https://youtube.com/deeplizardvlog Fitness: https://www.youtube.com/channel/UCdCxHNCexDrAx78VfAuyKiA Facebook: https://facebook.com/deeplizard Instagram: https://instagram.com/deeplizard Twitter: https://twitter.com/deeplizard Patreon: https://patreon.com/deeplizard YouTube: https://youtube.com/deeplizard πŸŽ“ Deep Learning with deeplizard: AI Art for Beginners - https://deeplizard.com/course/sdcpailzrd Deep Learning Dictionary - https://deeplizard.com/course/ddcpailzrd Deep Learning Fundamentals - https://deeplizard.com/course/dlcpailzrd Learn TensorFlow - https://deeplizard.com/course/tfcpailzrd Learn PyTorch - https://deeplizard.com/course/ptcpailzrd Natural Language Processing - https://deeplizard.com/course/txtcpailzrd Reinforcement Learning - https://deeplizard.com/course/rlcpailzrd Generative Adversarial Networks - https://deeplizard.com/course/gacpailzrd Stable Diffusion Masterclass - https://deeplizard.com/course/dicpailzrd πŸŽ“ Other Courses: DL Fundamentals Classic - https://deeplizard.com/learn/video/gZmobeGL0Yg Deep Learning Deployment - https://deeplizard.com/learn/video/SI1hVGvbbZ4 Data Science - https://deeplizard.com/learn/video/d11chG7Z-xk Trading - https://deeplizard.com/learn/video/ZpfCK_uHL9Y πŸ›’ Check out products deeplizard recommends on Amazon: πŸ”— https://amazon.com/shop/deeplizard πŸ“• Get a FREE 30-day Audible trial and 2 FREE audio books using deeplizard's link: πŸ”— https://amzn.to/2yoqWRn 🎡 deeplizard uses music by Kevin MacLeod πŸ”— https://youtube.com/channel/UCSZXFhRIx6b0dFX3xS8L1yQ ❀️ Please use the knowledge gained from deeplizard content for good, not evil.

updates

expand_more chevron_left
deeplizard logo DEEPLIZARD Message notifications

Update history for this page

Did you know you that deeplizard content is regularly updated and maintained?

  • Updated
  • Maintained

Spot something that needs to be updated? Don't hesitate to let us know. We'll fix it!


All relevant updates for the content on this page are listed below.