xsharp.eu • what is the preferred way - functions/static methods or extension methods - Page 4
Page 4 of 4

what is the preferred way - functions/static methods or extension methods

Posted: Fri Sep 14, 2018 6:34 am
by wriedmann
Hi Jamal,

thank you - so we are at 5.5 : 3.25 now.

Regarding your comment about dot or colon: in the Core dialect you can use the dot instead of the colon. But at least XIDE does not support that in thew editor, I don't know about Visual Studio.

Personally I prefer the colon because it makes it clearer where a method comes from - it is easier to read.
It seems to be a similar question as "implements" and "inherit" - X# makes a difference and the code easier to read, whereas C# is shorter, but IMHO harder to read.

Wolfgang

what is the preferred way - functions/static methods or extension methods

Posted: Sat Oct 13, 2018 12:06 pm
by Horst
Hi
i like functions, i dont like when a variable has addional features.
a varibale is a variable and finish. keep it simple.

so this -> cString := cMotherString.Substr (1,5) i dont like.

and btw i like the russian doll modell ;-) because its like mathematik first clean up the inner clips.

also in VO, all the methods of a class will be compiled and blows up the executable, even you need only one method of the class in the whole program.

Horst

what is the preferred way - functions/static methods or extension methods

Posted: Sat Oct 13, 2018 4:26 pm
by wriedmann
Hi Horst,
a varibale is a variable and finish. keep it simple.
a variable can be an object - in fact in .NET everything is an object, even a string or an integer. And an object can have methods.

Therefore I like extension methods, as they allow to use the same method name on different object or variable types.

Wolfgang

what is the preferred way - functions/static methods or extension methods

Posted: Sun Oct 14, 2018 4:34 pm
by Fab64
also for me extension method

Fabrizio