L
Leon_Amirreza
Hi
when i used the following attribute for a property:
1- [DefaultValue(string.Empty)]
c# compiler nagged that it expects a constant and forced me to change it to
this
2- [DefaultValue("")]
Any1 knows of a better programming style than line No. 2-?
I thought compliers exist to encourage better programming practice (that is
more readable, more protable, more writtabe, more maintainable code )?
Thank god for the reflection for that DotNet compilers can evaluate some of
expressions to constant values at compile time then why doesnt c# do that?
I can make many c# examples that compiler needs a constant, while it can
evaluate the expression to a constant, but it doesnt!
there are alot of languages for windows and linux (like gnu C++ or any other
variants of C/C++, Embarcadero Delphi - previously Borland Delphi -, ...)
that can not or do not benefit from a platform like DotNet.
As a DotNet Programmer I can benefit from the platform in many ways (while
some drawbacks) but why the compiler itself doesnt benefit from some of
features that already there?
when i used the following attribute for a property:
1- [DefaultValue(string.Empty)]
c# compiler nagged that it expects a constant and forced me to change it to
this
2- [DefaultValue("")]
Any1 knows of a better programming style than line No. 2-?
I thought compliers exist to encourage better programming practice (that is
more readable, more protable, more writtabe, more maintainable code )?
Thank god for the reflection for that DotNet compilers can evaluate some of
expressions to constant values at compile time then why doesnt c# do that?
I can make many c# examples that compiler needs a constant, while it can
evaluate the expression to a constant, but it doesnt!
there are alot of languages for windows and linux (like gnu C++ or any other
variants of C/C++, Embarcadero Delphi - previously Borland Delphi -, ...)
that can not or do not benefit from a platform like DotNet.
As a DotNet Programmer I can benefit from the platform in many ways (while
some drawbacks) but why the compiler itself doesnt benefit from some of
features that already there?