What is the view point of the JDK team about string interpolation

Behrang Saeedzadeh behrangsa at gmail.com
Sun Mar 27 06:52:04 UTC 2016


All I am saying is that aesthetics is just as important as semantics.
Otherwise Java might become like Perl. IMHO $"..." is ugly, and
"...\(...)..." is not.

*"Fixed stuff \{expression} etc"* [...] It has the disadvantage that it
silently turns a *constant* expression into a *non-constant* expression
[...].

As they say, in theory there is no difference between theory and practice,
but in practice there is. Why is that a disadvantage? In practice, what are
the problems that they have introduced into Groovy, Ruby, Swift, etc.?

Best regards,
Behrang Saeedzadeh

On 15 March 2016 at 03:13, Neal Gafter <neal at gafter.com> wrote:

> On Sun, Mar 13, 2016 at 7:17 PM, Behrang Saeedzadeh <behrangsa at gmail.com>
> wrote:
>
>> We already have two expression languages (JSP's and JSF's) that finally
>> got integrated into the Unified EL. Even though they are used outside Java
>> classes, I am not sure what would be the benefit of yet another way for
>> String interpolation in the Java sphere. A subset of the Unified EL might
>> be a better option (e.g. leading to more consistency across the whole
>> platform).
>>
>
> String interpolation is not a new expression language - that is, it is not
> a new way of writing a *string* that can be interpreted as an *expression*.
> Those interpolations would be ordinary Java expressions, understood by the
> Java compiler according to all of the existing rules of the Java
> programming language.
>
>


More information about the discuss mailing list