??? 06/15/07 05:04 Read: times |
#140815 - Well, if it were up to me ... Responding to: ???'s previous message |
Russ Cooper said:
Hi Richard,
Thanks for your lengthy and thoughtful response. I personally don't agree with many of your opinions, but since that's all they are, that's fine. You wouldn't agree with some of mine, and that's also okay. I am left with questions on one point, though. A couple of things you said here seem completely at odds with your recent and repeated statements such as this one, "HLL's belong in schools, perhaps, but not in serious MCU work," where you seem to be advocating assembly language as the only reasonable choice for programming a microcontroller. Well, it's probably a good thing nobody listenst to me ... <sigh> ... but I'd not allow the use of anything but assembler for ANYTHING if it were up to me. I'd start, of course, by eliminating the ultra, Ultra, ULTRA slow tools like JAVA, and go from there. The unimaginable (a decade ago) increase in size of programs routinely turned out using HLL's and the unbelieveable reduction in performance relative to the hardware's capabilities, can be laid at the doorstep of the HLL promoters and users. The first was this:
Richard said:
I've written a little 'C' code, maybe ~9-10K lines, but found that, since it easily compiles code that has no chance of operating at all, because of its weak type-checking (or none) and all the other things that it doesn't do, that it's much easier and probably as sensible, to use other tools that help you a little more. Certainly assembly language offers far less type checking and far less "help" than even C does. So I wonder, what are these "other tools" that you're talking about that apparently do? The other was this: Richard said:
The inherent flexibility of a language can be its undoing. In my book, assembly language is ultimately flexible; it lets you do absolutely anything, after all. So if, as you've opined, the flexibility of C somehow "discourages rigor and discipline", how is it that the increased flexibility of assembly language doesn't discourage rigor and discipline even more? Thanks, -- Russ OK ... let's take a look at the first remark first. The tool that needs to be used the most is the brain. HLL's offer, seldom actually do, but offer, to lighten the burden on the programmer's brain. The result is that he doesn't have to be aware that his variable types are mismatched, just as one example. ASM demands that the programmer keep track of these things. 'C' demands that one keep track of these things, too, but, being an HLL, not demanding the programmer to concern himself/herself with every detail, though it should, and, in reality does, unlike PASCAL, which slaps your wrist every time you stumble. I'm opposed to the generalized lack of discipline that high-level languages promote through their, "let the compiler deal with that," attitude, as promoted where they're taught. WHen people programmed computers in Fortran, Algol, and PL/1, they didn't have such discipline issues. They managed the issues through rigor and discipline. Here, we have specifications against which we write code. That forces one to focus. It makes reviewing much shorter, simpler, and more effective. The last time one of my guys had to go back and fix a piece of delivered code, BTW, was in 1984. The problem, as I see it, with 'C', is that it provides the programmer with all the flexibility he can use, ... almost .., yet it doesn't impose the restrictions that he needs. Now, what I meant by the reference to flexibility in 'C' was in its syntax. That's where the maintainability problems arise. There are so many ways of expressing a particular sequence, that it's not often possible to discern what the programmer had in mind, or even how it relates to the task at hand. That's why the need for such voluminous documentation, declaring the programmers intent and rationale behind using a given syntax. Because of this "flexibility," it's easy to miss something another programmer has written or to misinterpret it completely without really being "wrong." How do I know these things? Well, it's from years of reading over other people's code listings, and listening to them argue about what they themselves wrote a few years earlier. As I've said, there are too many ways to "skin a cat" in 'C." It discourages rigor and discipline. With proper discipline, a guy should be able to remove his own appendix, with the aid of some well-situated mirrors, and do a neat job of sewing himself up. I couldn't do that, but I'm not perfect either. RE |