Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mhosain
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
mhosain
3y ago
> Also, I think you may have misunderstood what this feature... No, I am aware of the differences between StringBuilder and string templating. One of the most common usage is concatenation (e.g. toString() methods). Sometimes it's c
2.
▲
by
mhosain
3y ago
Yeah, but than what was the point? We could've continue to use existing methods. The goal was getting something clean and friendly. Look at Python for example. Any similar solution would have made it both non-breaking (codes won't
3.
▲
by
mhosain
3y ago
> STR is not a prefix but simply the name of the variable referencing the receiver That is THE problem. You can use StringBuilder more easily than this ugly thing. When you write code in IDE (I hope so), writing `.append()` is actually e
4.
▲
by
mhosain
3y ago
No, absolutely not! This will be the most hated Java feature to me.
5.
▲
by
mhosain
3y ago
Sadly, true. Why is the template processor named `STR`, why not `f"String"`, like Python? On top of the ugly `STR.` prefix, this dreaded `\` character infuriates me more. Kotlin and Groovy have the nicest implementation by far bec