Friday, May 05, 2006

 

Getting my arms around the SDCC compiler...

Having come to a bit of an impasse with the NEMA stepper motors vis a vis rotational rates as applied to Godzilla and figuring that Vik and Simon had more than enough on their plate trying to get the Mk II extruder rolling on Vik's reprap I decided to see if I could learn to program the 16F628 chip.

I was able to download and install the SDCC C compiler from SourceForge easily enough and confirm that the install was correct. Of course, when I went back to download the documentation SourceForge chose exactly that moment to do one of it's not infrequent crashes, so readings aren't on the agenda for this evening.

Frustrated in that direction I went back to the wiki and downloaded the Mk II extruder firmware source code and looked, for the first time, at PIC C code. I was very pleasantly surprised at Simon's very clear and disciplined C code. I can actually read it!

In years past one of the most repellant features of C for me has always been the nasty games programmers played with C to make their programs as dense and opaque as possible. I can't tell you how relieved I am that such games are not something that Simon enjoys. :-)

I'm actually looking forward to trying my hand at some PIC programming in C.

Comments:
I have never been surprised by any 'C' code, but then I generally view it as an encryption system for assembler.

As you've just found out, clean 'C' code can - and should - be written. The gnarly convoluted stuff is just what gets waved around by proud creators of weirdness.

Vik :v)
 
I guess I've lived in a programmer environment of terminal weirdness then. :-(
 
I think the convoluted mess we used to see so much of in the past was due to the fact that computers were continually being asked to run faster than they really could - so compact and hard-to-read code actually had some value. Nowadays, computers are much more likely to have more than enough speed for what is required and we can write in a more leisurely style that emphasises readability and maintainability.
 
Comments help...

Vik :v)
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]