[quoted text, click to view] > > System.Diagnostics.Debug.Assert();
> >
> > Hello??? A language should encourage programmers to heavily use the
> > assert-feature, since it improves safety, stability, readability and
> > maintainability of software. Most language designers recognized this,
see
> > C/C++ and Java which supports an assert keyword.
> >
> > My question now is, will C# support in future a single keyword for
> > System.Diagnostics.Debug.Assert(), just like lock is a keyword for
> > Monitor.Enter()?
> >
> > Putting "using System.Diagnostics.Debug;" in every single source file,
is
> > not acceptable for me.
> > assert is/should be used in every application, no matter which kind of
> > application it is. Name me just one method/class where this is also the
> > case.
> >
> > What do you think?
> >
>
> I agree that this probably would have been a good thing to have in
> version 1.0, but I doubt they'd add it as a keyword now.
>
> It would break some existing code,
It is so stupid. Didn't they think of the possibility that more keywords may
be added in later versions of C#???
If I would design a language I would reserve as much keywords in advance in
the first place so I have later no problems with adding new keywords.
I'd reserved things like
(yield,where,assert,mutable,friend,delete,with,final,native) in advance so
that later no problems arise with compatibility. It seems that almost all
programming languages I know of suffer from that problem, exception
JavaScript: It has a huge list of reserved words that aren't actually used.
[quoted text, click to view] > and the current usage of
> Debug.Assert() (in conjunction with a "using System.Diagnostics;")
> already does the job pretty much as well an "assert" keyword would so
> there's little added benefit.
>
> Note that the lock statement is more than just Monitor.Enter()... It
> encapsulates Monitor.Enter() followed by a try/finally block that
> ensures that Monitor.Exit() is called.
int is just System.Int32 but they made it a keyword. assert *should* just li
ke int used all over the whole program to ensure consistence of the
software.
also, the assert should be quickly be recognized as an assert so a keyword
is probably the right thing.
--
cody
Freeware Tools, Games and Humour
http://www.deutronium.de.vu ||
http://www.deutronium.tk