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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,af0c6ea85f3ed92d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.73.229 with SMTP id o5mr2850710pbv.7.1328847091635; Thu, 09 Feb 2012 20:11:31 -0800 (PST) Path: wr5ni7304pbc.0!nntp.google.com!news1.google.com!postnews.google.com!t2g2000yqk.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: Arbitrary Sandbox Date: Thu, 9 Feb 2012 20:11:31 -0800 (PST) Organization: http://groups.google.com Message-ID: <8cc41562-9d61-4e23-b288-7b96837075b0@t2g2000yqk.googlegroups.com> References: <5a2b1b92-f31f-41ef-ba58-b9d6ae7dff11@ub4g2000pbc.googlegroups.com> <8e83f2be-c6e9-4b0b-b53c-d50fe70d01e1@pq6g2000pbc.googlegroups.com> NNTP-Posting-Host: 24.230.151.194 Mime-Version: 1.0 X-Trace: posting.google.com 1328847091 9739 127.0.0.1 (10 Feb 2012 04:11:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Feb 2012 04:11:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t2g2000yqk.googlegroups.com; posting-host=24.230.151.194; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-02-09T20:11:31-08:00 List-Id: On Feb 9, 8:47=A0pm, Tez wrote: > >>> So, how would you sell an executive on or against Ada (or C#) [for this >> particular use]*? > > I definitely want to say Ada. Then say Ada; give him your sale's-pitch! * -- I'm omitting this; because I can. But, seriously, there's several things I'd say to try to sell it, although I'm not by any means an Ada expert. 1 -- Maintainability Ada is extremely maintainable, its syntax lends itself more to "self- documenting" code than anything I've seen from the curly-brace languages. ('Self-documenting' is a myth, BTW; comments still rule in that regard.) I've heard people say that they've plopped 20-year-old Ada code into a compiler from a completely different vendor, had clean-compiles and were up-and-running with no changes (note, this changes when compiler- specific features, like GNAT's 'IMG attribute, are used). This indicates, to me, that the well-defined nature, and the rejection of the non- conforming implementations, give the source-code more stability** precisely because the language is standardized. (**Stability in that the source does not change meaning dependent upon which compiler is being used.) 2 -- Compile- (and run-) Time Error-Checking I've been using PHP for about the past year; and I _REALLY_ miss this. I can't count the number of times that I've had to go back and fix some code that someone broke because they changed the return-type format; yes, this particular problem won't crop up in C# as it has return-types attached to its functions, but consider: the earlier a bug is caught the cheaper it is to fix. And then there's array indexing; given that Anders Hejlsberg (of Turbo Pascal and Delphi) was recruited by Microsoft and given the lead position I would be VERY surprised if the index-checking wasn't addressed in C#, but C# *STILL* forces you to use zero-based indexing, which is a stupid limitation that only gets in one's way. {In order to, say, match a column number from a spreadsheet with it's associated array-index, especially when the spreadsheet's column-numbers are one-based and someone's talking about "column 3" after it's been read-in it becomes easy for the off- by-1 error to creep in.} Subtyping is another feature that is, quite frankly, AMAZING that other languages haven't adopted. Being able to exclude values from a problem- set means that you can write your code in such a way as to cater to the "general case" and rely on the subtype-exclusion to weed-out the problematic values; case-in-point, Null-exclusion if you have a procedure whose inner-processes are checking for Null all the time you can simply re-write it as though you know that the pointers aren't Null and then ensure that the subtype excludes null -- an attempt to assign the bad value will be caught by the compiler, if it's static, or raise the CONSTRAINT_ERROR exception if it is dynamic. E.G Function X( Input : SOME_ACCESS ) Return SOME_TYPE is [...] checks that Input is not null [...] end X; would become Subtype NN_SOME_ACCESS is Not Null SOME_ACCESS; Function X( Input : NN_SOME_ACCESS ) Return SOME_TYPE is [...] just use Input as if it weren't null [...] end X; 3 -- Structuring & Reliability (Packages) This goes hand-in-hand with maintainability; but the ability to have a single well-defined specification and implementation separation is something else that I miss greatly when I'm forced to do PHP; the reason one can't "just program" in PHP is because you have to go to the function itself and determine things like what type/format the parameters are expected to be in, and the return type (or even if there is one), or if any of those change due to a parameter or some magic global variable. Now I don't expect C# to be that bad, but in my experience C & C++ are _HORRID_ when it comes to maintaining an separation of spec and body. Just like the big boon of being able to concern yourself with "just the parameters and the procedure" was a big leap forward in making provable and reliable code in the industry, packages allow you to do the same but in a scalable manner. Furthermore, the specification/implementation divide means that you can sit down and *design* the system rather than the current (far more bug-prone) "just grow the system" attitude that seems more prevalent where I work. (Yes, it's website-design, and yes that attitude is *why* we use PHP... but as someone once said, it doesn't matter if you have a method for multiplying that is a hundred times faster but gives the wrong answer [sometimes], it's not a hundred times faster, it's wrong.) As for the other interesting things in Ada, like concurrency, I'm not an expert nor do I know if they would be applicable to your project. Yes, you can argue that all of my points are moot "with best practices" or "correct software engineering" and that "careful programming" can avoid them; but let me counter with this analogy: a "careful driver" who is "correct in all aspects regarding traffic statutes" and knows his car intimately is the most dangerous driver to be around when he's tired (sleep deprived) and under pressure.