Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Kaji22626yI don’t work with C#, but that’s looking worryingly similar the the mess of closures that are virtually mandatory in JavaScript programs...
-
I actually love this feature. It makes accessors useless and your code much more readable. I never had a performance problem (although I don't use this feature on C#, but Vala). Now if you're trying to run this on a MIPS processor, good luck with that. After all, you're not using C# for performance, but for easier coding. Use C/C++ if you want performance
-
They are called properties and the first rule of properties is to not hide shit like that inside of them. It's seriously one of the best features.
-
@aggelalex Unfortunate a game engine such as unity3D uses C#. And who wants performance in games... You are right C/C++ would be better suited.
I hate the feature of c# that a member variable can be used as an function!
Let me get this variable. why does my cpu spike?
Because it calls 10 other functions to fill this float when needed.
float progress{
get { return DoWorkInDifferentFunctions(); }
}
Use this instead:
float CalculateProgress(){
return DoWorkInDifferentFunctions();
}
because people will use this like:
if(progress > 10.0f && progress < 25.0f){
DoStuff(progress);
}
Instead of:
float CurrentProgress = CalculateProgress();
if(CurrentProgress > 10.0f && CurrentProgress < 25%){
DoStuff(CurrentProgress );
}
@#$%&*$#^&*!!
rant