Java 8 lamdas

I have always been attracted to simple but powerful designs. Last night I finally sat down to write a coding test for one company I have applied to. I was tasked to write a simple service with an API and so on. Naturally I ventured to see what is new in the Java world that I have not tried yet. And here it was, a tiny and beautifully thought through Java framework, that uses lamdas. I was sold on the first code snippet. Take a look:

import static spark.Spark.*;

public class HelloWorld {
  public static void main(String[] args) {
    get("/hello", (req, res) -> "Hello World");
  }
}

It is the very first thing you see on their landing page. Is not it beautiful?

Meet my new favourite pure-Java framework: Spark

I hope you will enjoy a framework that can be taught and learnt in a few code snippets.

Posted On

Category:

Tags: / /