On 14-Aug-2000, Benjamin Leon Russell <[EMAIL PROTECTED]> wrote:
> Tyson Dowd <[EMAIL PROTECTED]> wrote:
> > I don't believe you can teach programmers anything by
> > trying to take
> > tools away from them.
> > 
> > I believe you can only teach programmers by showing them
> > a better tool. 
> 
> Aha, but *which* programmers?  The C/C++ programmers who will bother
> learning how to write safe code, or those who won't?

Well, no sane C# course or book will teach the unsafe features of the
language before the safe ones.  So I think the vast majority of C/C++
programmers who learn C# will already know how to write safe C# code
before they learn how to write unsafe C# code.

> The problem is that many programmers will not focus on the safe features
> if the unsafe ones remain.
...
> For example, if the C/C++ programmers are used to explicit memory
> management using malloc() and free(), then they are likely to keep writing
> all their methods using this old style, even when the running time is
> not crucial.  This could potentially introduce more memory-related bugs
> than necessary.

I'm not an expert on C#, so I could be wrong about this, but as I
understand it, C# does not have malloc() and free(), not even in the
unsafe subset.

Unsafe C# is not the same as C or C++.  Furthermore, "unsafe" code
will have a stigma attached to it, just like "goto" does today (or
perhaps more so).  So I think you overestimate the danger of C/C++
programmers continuing to write much of their code using unsafe
features if they switch to C#.

> Suppose the manager starts the project by requiring that all the
> programmers write all non-time-critical portions of their code in pure C#.

Why wouldn't the manager require that they write all non-time-critical
portions of their code in safe C# (i.e. C# without the "unsafe" keyword)?

> > On 14-Aug-2000, Benjamin Leon Russell <[EMAIL PROTECTED]> wrote:
> > > Your not-quite-spoken assumption that it should be possible to write
> > > everything in one language is just something I fundamentally disagree
> > > with.  The requirements of low-level kernel code are quite
> > > different from those of most user-level applications, and
> > > any single language that tries to address
> > > both sets of requirements will do so poorly.
> > 
> > Ah, a testable hypothesis!
> > If you are right, then you should be able to criticize some other
> > features of the language that have suffered as a result of unsafe
> > code in C#.
> 
> Ah, a testable hypothesis!  If you are right, then you should be able to
> provide an example of a language that meets the requirements of writing
> both low-level kernel code and most user applications equally well for
> the bulk of the programmers working with the language!

Well, how about Modula II and Ada?

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.

Reply via email to