comp.lang.ada
 help / color / mirror / Atom feed
From: Stefan.Lucks@uni-weimar.de
Subject: Top 10 Worst C# Features
Date: Wed, 2 Sep 2015 12:59:40 +0200
Date: 2015-09-02T12:59:40+02:00	[thread overview]
Message-ID: <alpine.DEB.2.20.1509021228510.5314@debian> (raw)

[-- Attachment #1: Type: text/plain, Size: 2274 bytes --]

Eric Lippert from the C# design team has an interesting article on the ten 
worst features of C#. At least eight of these have been solved in Ada. Did 
Jean I. time-travel into the future and learned from the C# mistakes, when 
designing Ada?

Lean back and enjoy!

http://www.informit.com/articles/article.aspx?p=2425867


BTW, the two issues that are, to some degree, applicable to Ada are

#9 Comparison operators for your own arithmetic (e.g., for your own 
rational numbers).

In Ada, the "/="-operator is automatically the negation of "=". Which is 
great. But given "=", "<", and ">", why does one have to implement "<=" 
and ">=", as well. (Five Operators, where three would suffice.) (*)

The situation with C# is even worse. You need to define/override at least 
nine methods.

#2 Finaliz(ers) are fragile

In Ada, the finalize procedure for an object can be called more than once, 
Finalize should rather not raise an exception, ... apparently, C# 
finalzisers suffer from similar problems: "any time a finalizer runs, you 
could argue that the program either has a bug or is in a dangerous state, 
such as being shut down unexpectedly via a thread abort".

The remaining eight C# issues have been solved in Ada.



-------

(*) One might argue that two operators, e.g., "=" and "<" would suffice, 
rather than three. If neither A=B nor A<B, then A>B is obvious, isn't it?

But not all sorts of "arithmetic", where you want to take comparisons, 
have the property that either of A=B, A>B, A<B is true:

    -- Arithmetic with "special values", such as "Not a Number" for
       floating point operations. If A is NaN, then neither A=B nor A>B
       nor A<B would hold, even if B is also NaN.

    -- Another example would be sets: A<B would indicate "A is a proper
       subset of B. If, e.g., A={1} and B={2,3}, then neither A=B nor
       A<B nor A>B.

On the other hand, A <= B should never mean anything different from

   (A < B) or (A = B)!

Similarly for A >= B.

--------  I  love  the  taste  of  Cryptanalysis  in  the morning!  --------
www.uni-weimar.de/de/medien/professuren/mediensicherheit/people/stefan-lucks
----Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany----

             reply	other threads:[~2015-09-02 10:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 10:59 Stefan.Lucks [this message]
2015-09-02 17:37 ` Top 10 Worst C# Features Álex R. Mosteo
2015-09-02 19:39 ` Randy Brukardt
2015-09-03  8:14   ` Georg Bauhaus
2015-09-03  9:26     ` Dmitry A. Kazakov
2015-09-03 11:39       ` G.B.
2015-09-03 12:00         ` G.B.
2015-09-03 13:59           ` Dmitry A. Kazakov
2015-09-03 19:12           ` Randy Brukardt
2015-09-04  7:33             ` Georg Bauhaus
2015-09-04 21:34               ` Randy Brukardt
2015-09-05  6:31                 ` Dmitry A. Kazakov
2015-09-05  6:44                 ` Georg Bauhaus
2015-09-05  7:07                   ` Dmitry A. Kazakov
2015-09-05  6:45                 ` Niklas Holsti
2015-09-05  7:21                   ` Dmitry A. Kazakov
2015-09-05 12:07                   ` Peter Chapin
2015-09-06 10:45                   ` Georg Bauhaus
2015-10-13 19:57                   ` Eryndlia Mavourneen
2015-09-05  7:16                 ` Shark8
2015-09-03 13:47         ` Dmitry A. Kazakov
2015-09-03  8:51 ` gautier_niouzes
2015-10-01 14:03 ` Paul Colin de Gloucester
2015-10-14  8:00   ` Maciej Sobczak
2015-10-14 14:26     ` Ben Bacarisse
2015-10-14 16:50       ` Paul Rubin
2015-10-14 18:17         ` Stefan.Lucks
2015-10-14 19:54           ` Ben Bacarisse
2015-10-15 12:24       ` Maciej Sobczak
2015-10-15 13:59         ` Ben Bacarisse
2015-11-06 14:50     ` Nicholas Collin Paul de Gloucester
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox