Comments (9)
Is this a question or a suggestion?
If this is a question. This is because it is easier for me to have a lot of code on my screen for analysis and thinking of it at once, without scrolling or changing pages.
If this is a suggestion. What is it exactly?
P.S. Wow, the first issue! And it is "The complexity per line is very high" :)
from invoke-build.
I was wondering if there was a functional reason for the code density. Hence a question.
In terms of a suggestion I suggest it would be easier to reason about the code if it was less dense and where there is complexity break it down into functions that fit on a screen rather than pack it all in to one. It would certainly be easier for contributors or users trying to understand the code.
Debug tools tend to be line based, with this amount of cyclomatic complexity per line it's almost impossible to step though.
We were looking to use Invoke-Build for our internal builds and deployment. But our developers had concerns about the readability.
We like what it does, but this was an issue for us. We thought we'd feed it back as we'd be using it if it wasn't for this.
from invoke-build.
The tool is, in my opinion:
- somewhat feature complete (so I do not expect much contributions)
- well documented (help and wiki) (so I do not see much reasons to read the code)
- somewhat bugs free (so I do not expect much debugging), if it is not, submit a bug
Nevertheless, what a user wants is very important. I'll reduce density of the code in the version next. As an example, is Build.ps1 (yet another script from the package) code density good enough?
from invoke-build.
Build.ps1 - Yes much better in terms of readability (maybe a tiny bit too far in the other direction?). I can see your point in terms of fitting on a screen although surely breaking up the code further into functions would help with this?
We have to think about long term maintainability even in the cases where the original author may have moved on. Hence we have to accept that we would in those cases be maintainers on code for projects that has 5-10 year life spans. This is why we care about this. It's come down to Invoke-Build vs other tools. We have to think about what we'd have to do if the maintainer had moved on and the code broke with PowerShell 5 for example.
from invoke-build.
Good points. I did not think of this at such an angle. I am going to use and support this tool for long time (and I use it a lot) but yes, who knows... All right then, wait for the next version.
from invoke-build.
It's done in v2.4.7. This is my "normal" script style, i.e. "not condensed". I would not like to change it, now it's a matter of personal preferences, not readability or easier debugging (I agree that "normal" style is better for this).
from invoke-build.
That's much easier for my poor little head to understand :)
Would I be correct in thinking you are using * prefixes for function names to mean internal private functions?
"-" prefixes for function local private variables?
Thank you very much for doing this!
from invoke-build.
Yes, *
is for (pseudo) internal functions, -
is for (pseudo) internal variables. Making variables just private is not always enough, user code is invoked sometimes dot-sourced, so that private variables are in the same scope and still may conflict with user's. Use of weird names reduces chances of conflicts. Also, there is one public internal variable ${*}
, it is public for internal needs, sort of $this
for the build engine "methods". Most of these details are mentioned by wiki.
I am closing the issue. Thank you for using Invoke-Build and for the report.
from invoke-build.
A little bit late perhaps. Anyway, as far as you evaluated several tools, you may see better than I how Invoke-Build may be improved. Please, do not hesitate to share your thoughts.
from invoke-build.
Related Issues (20)
- Amend output on task errors.
- Reusing or sharing tasks HOT 5
- ib.cmd ? ignores a specified file
- vscode outline view: no symbols found in document HOT 2
- Different module and package versions HOT 2
- Parallel execution based on dependency tree HOT 2
- invoke-build discovery fails in powershell container HOT 3
- Please consider adding -Computername and -Session parameter to Task HOT 8
- GitHub action output is not colored
- Color and formatting text in Azure DevOps Pipelines HOT 8
- Use-BuildEnv should make parameters mandatory
- Invoke-BuildExec spitting out service principal secret as current directory HOT 6
- Exec doesn't work well with forward slash arguments HOT 7
- Use `[System.Management.Automation.Cmdlet]::CommonParameters` to get the names of all common parameters HOT 3
- Task condition does not work HOT 8
- Build-Parallel writes only to Output stream HOT 7
- property 'File' cannot be found on this object HOT 17
- Do not wrap internal errors in Resolve-MSBuild
- Fix cryptic errors on unknown parameters
- Invoke-BuildExec should pass the original stderr error to the thrown terminating error HOT 38
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-build.