Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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




List of 87 messages in thread
TopicAuthorDate
Sunday Quiz - Bit Flipper in C            01/01/70 00:00      
   Here's My 41 Bytes            01/01/70 00:00      
      Very nice, but call it 43 (explained herein)            01/01/70 00:00      
   Sunday Quiz Update            01/01/70 00:00      
      OK Then 39 Bytes...            01/01/70 00:00      
         Oh my goodness            01/01/70 00:00      
            If you want performance...            01/01/70 00:00      
         More bytes, but ...            01/01/70 00:00      
   OK Then 38 Bytes            01/01/70 00:00      
      Comma            01/01/70 00:00      
         36! Holy cow! Very nice!            01/01/70 00:00      
            my 36            01/01/70 00:00      
               Non-conforming            01/01/70 00:00      
                  Wow! 34! |<3WL! :-)            01/01/70 00:00      
                     ???            01/01/70 00:00      
                        KEWL = cool in l33t :-) (worse than SMS...)            01/01/70 00:00      
                  Wow is right!!! plus another 36            01/01/70 00:00      
         Broken            01/01/70 00:00      
            C doesn't try to save you ...            01/01/70 00:00      
            Not Broken            01/01/70 00:00      
   look for samples of FFT code ...            01/01/70 00:00      
   this is competing to make the worst possible            01/01/70 00:00      
      it's certainly not the solution...            01/01/70 00:00      
         correction            01/01/70 00:00      
            Unless you're "porting" ...            01/01/70 00:00      
               there are situations...            01/01/70 00:00      
                  au contraire            01/01/70 00:00      
                     overlayed variables            01/01/70 00:00      
                        non-religious reasons and debunking some            01/01/70 00:00      
                           I doubt that            01/01/70 00:00      
                              now try            01/01/70 00:00      
                                 with the error or without?            01/01/70 00:00      
                                    the 49 is a compare the 48 is coding time            01/01/70 00:00      
                                       47, 48, 49            01/01/70 00:00      
                                          for such a cause as            01/01/70 00:00      
                                          Still more            01/01/70 00:00      
                                             one more point for Pascal            01/01/70 00:00      
                                                Language and vocabulary contributions            01/01/70 00:00      
                                                   Language and vocabulary contributions            01/01/70 00:00      
                                                Yes, it's much more "self-documenting"            01/01/70 00:00      
                                    Singular?            01/01/70 00:00      
                                 well... around 5 minutes            01/01/70 00:00      
                              It's not funny            01/01/70 00:00      
                                 this is why I don't like the "modern" over-windowe            01/01/70 00:00      
         Tastes            01/01/70 00:00      
      Skill in reading            01/01/70 00:00      
         in other words: because there are burglars detecti            01/01/70 00:00      
            That's why one should use ASM and not 'C'            01/01/70 00:00      
               nope            01/01/70 00:00      
                  are you perfect?            01/01/70 00:00      
                  That's why the documentation is necessary            01/01/70 00:00      
                     the old argument from C haters            01/01/70 00:00      
                     One page of comments per statement?            01/01/70 00:00      
                        If it's to be understood later on ...            01/01/70 00:00      
                           if I have to explain my choice of syntax in C, the            01/01/70 00:00      
                              The point is to show why, and not why-not            01/01/70 00:00      
                                 I post, you 'reply'            01/01/70 00:00      
                           Sorry, I still need more help on this            01/01/70 00:00      
                              Never had to do that ... and for good reason.            01/01/70 00:00      
                                 Maybe just one unclear point now            01/01/70 00:00      
                                    Well, if it were up to me ...            01/01/70 00:00      
                                       Thanks            01/01/70 00:00      
                                          I hope you're not missing my point ...            01/01/70 00:00      
                                             You explained yourself clearly            01/01/70 00:00      
                                 Upside down            01/01/70 00:00      
                                    Just look at the body of work ...            01/01/70 00:00      
                                       Nature of commercial software            01/01/70 00:00      
                                          Maybe it's more like a 747 vs. a bicycle            01/01/70 00:00      
                                    on driving and "coding"            01/01/70 00:00      
         even Mr. K agrees            01/01/70 00:00      
   Post Mortem #1            01/01/70 00:00      
      I object            01/01/70 00:00      
      Post Mortem #1.1            01/01/70 00:00      
         both translations are "strange"            01/01/70 00:00      
            Uninitialised?            01/01/70 00:00      
      20 bytes.            01/01/70 00:00      
         teaching the compiler...            01/01/70 00:00      
            Maybe for HLLs, but not for C ...            01/01/70 00:00      
               I know this is the praxis....            01/01/70 00:00      
         incorrect/incomplete statement            01/01/70 00:00      
   Post Mortem #2            01/01/70 00:00      
      Vote: 1. Yes 2. Dont care            01/01/70 00:00      
      modify it!!!!            01/01/70 00:00      
      vote            01/01/70 00:00      
         methink            01/01/70 00:00      
   its interesting that C            01/01/70 00:00      
      I like your proposal            01/01/70 00:00      

Back to Subject List