Swift developers are debating the merits of Pledge, a new reactive programming framework, with many questioning its advantages over established solutions like Apple's Combine and SwiftUI's built-in state management. The framework, which aims to simplify state management and event propagation in Swift applications, has sparked discussion about the evolving landscape of reactive programming in the Apple ecosystem.
Community Reception Shows Mixed Reactions
The developer community has expressed skepticism about Pledge's value proposition compared to existing solutions. While Pledge offers features like thread-safe implementation, priority-based notifications, and rate limiting, several developers questioned whether these capabilities justify adopting a new framework when robust alternatives already exist.
This seems like the subject part of RxSwift/Combine without any of the useful parts. For example, the networking example requires an explicit property whereas the code I would use for something like this would be to return an Observable directly.
This sentiment reflects a broader concern that Pledge might be reinventing the wheel without adding substantial benefits over established frameworks. Some developers pointed out that Apple itself appears to be moving away from traditional functional reactive programming (FRP) patterns with its newer macro-based Observable framework, suggesting that simpler approaches may be gaining favor.
Platform Compatibility Could Be a Differentiator
One potential advantage highlighted in the discussion is Pledge's compatibility with environments where Apple's Combine framework isn't available. A commenter noted that Pledge could be valuable for Swift on Linux, where Combine isn't officially supported. However, others quickly pointed to existing alternatives like OpenCombine and CombineX that already address this gap.
The framework's creator clarified that Pledge primarily targets UIKit development, where reactive state management isn't built-in, unlike SwiftUI's integrated approach. This positioning suggests Pledge aims to serve developers working with older UI frameworks or those who cannot transition to SwiftUI for various reasons.
Key Features of Pledge
- Thread-safe implementation
- Priority-based notifications
- Customizable delivery queues
- Batch updates
- Rate limiting (throttling and debouncing)
- Functional operators (map, filter, etc.)
- Global state management
Alternative Reactive Frameworks Mentioned
- Apple's Combine
- RxSwift
- OpenCombine
- CombineX
- SwiftUI's @Published property wrapper
- Apple's new macro-based Observable framework
Concerns About Complexity in Reactive Programming
Several comments touched on broader concerns about reactive programming approaches in Swift. One developer mentioned having PTSD from overly complex codebases built with functional reactive programming, specifically referencing the Kickstarter MVVM approach. This highlights an ongoing tension in the Swift community between powerful but potentially complex reactive patterns and simpler, more direct approaches.
The discussion reflects a maturing ecosystem where developers are becoming more discerning about adding new dependencies, especially when they overlap significantly with existing solutions. As Swift continues to evolve, with Apple introducing new patterns like the macro-based Observable framework, the community appears to be seeking balance between reactivity and simplicity.
Interestingly, there was some confusion in the discussion, with one commenter apparently mistaking Pledge for an authentication framework rather than a reactive programming solution, highlighting the challenges of clearly communicating a new framework's purpose in a crowded ecosystem.
Reference: Pledge