Re: Programming Languages, "to C or not to C, that is the Q."
On Sat, 22 Jan 2005 16:55:02 -0500, Scotty Fitzgerald
<sfitz007@bestweb.net> wrote:
> I notice two basic interpreters under woody. Why no compiler?!
I think most people view BASIC as more of a "toy" language than a
serious one. On Windows, VB gave you easy access to graphical
widgets, so its simplicity was appealing for simple programming.
> I also notice that many of the "Wirth Bondage and Dominance"
> languages (pascal, modula, oberon) have a program that "converts
> to C" and then I guess you would compile the c program. Why
> is this? I am guessing it has to do with porting (like, take
> your C output and you can compile it for mac or windows or something._
> Any other reasons?
C compilers have been a lot easier to get on many platforms than other
languages. Especially when you don't have root on a system, you have
to work with what's available. Incidentally, the Gnu Compiler
Collection (GCC) has a pascal compiler called gpc.
> How readable are these "whatever to C" program's
> output?! Can you see the subroutines in there, know
> what they are in relation to what you wrote in, say,
> pascal, and maybe tweak it in C? (I am waiting for
> my library to ILL a book for me, "C as a second lang.
> for Pascal users. Catchy title, huh?!
Any conversion from one language to another is likely going to
generate output that's pretty unreadable. You *might* be able to
parse through it, but it'll be a bit on the painful side, most likely.
> C does interest me, though for some reason object oriented
> does not sound appealing ot me. However, I hear of it as
> something that is not a true HLL. I hear it is more like
> a "universal assembler" of sorts. I love being able to do
> structured programming and I think I am better off with a true
> HLL, am I wrong?!
First, C isn't object-oriented. C++ is, sort of, and is essentially a
superset of C (and my language of choice). Whether C is high-level or
not depends on what you consider high-level. It's not *that* much
different from pascal, though there are substantial differences in
syntax. It's also easier to shoot yourself in the foot in C. I had
relatively little trouble moving from pascal to C, aside from some
confusion with parentheses.
C has structures and functions, just like pascal. You can get into
coding closer to the bare metal, but you can also build very
structured high-level programs. Another benefit of C is that there
are a *lot* of utility libraries available, though this is becoming
increasingly true of other languages, especially the scripting
languages like perl and python.
--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
Reply to: