ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: Feature: C Programming Editorial

Feature: C Programming Editorial
Posted by Nick on 13 May 2000, 07:06 GMT

Scott Dial of the TCPA (both of which are down because Dim-TI's server is acting up again =[ ) has written our next (belated) feature on C programming on calculators. It's opinionated, so I have to say that Scott's opinions don't reflect my opinion or that of ticalc.org's.


The use of C on a calculator is a horrible waste of space. I love the idea as much as the next guy, but there simply isn't enough space for all the bloated code. GCC doesn't produce the most optimized code by far. *gasp* I understand using it to ruff in some program that you need real quick, but any complex program is going to bloat that much more. I even particurally like the fact that I can port a program for my pc to the 89 relatively easily.

What I can't stand is how many people think that C is so much better than asm... There are some real complex things you can do with C that I would be wary of attempting with ASM, but it still could be done cleaner in ASM. The GCC compiler isn't exactly optimal either. Anyone ever looked at the source (-S) it produces? Who in their right mind would use moveq.l #0,d0 to clear it? It has no clue that there is even a better choice... Or how about it moves values on the local stack that don't even need to be preserved or referenced in that method... movew d0,-2(a6) \ tst.w -2(a6). No one can replace the human mind.

I would hate to see all the programmers of tomorrow using C because it is easier... nothing great is ever easy. C is the lazy mans excuse to not learn to really program the calculator. What's that you say? The AMS was written in C... well yes it was and I hate TI for it. Space is not a luxury on such a small memory capacity. If every new programmer that comes in starts writing everything in C then space becomes even less of a luxury. Long live assembly!

 


The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.


Re: Feature: C Programming Editorial
PpHd  Account Info

I don't understand why some people say that the assembly languages are so hard to learn. I think the only thing you have to know is 'reading/writing'.

     17 May 2000, 18:54 GMT

Re: Feature: C Programming Editorial
Paulo Marques  Account Info
(Web Page)

"C is a general purpose language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of aplication. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerfull languages"

Brian W. Kernighan
Dennis M. Ritchie

Preface to their book in C, whatever the name.
BTW, they made C for those of you who don't know.

---
Cd_Slayer

     18 May 2000, 01:00 GMT


Re: Re: Feature: C Programming Editorial
Sebastian Reichelt  Account Info
(Web Page)

I think C has a little *too* few restrictions. Pascal is way better, and it's general purpose as well. But, oh well, there is only one great compiler for the 89 and 92+, and that is TI-GCC. I wonder if the SDK will be even better, but I doubt it.

     18 May 2000, 03:45 GMT


Re: Re: Re: Feature: C Programming Editorial
Paulo Marques  Account Info
(Web Page)

C is faster. But I also think Pascal has a few nice things C doesn't.

Cd_Slayer

     18 May 2000, 23:40 GMT


Re: Re: Re: Re: Feature: C Programming Editorial
Sebastian Reichelt  Account Info
(Web Page)

> C is faster.

It all depends on the optimization. Delphi for Windows, which is based on Object Pascal, is really fast (uses register passing as standard, for one thing). And in Pascal you don't have to include any header files. Instead, you use units, which are compiled completely. Also, compilation is recursive, which makes it more efficient (in this case).

> Pascal has a few nice things C doesn't

Well, that's a matter of opinion. I think that in C everything is not as intuitive as it should be, so Pascal is easier. But I think C has more features.

     19 May 2000, 00:26 GMT


Re: Re: Re: Re: Re: Feature: C Programming Editorial
Paulo Marques  Account Info
(Web Page)

Guess I don't use Pascal for a while...

Cd_Slayer

     20 May 2000, 02:18 GMT

Re: Feature: C Programming Editorial
Alex Herrera  Account Info

I agree, C probably isn't the best language for a calculator. The standard C library can be bloated and GCC isn't the best optimizer. GCC, however, isn't the only C compiler out there, and you may wanna turn optimization on full before you complain and fuss(-O3).
There is nothing wrong with a lazy programmer. A lazy programmer wants to get as much as he can done in the least amount of time, which is good. However you must be so lazy that you are patient enough to make fast code. Sounds strange, yes, but you know I am right. ASM is fast and small, but it is harder to read and less portable. You can't write 1 ASM source file and have it compile(or assemble if you will) on every machine in the world. That is however, close to the case with C. Any system with an ANSI C compiler on it will compile ANSI C. Now this is way beyond the scope of calculators so I will stop with all that.
You act like programming a calculator is such a big deal. So you programmed mario for a calculator... big deal, that doesn't do me any good. Well... maybe if I am really bored it does but I don't see why you hate C so much. You act like it is a plague. People who are way smarter than you program in C, so I think C is fine. As far as people in the future using C, you act like C is some "new wave" or something. C has been around for a /long/ time and people have been using it for a /long/ time. Well enough of my ranting, this probably won't change your mind and will only spawn more flames in this holy war, but my final point is that C has its place just as much, or more, than ASM does.

     17 June 2001, 07:30 GMT

Re: Feature: C Programming Editorial
JcN  Account Info

Why is there a big disliking for the C language? C is just one step above assembly (in size and usability, in my opinion), but it is actually quite close to the assembly language. The only thing that is probably closer is UNIX, but it was not designed for general programming. I like to think of C as a superset of assembly.

     28 July 2003, 20:07 GMT
1  2  3  4  5  6  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer