What programming language should you learn?

Feel free to reply if you see anything wrong in this guide.

Because practically everyone on ORE is a programmer, I think that it’d be good for some new coders to pick what programming language they should learn. Coding can also help with redstone at some point (it did for me).

Now, each programming language is different. Thus, it doesn’t answer which programming language you must learn. There’s no “best programming language”, thus, you have to pick your programming language depending on what you want to make.

HTML/CSS/Java Script

HTML and CSS aren't a programming language, JavaScript is a scripting language.

Learn HTML if you’d like to create websites. Before learning CSS and JavaScript, you must start learning HTML. HTML stands for HyperText Markup Language, and as it says, it is a markup language.

With HTML, you can use CSS and JavaScript.
Practically every page is made with HTML, even if someone who wrote it, didn’t write it with HTML. Not all websites are made with HTML - some use ASP for instance, though HTML is the most popular.

To get started with HTML, Download and Install Microsoft Visual Studio Code (VSCode). To download the installer, go to the official website - code.visualstudio.com , and download for your operating system. If you don’t want to install VSCode, but want to use it, there’s an official online version of it, with many missing features. You can get there by going to vscode.dev (the URL actually works).

In VSCode, go to File → New Text File. Click on “Select a language”, type and select “HTML”.
Now, you can write an HTML, CSS and JS page in a text editor.
Once done, press Ctrl + S, save it as File.html, where “File” can be anything.
Then, simply double click the HTML, and it should open with your default browser. And you can view the page offline!

VSCode Tip: Typing “html5” and selecting what’s coming from the list will insert the basic structure of HTML. Good for saving up time!

You can also create other types of code/files by choosing other languages from the “Select a language” dialog.

To write “Hello, World!” in HTML, including JS and CSS, use this:

<!-- This is a comment. -->
<!DOCTYPE html> <!-- Tell the browser that this page is written in HTML (optional, but fixes many bugs). -->
<html lang="en-US"> <!-- The HTML tag is where everything is inserted. The LANG attribute is optional, and tells the browser the language of the site. -->
    <head> <!-- The HEAD tag is where the header of the page (for instance, importing CSS) are described. -->
        <title>My page!</title> <!-- The TITLE tag is mostly put under HEAD, and it tells the name of the tab. If you omit this tag, the name of a tab is the name of an HTML file. -->
        <!-- The STYLE tag is where CSS is written. -->
        <style>
          * { color: blue; }
        </style>
    </head>
    <body> <!-- BODY is where the main page content is displayed. -->
    <!-- H1 specifies a heading. Lower H# numbers specify the smaller font. These range from H1-H6. -->
        <h1>Hello, World!</h1>
        <h2>Hello, World!</h2>
        <h3>Hello, World!</h3>
        <h4>Hello, World!</h4>
        <h5>Hello, World!</h5>
        <h6>Hello, World!</h6>
        <p>Hello, World!</p> <!-- The P tag specifies the Paragraph. -->

		<p>By default, the color is black. Using CSS made it so every text on the page is blue. The default HTML font (this font) is Times New Roman.</p>
        <!-- The SCRIPT tag specifies the JavaScript code. The DEFER attribute means that JavaScript will only run after the page has finished loading. The alert box will pop up. -->
        <script defer>
            alert("This message is called from JavaScript!"); // In JavaScript, we use // to create a comment, or /* ... */ to create a multiline comment. alert("text..."); will show an alert.
        </script>
    </body>
</html>

If you simply want a Hello World, use this. No JavaScript, no CSS.:

<!DOCTYPE html>
<html>
    <body>
        <h1>Hello, World!</h1>
    </body>
</html>



So, CSS means Cascade Style Sheet, and is used to decorate the website. JavaScript helps the website to do operations, such as math, cookies, alerts, and so on.

I’ve learned these languages from:
HTML: HTML Tutorial
CSS: CSS Tutorial
JS: JavaScript Tutorial

PHP

PHP is pretty hated, but as many people say, PHP devs drive a lambo. In other words, you make a lot from PHP. PHP is also related to web development (requires you to know HTML). The thing is, JavaScript is client side, and PHP is server side. PHP is widely used for things like Login Forms.
It's not worth learning PHP for a new coder.

Python

Python is good for new coders. Its syntax is very easy, and it's not hard to get started. Python is very popular. It is widely used for Machine Learning, Simple scripting. Python is not good for Software Development (an IDE for example).

Python is normally not precompiled and is interpreted, making it easier for a new coder.
To get started, install an IDE. You can use VSCode, but I’d recommend to use JetBrains PyCharm Community. You can also use an online compiler, for example, Online Python Compiler (Interpreter).

The syntax for python is very simple. One line of code is enough to print “Hello, World!”:

print("Hello, World!")

Optionally you can also add a semicolon at the end. Make sure not to show that you’re using a semicolon in python to a real python coder :wink:

print("Hello, World!"); # semicolon makes python coders mad
# comments in python start with a hashtag symbol

If you want to run the python program, you can, again, use an IDE, or install Python from their official website, save the code as a file ending with .py, and open CMD and type python myscript.py, where myscript is the name of your python script.

Assembly

Assembly is a low level language, the first programming language in the world, made in 1947 for the All Purpose Electronic Computer (APEC). Using assembly for program development is just stupid, but it's worth learning Assembly to get more into how CPUs in Minecraft work.
Learning a bit of assembly can help you to run programs on the majority of Minecraft CPUs. However, it is not important to learn assembly - you can simply remember most of the CPU instructions and inner workings of a CPU in case if you don't want to learn assembly. Though, it might take lots of practice.

I haven’t found a way to run assembly code, because I am not that much of an “assembly guy”. I only know how to run assembly on an online assembly compiler, which you can do here → Online Assembly Compiler - asm

By the way, Assembly is the world’s fastest programming language.

This is the code to print “Hello, World!” in assembly (took that from an online assembly compiler).

section	.text
	global _start       ;must be declared for using gcc
_start:                     ;tell linker entry point
	mov	edx, len    ;message length
	mov	ecx, msg    ;message to write
	mov	ebx, 1	    ;file descriptor (stdout)
	mov	eax, 4	    ;system call number (sys_write)
	int	0x80        ;call kernel
	mov	eax, 1	    ;system call number (sys_exit)
	int	0x80        ;call kernel

section	.data

msg	db	'Hello, world!',0xa	;our dear string
len	equ	$ - msg			;length of our dear string

0IQ people would use that large code to print Hello World, but 2 billion IQ people would use one line of code, install nasm on their machine, and convert assembly to data to save “Hello, World!” and one extra
n ull character to a file:

; assembly code
dw "Hello, World!" ;dw means Data Write, 64-bit assembly I believe

Then they install nasm, and on linux, they use this:

$ nasm -f bin main.asm -o data
$ cat data
Hello, World!

$

Windows:

C:\Windows> NASM.EXE -f bin main.asm -o data
C:\Windows> TYPE data
Hello, World!

C:\Windows >

Now, this was just a joke. It’s definitely pointless to install that, but whatever.

C

Note: Learning C as a new coder is not recommended.

C is a general-purpose high-level dynamically typed programming language, developed in 1972. It is considered as the “mother of programming languages”, for which, C makes the world go around. In other words, C is where most operating systems, kernels, apps, programming languages are made.

C, although is almost (or even is) 51 years old, it is still used quite frequently. It is perfect for writing operating systems, kernels, programming languages, and similar things. You can also use C to create console apps. C takes the top 2 of the fastest programming languages in the world.

The syntax for C is hard at first, but progressively gets easier. An example program to print Hello World is:

#include <stdio.h>
// include command imports a header file, which is as if you pasted the code from another code to the current one, with some little differences

int main()
{
    // Functions named "main" are the entry point
    printf("Hello, World!"); // Printf stands for "print formatted". Every command should end with a semicolon.

    return 0; // The return status - mostly, 0 is success, and 1 is failure. This can range from 0 to 255.
}

Without comments:

#include <stdio.h>

int main()
{
    printf("Hello, World!");

    return 0;
}

Learning C is worth it to create fast apps.

C++

C++ is not really a programming language - it's technically C, with just added features. C++ is an extension for C. C++ was made in 1980 or 1985. This is how to print "Hello, World!" in C++.
#include <iostream>

int main() {
    std::cout << "Hello, World!";
    return 0;
}

You can use an online compiler for C++. How about an IDE?
Use Visual Studio to create C++/C programs. I will explain how to at the end.

Learn C++ if you want to make fast apps, but with more features - you can use Qt library to create GUI with C++ for example. If C is not enough for you, C++ might be.

C#

Personally my favorite, but requires a lot to know. C# is a high-level dynamically-typed programming language created by Microsoft in January 2002, and is similar to Java.

C# is an Object-Oriented programming language. C#'s possibilities are endless. Here is a simple C# program to print Hello World to the screen (.NET Framework).

sealed public class Program
{
    public static void Main()
    {
        System.Console.WriteLine("Hello, World!");
        System.Console.ReadKey(); // The program will not close, until the user closes the window, kills with Task Manager or other tool, or presses any key.
    }
}

Let’s get just a bit fancier, with another very simple program to get the content from a file, increment, and write it back.
To specify a file, use command-line argument 1.

using System;
using System.IO;

sealed public class Program
{
    public static void Main(string[] args) // string[] args Specifies command-line arguments. `args' can be anything. (optional)
    {
        // Attempt to get every text from a specified file as a 32-bit integer.
        // The question mark '?' specifies that this variable can be nullable.
        int? Content = null;
        
        try
        {
            Content = Convert.ToInt32(File.ReadAllLines(args[0])[0]); // get only first line in a file
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message.ToString()); // Output error message
            Environment.Exit(1); // Close console with error code 1
        }
        
        Content++; // Increment content
        
        File.WriteAllText(args[0], Content.ToString()); // Write content as string back. Note that this will overwrite the file.
    }
}

I will also explain how to get started with C# at the end.

Learn C# if you want to create apps that run on Windows, or desktop apps. C# might be the best programming language ever to create Windows apps.
C# can also be used to build practically anything:

  • 2D and 3D games with the Unity Framework,
  • Cross-platform apps with .NET Core, or Windows apps with .NET Framework,
  • Mobile apps with Xamarin,
  • Web apps with Blazor,
  • Desktop apps with a set of common controls (C:\Windows\System32\comctl32.dll), such as default Button, using built-in feature for C# called Windows Forms,
  • Desktop apps with advanced user interfaces, using built-in feature for C# called WPF (Windows Presentation Foundation), which will require you to learn a markup language called XAML.

C# also has something called NuGet Package Manager, where you have access to download any library out of billions of different ones from different providers. If you’re a software engineer, I highly recommend you to give C# a try. Hard at first, but progressively gets easier.

Java

