How I hacked es6 feature into Java

Görkem Erol
4 min readFeb 20, 2018

Java is C++ without the guns, knives. — James Gosling.

You may not believe me how a single web language feature took over Java’s println method in my hands, but I tried to do something that nobody has done since 1995.

In March 2015, ECMAScript6(es6) or ECMAScript 2015 has been published by Ralf S. Engelschall, computer scientist and software architect. I was sold to one of best features of it, which is string interpolation.

What is string interpolation ?

Intuitive expression interpolation for single-line and multi-line strings. (Notice: don't be confused, Template Literals were originally named "Template Strings" in the drafts of the ECMAScript 6 language specification). From: http://es6-features.org/#StringInterpolation

I would love to give a javascript example before this feature:

var name     = "Gorkem";
var lastname = "Erol;
console.log("Hello, my name is " + name + " " + lastname + " !");// Hello, my name is Gorkem Erol !

And second example, after this feature:

var name     = "Gorkem";
var lastname = "Erol;
console.log(`Hello, my name is ${name} ${lastname} !`);// Hello, my name…

--

--