Replies: 10 comments
-
This received quite some approval. I think it is a general design decision that should be made, also for new code. @patriksvensson, @phillipsj, I remember you guys had something to add, so I'd like to kindly bump this issue. |
Beta Was this translation helpful? Give feedback.
-
I can't officially speak for the team, but my recommendation, and the one by @patriksvensson, is to create an addin with the additional functionality. This will give everyone access to it and will also serve as a proof of concept. It would also help clarify it to others how it works |
Beta Was this translation helpful? Give feedback.
-
@phillipsj actually, this is no additional functionality as you said. The methods are already there. Both, with inconsistent naming and surprising behavior. I don't think it's a good idea to put this into an add-in. The builder pattern is a well-known and straightforward pattern. Nothing fancy about it. Just a fluent way of modifying properties. However, splitting only guarantees a harder time finding that functionality. |
Beta Was this translation helpful? Give feedback.
-
@matkoch Yes, there are some inconsistencies, but that is something we have to live with. We should however not introduce more inconsistencies in the code base without thinking it through how we want to APIs to be used. That's why it's better to battle test API improvements as addins until we know that is the way we want to go. (ping @phillipsj) |
Beta Was this translation helpful? Give feedback.
-
@matkoch I am participating in something very similar with the MSBuild 15 (Visual Studio 2017) integration. It is a very conservative approach, but the Cake API has been very stable, IME, and that is why they are taking this approach. I know for a fact that I would more than likely use your addin in some of my builds. |
Beta Was this translation helpful? Give feedback.
-
Sorry but I don't understand 🤔 So far your response has been do it as an addin. But this doesn't solve anything. First, it doesn't tackle the status quo. You've mentioned a stable API. At the same time you should ask yourself if you want to carry this burden with you. There will always be people asking:
or more annoyingly
Breaking an API is per se nothing bad. You can always help fixing the problem early upfront by issuing warnings (ObsoleteAttribute). Plus - Second and more importantly, it doesn't encourage any guidelines for the future. Given the fact that addins can be created any time by any developer, we will always end up with inconsistencies. Again and again. And because there is no consistency, you'll either never integrate any of them, or introduce breaking changes for those, who have been using the addins.
Delegating to 3rd parties, doesn't mean to think it through. After all, I've tried very hard to make this issue the place of thinking it through 😄 |
Beta Was this translation helpful? Give feedback.
-
@matkoch I think we use |
Beta Was this translation helpful? Give feedback.
-
@patriksvensson can you give an example? You mean multiple arguments? What about the return a new instance stuff? Does it make sense for you? |
Beta Was this translation helpful? Give feedback.
-
@matkoch in general reasoning behind starting as an addin/module is that we can test & bake the API before we merge it into the main project. Addins can also be reved more quickly and in a safe way without risking bloating or creating unnecessary breaking changes in the core, |
Beta Was this translation helpful? Give feedback.
-
@matkoch Example: var settings = new MSBuildSettings()
.UseToolVersion(..)
.WithTarget("Clean")
.WithTarget("Build"); Not sure I agree with the return a new instance stuff. Will need to think about it some more and talk with the rest of the @cake-build/team about it since it would require this change for all tools, and it's too big of a change. Changes to this approach could be implemented as addins and make it opt-in for now. |
Beta Was this translation helpful? Give feedback.
-
Throughout the code base there are many methods looking like builder pattern methods. I have three concerns with that:
MSBuildSetting
has 3 different namings already (Set
,With
, andUse
). I suggest to agree on a common naming, and change the existing methods (with a new major version; and maybe issue warnings upfront?!).I hope this outlines the benefit good enough. It also applies to
MSBuildSettings
, for instance if you want to separate Compile from CodeAnalysis for reasons of parallelism. Please note that the builder pattern doesn't necessarily require immutability.Beta Was this translation helpful? Give feedback.
All reactions