From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,699cc914522aa7c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!edtnps82.POSTED!023a3d7c!not-for-mail Sender: blaak@METROID Newsgroups: comp.lang.ada Subject: Re: C# versus Ada (was: Structured exception information) References: <1168885771.30643.20.camel@localhost> <1168891576.30643.39.camel@localhost> <5NKdnTv2UZfVZTbYnZ2dnUVZ_vipnZ2d@megapath.net> <1168975096.2218.125.camel@localhost> From: Ray Blaak Organization: The Transcend Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 17 Jan 2007 18:14:53 GMT NNTP-Posting-Host: 208.66.252.228 X-Trace: edtnps82 1169057693 208.66.252.228 (Wed, 17 Jan 2007 11:14:53 MST) NNTP-Posting-Date: Wed, 17 Jan 2007 11:14:53 MST Xref: g2news2.google.com comp.lang.ada:8227 Date: 2007-01-17T18:14:53+00:00 List-Id: Georg Bauhaus writes: > On Tue, 2007-01-16 at 18:36 +0000, Ray Blaak wrote: > > C# is now my new favourite language, and I find it is more or less as typesafe > > as it needs to be, with "good enough" features for programming in the large. > > Are you using C#/.NET threads? What do you think about the "ease" of > having Windows threads communicate, and share data, compared to > Ada's tasks and protected objects? Well, it's a trade off. In general I prefer the C# model, since is is easier to set up threads and have them freely talk to each other. One probably does have to worry about deadlocks more, but I am prepared for that, and tend to reason about these interactions very carefully, lock things into critical sections, etc. It seems easier to have shared objects to use at will. I have not done as much Ada tasking, but from what I recall, setting up the rendevous sections seems to require a lot more planning. Protected objects I am less familiar with. I suppose I prefer the greater freedom in C# (and in Java for that matter). Also, the mental model of a thread being just another kind of good old Object fits my intuition better. With Ada one requires 2 or 3 distinct language mechanisms (tasks, protected objects, tagged types) to all work together. I won't dispute Ada's model as being more careful and correct, with finer controls useful for systems and embedded programming, but it seems more complex to use properly in the common cases. > > > And it has garbage collection! > > Garbage collection is a property of all language implementations > targeting .NET or the JVM, so it's rather a property of the > implementation not the language. You could use A#, too, > or AppletMagic, etc. :-) Good point. Still, in Java and C#, it's in the language itself. All implementations have it. It should be that way in Ada too, so that "compiled" executables can have it as well. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.