Hack is a programming language that was created by Facebook in 2014. It was designed to work alongside PHP, which is the language used to create Facebook's website, and to address some of the shortcomings of PHP. Hack is a statically-typed language that is compiled and runs on the HHVM (HipHop Virtual Machine), which is also developed by Facebook. In this beginner's guide, we will explore the biography of Hack language, learn how to write it with an example, and discover the best applications for it.

Biography of Hack:
Hack was created by Facebook in response to some of the limitations of PHP. PHP is a dynamically-typed language, which means that variables don't have a specific type until runtime. This can lead to errors and inefficiencies in large codebases. Additionally, PHP doesn't have great support for object-oriented programming or asynchronous programming.

Hack addresses these issues by introducing static typing, which means that variables have a specific type at compile-time. This catches errors earlier in the development process and can lead to faster execution times. Hack also has better support for object-oriented programming and asynchronous programming, making it a more modern and flexible language than PHP.

Writing Hack Code:
Hack code looks very similar to PHP code, but with some additional syntax to support static typing. Here is an example of a simple Hack program that prints "Hello, world!" to the console:

```
<?hh // declare the Hack version

function main(): void {
  $message: string = "Hello, world!";
  echo $message;
}
```

In this code, we declare the version of Hack that we are using with the `<?hh` syntax. We then define a function called `main`, which doesn't take any arguments and doesn't return anything (`void`). Inside the function, we define a variable called `$message` and give it a type of `string`. We then set the value of `$message` to "Hello, world!" and use the `echo` statement to print it to the console.

Best Applications for Hack:
Hack is most commonly used for web development, specifically with the HHVM and in conjunction with PHP. It can be used to build fast and efficient web applications, especially those that require a lot of real-time communication. Hack is also a great choice for large codebases, as its static typing catches errors early and helps prevent bugs.

One notable application of Hack is the creation of the Hack compiler, which is used to transform PHP code into Hack code. This allows developers to take advantage of Hack's features without having to completely rewrite their existing PHP codebase.

Conclusion:
Hack is a revolutionary programming language that was created by Facebook to address some of the limitations of PHP. With its static typing and support for modern programming techniques, Hack is a powerful and flexible language that is ideal for web development and large codebases. By following this beginner's guide, you now have a better understanding of the biography of Hack, how to write it with an example, and the best applications for it.