Java is Object-oriented high-level dynamically-typed programming language, created in 1995. Java is hated by a large amount of people. Its syntax is similar to C#. Many people would prefer C# over Java. Because Java is slow, and also I believe because the open braces { must be inline, cannot be in a new line:
// GOOD:
public class HelloWorld {

// BAD:
public class HelloWorld
{

This is the syntax to print Hello, World! onto the screen:

public class HelloWorld {
    public static void main(String [] args) {
        System.out.println("Hello, World!");
    }
}

To get started with Java, install Java first.
Then, for an IDE, I and many others, would prefer JetBrains IntelliJ. So download IntelliJ Community from JetBrains’s official website.
Therefore, you can write and run your Java code!

Good to know

Java has their own executables, called JAR (Java ARchive). These executables only run with Java itself. These JAR's are secretly a ZIP file. I believe that's the main way to compile Java.

Why does Mojang use Java to create Minecraft then?

Whoever the human is, they might like what others dislike. In this case, because Java has some really nice graphics libraries: LWJGL, OpenAL, and other. Of course, I believe the performance would be better if the game wasn't written on Java.

Java vs. C#

Java and C# have their goodies. I will only show some. Let's start with Java:
Possibility C# Java
Can be used to create apps on Android No Yes
Can be used to create Minecraft Mods No Yes
Can be used to create Minecraft server plugins Yes, but people preferably use Java Yes
Supported on practically any OS or platform No Yes

And C#:

Possibility C# Java
Better for creating Windows apps Yes Can be, but it's easier with C# to create Windows Apps
Better performance Yes No
Good for working with data Yes (ADO.NET) Not quite
Better for Machine Learning Yes (ML.NET) No
Better for working with Databases Yes (Entity Framework) No

Why should I learn Java?

The only reason I see to learn Java, is for anything related with Minecraft.

SQL

SQL is used for working with databases. SQL stands for Structured Query Language. Learn SQL if you want to work with databases.

This is the little code to create a table and insert values to it.

-- Recreate the table

DROP TABLE IF EXISTS People;
CREATE TABLE People(Age int, Name text, Country text);

-- Insert values to it

INSERT INTO People VALUES(19, "Jake", "Mexico");
INSERT INTO People VALUES(21, "Ryan", "USA");
INSERT INTO People VALUES(17, "Robert", "France");
INSERT INTO People VALUES(83, "Michael", "Ohio");

-- Print values in table "People", order by Age.

SELECT * FROM People ORDER BY Age;

Good to know

SQL is not used for software engineering, but it can help with software engineering. What I mean by that is, you can't just create a software using SQL as the only language - SQL is not intended for software development. However, SQL is widely used in software engineering for manipulating data, such as Login Forms. You can create the main application from C# for example, and SQL to manipulate databases.

I recommend installing Microsoft SQL Server if you’d like to work with SQL.

Kotlin

The last one on the list of programming languages. Kotlin is very good for creating Android apps. It is also good if you want to be a billionare :smirk: (Because as far as I know, its average salary is $~130K per year).

This is the syntax to print "Hello, World!’ into the console:

fun main() {
    println("Hello, World!")
}










































Get started with C/C++

First, download Microsoft Visual Studio. Go to visualstudio.microsoft.com to download it. In the main page, in the top navigation bar, click on Downloads, and select the latest Community version.

Run the installer once fully downloaded. Note that this will install Visual Studio’s installer first. Installer installs an installer. Accept license terms.

Next up, workloads. Select “Desktop development with C++” and click “Modify” or “Install”. Wait for it to finish installing. VS will ask you to restart your device, so do so.

Notice: Even after the installation of Visual Studio 2022 finishes and the computer reboots, do not uninstall Visual Studio Installer. Only uninstall it AFTER you UNINSTALL Visual Studio 2022.

On the next reboot, open the Start Menu, type visual studio 2022. Open Visual Studio 2022.

You can skip creating an account, you don’t need. Then pick your preferred theme, and visual studio will start.

Next, click on “Create new project”. Sort by “C++”, “Windows”, “Console”. Select “Console application” and ensure it says “C++” on the bottom of it. Click “Next”. Name your project, and location. Keep the result default. Click “Create”.

Now, write your code. Once satisfied, click “Local Windows Debugger” along with the play button next to the text, on top. This will open a console app called “Microsoft Visual Studio Debug Console”, and will run your program and compile it.

How to run a C program in Visual Studio?

There is no option to run C program in VS, but you can do it. First, sort by C++ only. Select "empty project", and create it.

Next, press Ctrl + Shift + A. Select C++ File, and the filename on the bottom text area must end with .c instead of .cpp. Click "Add" on the very bottom right of the dialog.

This way, you can write and run a C program.

Get started with C#

Again, install Visual Studio. Just install Visual Studio installer, don't go any further.

In Visual Studio Installer, find and check Desktop development with .NET. Click “Modify” or “Install”.

Again, open Visual Studio with the Windows Search Menu, skip creating an account, pick your preferred theme, and start VS.

Click “Create New Project”. Sort by C#, Windows, Console. Find and select Console App (.NET Framework), don’t select the one that does not say “(.NET Framework)” at the end. Click “Next”, name your project and its location, and click “Create”.

Again, a maximized code editor for VS opens up. Write your code, and click “Start” with the green play button before the text. You can also press F5 to start with Debugging (same as the Start button), or Ctrl+F5 to start without debugging, which is the green button without the text “Start”. When started with debugging, an EXE opens up instantly, which is different than starting without debugging, where the EXE starts in CMD.EXE. Running without debugging is also much faster during runtime and compile time.

You can get to the EXE file. It is located in (path where you selected at “Configure your project” menu, usually %USERPROFILE%\source\repos)\ProjectNameHere\ProjectNameHere\bin\Debug, and its name is ProjectNameHere.exe, where ProjectNameHere can be anything.





Feel free to reply if you see anything wrong in this guide.

1 Like