Replies: 7 comments 10 replies
-
Hey @Jeehut, I am about to leave for the airport and I haven't had time to fully read your post, but from what I've read so far I can tell it is very thoughtful. Thank you very much for starting this discussion, and I look forward to what others have to say. @stephencelis and I both know there's a lot more we can do to better communicate TCA and we are eager to improve things! |
Beta Was this translation helpful? Give feedback.
-
I think this is an excellent, topic that I have been thinking about as well and would be happy to help out. The iOS version of our enterprise app is entirely built on TCA, and I have a vested interested in more people using and improving the architecture. A few thoughts:
Anyway, interested to see where this discussion goes. |
Beta Was this translation helpful? Give feedback.
-
I just had the idea of helping beginners TCA beginners (and Pros) by providing a set of Xcode templates to create new Features from with instructions how they can be easily adjusted and installed. I don't currently have the time to play around with this (somewhat hidden) Xcode feature to pull it off in detail, but I found this thread which already seemed to lean on the same idea. But for beginners specifically, I believe it would be helpful if there was not only a detailed guide how to set them up, but also a variant that looks as similar to vanilla SwiftUI as possible. For example, this variant could prevent the use of In my personal opinion, |
Beta Was this translation helpful? Give feedback.
-
I 100% support making TCA easier for beginners to use. What I love about TCA is that, like Ruby on Rails, it provides a clear, battle-tested outline for how to develop an app. But it's a struggle to learn. Introduction of Reducer Protocol will help a lot. A lot. Anything else that can be done on the library front to further simplify / reduce boilerplate would be awesome. Possible ideas for how to make it easier for beginners:
Ultimately, TCA can only be made so simple. It will always take quite a bit of effort to fully internalize. I've almost given up on TCA a couple of times. Trying to wrestle a zoo of Generics, Reducers, Environments, and Views into a compiling code is not easy at all. It was much worse when nothing in Reducers autocompleted. But intuitively I know TCA is the future of app development on the iOS platform. For that reason I strongly support making it easier for beginners. Big thanks to the PointFree guys. It's an AMAZING library, and it's getting better. |
Beta Was this translation helpful? Give feedback.
-
I think making TCA more beginner friendly would involve a layer over the top. And then a clear path to go a level down when you need to. Even just a starter project that is set up for hypermodularisation with TCA. Ruby on rails wasn't entirely beginner friendly at the start. It was the codegen stuff that really opened it up to everyone. Perhaps TCA needs a similar approach for common use cases. A really opinionated project setup and set of codegen scripts for common feature use cases would go a long way I think. |
Beta Was this translation helpful? Give feedback.
-
I just wanted to post a quick follow up to this discussion to let y'all know we have taken some small steps towards making the library more beginner friendly, but there's still a lot more to do. First, we released 0.41 today, which includes the We have one more big release we want to get out before we consider the library 1.0, and then at that time we can finally explore some of y'alls other ideas such as a brand new tour series of episodes. Thanks again to everyone for their feedback so far. |
Beta Was this translation helpful? Give feedback.
-
Just to chip in here. I started my current job a year ago. When I joined the app was in dire need of a lot of improvement. I kept mentioning TCA as something I'd like to implement in the app. The reaction was the same every time, we don't need it, it's overly complicated, etc... Right now, a year later, we have started making a move on a huge update to the app. When we started it I started with the beta branch of TCA. When I started to explain how it works to the team and looking at what we had done in a week or so the general reaction from the team was (sarcastically) "This is awesome, why didn't you mention it before?" The new release does help a lot in making the structure more friendly to beginners. I think the biggest help to getting people on board was to show them how much easier things were with it than without it. Especially with the new Dependency stuff. |
Beta Was this translation helpful? Give feedback.
-
When I talk to people about app architecture and they have not had the time or motivation to watch PointFree episodes and lean into testing things out themselves, they often react to me mentioning TCA with something like "yeah, I heard of it, but I prefer to stick to vanilla SwiftUI" or something along the lines of "I'm sure it's cool for larger projects, but it's overkill for me" or sometimes simply "I don't write tests, so why should I use TCA". And that's experienced developers I'm talking about. For people just starting out with iOS or SwiftUI development, I don't see how they could discover and want to learn TCA given how most treat its complexity, instead, they learn MVVM or something else that doesn't really guide them much in their thinking and still leaves most decision as to "where things belong" to them.
In short: TCA is currently viewed as the "gold standard" of app architecture. But it's not viewed as a "go-to standard" yet.
I find this perception a bit sad though. In my opinion, TCA provides a pretty vanilla Swift and SwiftUI approach to app architecture. Yes, it is "opinionated" in mainly one regard: It follows the unidirectional data flow concept where all data is accessible from the root, but scoped to smaller chunks down the line. (I don't consider writing "testable" code to be "opinionated" as I think it's pretty well-known that this is important.) But as I've stated here, I see a lot of potential in exactly this approach to be visualized in a really easy to navigate & explore hierarchical state machine. But more importantly: Apple has designed SwiftUI in a way where unidirectional data flow fits right in. So, in a way, even this "opinionated" decision is pretty "vanilla SwiftUI', filling in the missing "architectural" part lacking in SwiftUI itself.
I also believe that TCA is designed in a way that it's not actually "overkill" for most apps, and even less so with the improvements coming to reducers (currently in beta), which lacked some ergonomy (especially in the pullbacks) and where I could understand the "it's complicated" reaction. But that'll soon be gone and I feel like there's an opportunity here to get everybody onboard who's open to learn something that'll simplify their developer lives.
So, without having some actual plan prepared, I'd like to start the discussion around how we can further make TCA beginner-friendly. I don't know what's lacking in detail, it could be that the library itself isn't the problem, but just the docs needs some improvements. It could be that there's still too much boilerplate needed and a tool simplifying this could help. Or it could also be that there's actually too much stuff in the library itself that is "required" and "enforced" upon us that a more step-by-step adoption path could help.
I don't know, but I feel all the things mentioned need some evaluation at least with the thought of making it more attractive to more developers. Maybe others came across other concerns I didn't mention yet. Please share them.
For me personally, I only started using TCA after I had time to watch the Free Tour videos. But I had seen and starred the library way before that. But the README – while sounding really amazing – also gave me a feeling of "this is complicated". Just look at the very top of it, using advanced terminology like "state management", "composition", "side effects" or "ergonomics".
Beginners – or people who like to write beginner-friendly code – care a lot more about things like "simplicity", "clarity", or "lots of documentation / snippets available". I believe that TCA provides all these, but they are not highlighted as much. So the advanced terminology and too few real-world examples or no step-by-step onboarding or adoption guides were the reason I didn't try TCA out right away. (And I'm not blaming anyone here, of course this needs a lot of work only providable by a larger community.) And this holds true until today: Most of the practical solutions when using TCA I learned by looking at code in the SwifUICaseStudies folder. But I know very few developers who would dive into code examples to learn something new in detail, and it was also a very slow and trial & error approach for me (and still is!).
So for me, a step-by-step practical real-world problems oriented documentation, covering one topic after another, would have been really useful. Something like available for Ruby on Rails, practical advice on different areas that you can learn one at a time. The PointFree video series (even though they are a great learning resource) is more like a "how and why this was built this way and not another" kind of approach, which is great for experienced devs, but not for beginners. And the very well-documented types help with the understanding, but are less practical tips.
The best docs I'm aware of, I just coincidentally discovered while linking the word "well-documented types" in the previous sentence – 4 DocC articles hidden in the "Essentials" section in the documentation, see Getting Started, Getting ready for Swift Concurrency, Performance, and Testing. I couldn't find any links or mentions of these articles in the README though, and this could be an easy first step to improve upon making TCA more beginner-friendly. But it's just a start. I think what's also important is to allow the adoption of TCA in a more gradual manner (which may already be possible!), without having to switch to it all at once – because many devs like to evaluate new tools or patterns before they fully adopt them. A guide (& some library changes) for this, I think, would help a lot. Even if it's just about how to use TCA for just a small portion of an app and stick to "vanilla SwiftUI" everywhere else.
Without having any details, I could also imagine an even more opinionated smaller version of TCA specifically designed for simple cases to onboard newcomers to the general concept of TCA without overwhelming them. (Something like the Microya library I created for the more complex Moya project.) But that's just an idea, maybe it's not even needed & guides + small changes would suffice.
But that's just some input from me to get the discussion started. What are your thoughts on this topic?
Beta Was this translation helpful? Give feedback.
All reactions