Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: OneWingedShark

If you’re talking about Ada, I’d much rather use C++.


24 posted on 10/14/2009 6:51:53 PM PDT by rbg81 (DRAIN THE SWAMP!!)
[ Post Reply | Private Reply | To 20 | View Replies ]


To: rbg81

Ada does have some interesting features, and I’ll admit that I’m impressed by the number of compile-time checks that the compiler does, but Pascal [and even Java, IIRC] have range-checking on arrays. {And Pascal’s you can turn off w/ a compiler directive.}

{Tangent: Ada, Java, PHP, and Python (IIRC) all have a “foreach” or similar construct which uses the array’s own indecies as bounds wherewhich to iterate over; pascal doesn’t have this ability (though it could in theory) and C/C++ can never have it, as “arrays” in C & C++ are really merely pointers/addresses... which is why it is legal to write array[index] and index[array]: they mean the same thing.}

But the reason I mentioned array access is that it is a big problem-area for a lot of security-flaws. {I have a friend who runs security-analysis on code for the government and virtually 100% of the code that he reviews is C/C++and looking for just that sort of mistake.}

I’m also a fan of strong-typing, of which claims that Pascal is a strongly-typed language actually fall short. But one of my personal “IT DOESN’T MAKE SENSE!” peeves about C/C++ {and C like syntax in general} is the ability to perform an assignment in the conditional portion of an if-statement... that bugs me to no end because the condition-check is logically separate from the assignment and (IMO) shouldn’t be mixes; I realize that it is merely the result of the assignment being a function which returns the value assigned, I also realize that it can be used to “chain” assignments. That doesn’t make it a good design-choice though.

But let me ask, why would you rather code in C++ than Ada? I’m, as you can probably tell, a fan of having the compiler do optimizations. And, to be perfectly fair, a compiler for a language which “knows” about a structure can run non-destructive optimizations on those structures w/o intervention; a good case would be parallel processing where Ada has the task structure vs C++ & its threading/OpenML (IIRC) extensions. [ http://groups.google.com/group/comp.lang.ada/browse_thread/thread/0be98569334bf359 ]


49 posted on 10/14/2009 7:26:15 PM PDT by OneWingedShark (Q: Why am I here? A: To do Justly, to love mercy, and to walk humbly with my God.)
[ Post Reply | Private Reply | To 24 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson