Hello world? The first tutorial for any language!
Lets have a breakdown of a simple hello world in a few popular ones.
JavaScript
Most likely the most demanded programming language in 2022.
document.write('Hello World!'); window.alert('Hello World!');
Python
What a simple language (if you don’t mind using indenting instead of brackets), believe it or not the below will work by just adding it to a .py file (assuming you have Python installed), just a simple one line of code! Want to find out how to get Python running in a dev container?
print('Hello World!')
C#
Of course this one liner isn’t going to work on its own and will write to the console, not to a WinForms, WPF app etc.
Console.WriteLine("Hello World!");
Java
Again, this prints out to the console but you will need to wrap within more code.
System.out.println("Hello World!")
PHP
Used for web development PHP, you can simply embed the block below within your .php webpage and it will print out to screen as HTML (as it executes server side). Both lines print to the screen, echo is a simple way to write to the screen, print on the other hand works in a similar way but also has a return type.
echo "Hello World" print("Hello World")
GDScript
So most (but hopefully not all) may wonder what on earth GDScript is? Recently I have started looking at games development (not my background) and GDSrcript was created for the Godot games engine. I plan to post a number of articles around my game engine experiences so watch this space.
For those who want to take a look right now then head on to https://godotengine.org/ and take a look!
print('Hello World!')
Summary
So there are a few basic examples of the first thing programmers tend to do in a new language.
There are so many programming languages out there to learn and so little time (or need to be honest).
I like to keep my blog interactive so if you want to add to the above you’re more than welcome just pop an example with a short description in a comment and I will get it added in!
Are you starting out in development as student? Would you like a special offer with Amazon Prime, 6 months free and the half price? Then grab our link here.
This is an affiliate link which means if you decide to sign up then we get a small amount to help us keep code monkey club going.
The icons in this page come from icons8.com which is a great source of icons for many purposes.
Leave a Reply