There's a part of me that really likes the simplicity of @builder
. It's short, it's clean, and the type it is used on is a kind of builder.
What made me think it needs further qualification is that this there are already many, many things in Swift code that use the builder design pattern that do not use this feature.
A quick search on GitHub for Swift source files with the term 'builder' but excluding the term '_functionBuilder' shows over 54,000 source files using the term, with types like PathBuilder, AttributedStringBuilder, AdvertisementsBuilder, MerchantRequestBuilder.
The name and concept of 'builder' is already in widespread use in Swift code beyond the usage of this feature, and I would imagine builders that don't use this feature will continue to be created by Swift developers, since it is such a common design pattern.
For me an attribute of plain @builder
strongly implies this is the way to make a builder in Swift, as opposed this being one way of defining a builder that works in a particular way supported by this feature.
@Jumhyn also had made the point that Googling 'swift builder' currently brings up any information of anyone using the builder pattern in Swift, using this feature or not.
The two earlier posts are at: