Torben said:I'm not sure how C is "susceptible to interpretation", anyway. The code does what it says it does. Whether that's what the programmer intended is another question.
Nigel Goodwin said:C isn't strongly structured, which makes it hard to read, and perfectly working code can be written so it's extremely difficult to read, even by the author.
aussiepoof said:When it comes to the PIC... I needed to learn yet another set of assembler mnemonics like a I needed a hole in my head! I began using the 18F series as it is trivially more expensive than the 16 series and C18 gave me a productivity edge that was hard to ignore.
Nigel Goodwin said:I've no problem whatsoever with C on the 18F series, because that's what the application notes use, and they provide a free compiler. But on the 16F series the application notes are written in assembler, so C programmers tend to not have a clue about the hardware they are trying to use.
That's a ridiculously broad generalisation! Combined with a previous post in this thread one could draw the conclusion that you hate both C and C programmers... in any language, even PIC assembler, one can code very badly indeed!Nigel Goodwin said:But on the 16F series the application notes are written in assembler, so C programmers tend to not have a clue about the hardware they are trying to use.
aussiepoof said:That's a ridiculously broad generalisation! Combined with a previous post in this thread one could draw the conclusion that you hate both C and C programmers... in any language, even PIC assembler, one can code very badly indeed!
aussiepoof said:I'm NOT saying you shouldn't learn PIC assembler. Obviously if you're forced to use the 16 series then you have little option unless you're prepared to spend $$s on a compiler, and even then it's a questionable decision due to the poor performance that might ensue. You might also need to tune a routine or three on the 18F series comet to that.
Nigel Goodwin said:It's quite simple, to program a PIC you need to have a reasonable understanding of the hardware - assembler forces this on you - with C you've got to get the understanding of the hardware elsewhere.
As the 18F series provides application notes in C, it makes sense to use C for the 18F series - because what you need to know is available in C.
I've got nothing against C programmers, but you are correct that I don't like C itself.
There have been many posts on these forums about using C on various micro-controllers, and a great many of them are simply because the poster doesn't understand the hardware at all - you don't get the same questions from assembler users, because they are working at a lower level. The same problems occur with any high level language of course, it's just that most who post are using C - or perhaps the C compilers are lacking in documentation and sample programs?.
Based in two lesser known languages of B (see 1971) and BCPL (see 1967), C signified the next major step in programming languages as it also seemed to improve on the already popular Pascal. Although there is no direct link between C and Pascal, all of the features that made Pascal so popular were there, including CASE statements and pointers. Because of the extensive use of pointers, C was made fast and powerfull at the expense of being hard to read. None the less, the improvements it had over Pascal started a major wave of change from former Pascal users...
C is a powerful language for writing tight, fast, highly tuned code in a language far more portable than assembly. C is low-level enough to write device drivers, and high-level enough to write GUI libraries.
3v0 said:The one exception is the use of pointers. C pointers are not an overly complex topic but can be challenging to the ADD crowd. Pointers are there because they are a fast, efficient, way of handling data. No apologies required.
Attention Deficit Disorder (ADD)Pommie said:Pointers are fantastic. Pointers on Pics are horrid. Four different types of pointers that aren't interchangable. That takes some time to get your head around.
I know this isn't pic specific but I just had to mention that quirk.
Mike.
P.S. What is the "ADD" crowd?
futz said:
donniedj said:...and the written text becomes more effort consuming than the original reason for the code. It should solve problems and not add to it.
You know you're in trouble when you selectively quote your own post ;-)donniedj said:No need to take note to the billions of C related back and forth arguments on the web. All one has to do is take note of a single thread, like this one, to see how a language ought not to be the main discussion as opposed to what the language is attemping to accomplish.
Which is certainly makes the language the main focus of the discussion and not "what the language is attempting to accomplish" n'est ce pas?donniedj said:This is partly why I dislike C, difficult to read, susceptible to too much interpretation...
aussiepoof said:I am more productive in C than I would be in assembler and accept the *potential* performance hit. C is for me far less difficult to read than the PIC assembler's obscure mnemonics (the z80 mnemonics were easier and it *was* from the 70's!!!)
aussiepoof said:...
The limited power of microcontrollers leaves them stuck back in the realm of 1970's languages as surely as any CPU running at less than the several gigahertz necessary to run post-1970's languages....
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?