Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Part 3.1Starting out with programming

Part 3.1Starting out with programming

The first program most programmers write is a "Hello world!" program. This article will discuss how to do this in YASS.

Display methods

For this computer program to have a meaningful output, it must send something to the display, in this case, "Hello world". Most languages offer a method for sending information to the console through the means of standard out (stdout) such as a print method. YASS is no different.

YASS
print("Hello world")
    

Program entry points

Most programming languages need programs to have an entry point. Some languages such as ZPE, Python and JavaScript define an entry point themselves (in some cases they look for an entry point but if they don't see one they will see the whole program as this).

An entry point is basically where the program begins. VB.NET is one language that does not necessarily make an entry point clear to user, but in the VB.NET console applications it is clear from the fact that it defines it's first subroutine as the Main subroutine.

When a program is written in C, you start with the main function. This is the entry point:

C
int main(){
  return 0;
}
    

In Java, you write the entry point as a main function too:

Java
public static void main(String args) {

}
    

In ZPE you don't need to explicitly write an entry point, but it is often found as it actually faster when it comes to compilation and interpreting programs. This is done with:

YASS
function main()

end function
    

The purpose of this entry point is to define the first thing the computer will do when it starts the program. In the Hello World program written in YASS, the print statement would be within the entry point function:

YASS
function main()
  print("Hello world!")
end function
    
Feedback 👍
Comments are sent via email to me.