S
Snaggy
1. Why arent't default parameters accepted? Why do I have to use
polymorphism everywhere? This makes my code redundant. Example:
public string showStuff (string whatToShow, int limit = 0){...}
instead of:
public string showStuff(string whatToShow){...}
public string showStuff(string whatToShow, int limit){...}
how do you approach the matter? I'm calling the non overloaded
function in the overloaded one ... isn't there a simpler way?
2. Can I create a function with an indefinite number of parameters?
Example:
public myFunction(string param1, int param2, ){...}
myFunction("hey", 3, "additional stuff")
I guess not..
lots of other questions but right now I gotta go... hope I'll get to
know C# since right now it's annoying how difficult it is for me to
do the same things I did in PHP or Ruby with no effort..
bye!
polymorphism everywhere? This makes my code redundant. Example:
public string showStuff (string whatToShow, int limit = 0){...}
instead of:
public string showStuff(string whatToShow){...}
public string showStuff(string whatToShow, int limit){...}
how do you approach the matter? I'm calling the non overloaded
function in the overloaded one ... isn't there a simpler way?
2. Can I create a function with an indefinite number of parameters?
Example:
public myFunction(string param1, int param2, ){...}
myFunction("hey", 3, "additional stuff")
I guess not..
lots of other questions but right now I gotta go... hope I'll get to
know C# since right now it's annoying how difficult it is for me to
do the same things I did in PHP or Ruby with no effort..
bye!