© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
11 replies
swilli

❔ Repeating parameters vs variadic functions

Does anybody know why the
params
params
keyword is not used more commonly? This example if from the
ImmutableArray<>
ImmutableArray<>
class. As you can see there's methods for creating an array from 1-4 args, and then it goes to an array arg, but the array method is then using the
params
params
keyword? Why not just use the
params
params
keyword on the first method so that it could take N args without needing multiple methods with differing amounts of parameters? I feel like I'm missing something here.
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ VS not recognizing functions
C#CC# / help
3y ago
✅ Simplifying Method Parameters: C# 13 vs C# 12
C#CC# / help
15mo ago
Creating a method that takes a generic method and its variadic parameters as arguments and call it i
C#CC# / help
11mo ago
✅ positional parameters
C#CC# / help
2y ago