As stated in the previous pitch, I am in favor of this pitch and SE-0388. I think we should also keep exploring alternate ways of expressing and teaching generics to make it easier to properly teach and understand these concepts.
I believe Swift will become the language that introduces the majority of new programmers to generic programming in a few years. The argument that programmers coming to Swift are already familiar with C#/Java/C++'s take on generics will not hold true in a few years.
Although Swift has a C-like syntax to make it easier to learn, it should not be confined to it. Swift has already drifted from its initial similarity to C-like languages (It dropped C-style for loops, ++ -- operators, added defer
, guard
, try
, etc.). Nowadays, if you look at idiomatic and well-written Swift code, it clearly looks distinct, and in my opinion, much nicer than other C-like languages. It has also deeply affected other C-like languages and they have besome more like Swift. It is good for Swift to lead the way, and I believe these changes are steps in that direction.
I see these changes as more than optional syntactic sugar: I see them as the preferred way to write swift code once they become accepted. The same way T?
is a necessary sugar for Optional<T>
. As such, I believe a deep revision of the Swift Programming Language book and other tutorials are necessary to bring these syntacic changes into the mainstream of the teaching materials for the language.
However, we should move cautionsly and carefully. We no longer have the luxury of breaking chages that early Swift had. In this regard, I have a question:
Is it possible to cherry-pick these new syntacic changes into an otherwise stable branch and release the corresponding toolchains for people to try?