On Wed, 17 Apr 2002, Olin Lathrop wrote: > People that use compilers claim it lets them "develop faster" without having > to sweat the details. Personally I think this is bunk, and that the real > reason is they just aren't that good at assembler and don't want to (or > can't) learn it. People don't want to admit this, so they come up with all > kinds of reasons why using a compiler is "better". Either way you still > have to have a good grasp of what the hardware is doing. A compiler on a > small system will only hide the hardware from you to an extent, and sooner > or later you will get into trouble if you don't understand what is going on > at the instruction level. Hmm, yes, you're quite right. We're all part of a vast conspiracy to conceal the little-known but obvious fact that all C programmers are incompetent, lazy people wuo lie to cover their tracks. Are we happy now? > Properly written assembler can be just as fast to write and maintainable as > compiled code, but leaves no doubt what is going on at the instruction > level. Properly written C code can be written far faster by someone more comfortable writing C code than assembler. The compiler also generates an ASM listing, so the programmer can -- and should -- review what the compiler is doing as a sanity check. I for one am perfectly capable of programming a PIC in asembly language, but compared to many other processors I've used it's simply a colossal pain in the ass. I use C instead of assembler because I don't have to deal with memory allocation, bank switching or any of the other nonsense, it's got a sane syntax, and dealing with multibyte and floating point variables is a simple matter of writing the logic without having to hash out the low-level mechanics of it. I know I can trust the compiler to correctly perform these operations because I've tested them. I can, if needed, break a C statement down to smaller component operations to gain finer control of what assembly code is generated - but I very seldom need to do so. On the flip side, I'm not using a PIC barely adequate for the task at hand, so getting every last clock cycle or byte of memory out of it is not that critical. If I get to that point, I know I'm using the wrong processor anyway. > Improperly written code is useless no matter what language it is > written in. Unfortunately, 99% of all code out there I've seen is > poorly written. By your standards, perhaps. Obviously by someone's standards 99% of it is adequate for the task, delivered on time, and on budget. I think 99% of all cars on the road are crap, too. Obviously they work for some people. Have you considered that 99% of the code you look at is either something you've been called in to fix, or was written by novices? > Beware that this is a religious issue with many people. I know I'm going to > get the usual hate mail for saying this. Oh well. Watch the flood of > indignant responses, but keep in mind the real reason behind the protests. Right, I keep forgetting - we're incompetent, lazy liars trying to mislead people. Perhaps if your statements were not quite so narrow-minded and patently offensive to anyone who happens to have a different point of view than your own, you wouldn't get so many irritated responses. Dale -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics