←back to thread

620 points tambourine_man | 1 comments | | HN request time: 0.208s | source
Show context
nu11ptr ◴[] No.43750542[source]
Personally, this feels like a feature that is too focused on one problem to be a general feature. Python is getting huge. When people ask me if Python is easy and simple to learn I have to say "the basics, yes, but to to learn the whole language... not so much".

I feel like in this sense Go really is interesting by rejecting almost every single feature. Honestly not sure generics were worth it as they add a lot of complexity, and while they are nice, I don't need them very much. The general idea to keep the language at its original focus is the right idea IMO. C++ would be the most extreme case where the language itself barely resembles what it started out as.

replies(4): >>43750633 #>>43750807 #>>43751386 #>>43754916 #
oliwarner ◴[] No.43750807[source]
Python has always been a batteries-included language, so having a go at templated string interpolation —a feature other languages have had for decades— seems like a strange gripe.

It's far more essential than little utilities like textwrap or goliath packages like Python's bundled tkinter implementation.

replies(2): >>43751281 #>>43754791 #
nu11ptr ◴[] No.43751281[source]
What other languages have this feature? I'm not aware of any
replies(5): >>43751420 #>>43751592 #>>43751869 #>>43752805 #>>43753962 #
thatnerdyguy ◴[] No.43751869[source]
C# has InterpolatedStringHandler which isn't quite the same thing, but (in my understanding), trying to address the same core issues.
replies(2): >>43753144 #>>43753879 #
1. neonsunset ◴[] No.43753879[source]
For the case like here it’s closer to FormattableString that’s what EF Core’s composable FromSql method works on top of. Both address custom interpolation but from different angles / for different scenarios.