ElegantLoops 1.0.1
dotnet add package ElegantLoops --version 1.0.1
NuGet\Install-Package ElegantLoops -Version 1.0.1
<PackageReference Include="ElegantLoops" Version="1.0.1" />
<PackageVersion Include="ElegantLoops" Version="1.0.1" />
<PackageReference Include="ElegantLoops" />
paket add ElegantLoops --version 1.0.1
#r "nuget: ElegantLoops, 1.0.1"
#addin nuget:?package=ElegantLoops&version=1.0.1
#tool nuget:?package=ElegantLoops&version=1.0.1
ElegantLoop
Sometimes, even the simplest things deserve elegance. And this loop is exactly that! You can turn this 💩:
for (int i = 0; i < count; i++)
{
// Your code inside this overly verbose loop 😡
}
into this 🎂:
foreach (int i in count)
{
// Your code inside a minimalistic, elegant loop ✨
// So beautiful it makes your linter weep with joy 😌
}
No more months of debugging because you wrote ⇐ instead of <! No more pondering “is it i++ or ++i this time?”! Just pure, readable iteration.
Uncle Bob might have said: “Every code with loops like this is clean! And every other is not.” — If you disagree, well... I hope your free e-book came with a refund policy. 😉
Benchmarks?
Yes, we did those too. The ElegantLoop holds its ground against the classic for loop, and even wins in many cases. Check the Benchmark project if you’re into raw numbers and bragging rights.
Tests?
Of course! This loop is bulletproof. We’ve tested zero, negative, and mega-huge counts — and it still behaves like a champ. See the tests folder and judge for yourself.
Why?
Because we could. Because it’s funny. And maybe, just maybe… because writing foreach (int i in count) feels good. 😌
Conclusion
You might think you don't need this. But trust me — once you try it, there’s no going back. And guess what? It’s free! …for now 😈
License
This project is licensed under the MIT License — use it freely, copy it shamelessly, but hey — drop a ⭐ if it made you smile.
Inspiration
This project was inspired by a Nick Chapsas. And the video: Adding a BETTER way to loop in C#. I loved the idea and decided to implement my own version with some personal tweaks.
Feedback and Contributions
Feel free to open an Issue for bugs, questions, or suggestions. Pull Requests are also welcome!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.