how relevant is C today?

L

Lawrence D'Oliveiro

Roy Smith said:
I would add to that list PostScript. Most people think of it as just
format for print files, but it's a a real general-purpose programming
language, and a cool one at that (with an clear similarity to FORTH).

Having used both PostScript (a lot) and FORTH (a little), let me say
that their similarities are more superficial and their differences more
subtle. FORTH has a definite compilation step prior to interpretation,
whereas PostScript is very much a purely-interpreted language. A quick
illustration of some differences:

FORTH you love if honk then

vs

PostScript you love {honk} if
The
stack-based paradigm can be a bit mind bending if you're not used to it,
but bending your mind is the whole point of learning something new.

Even after you learn it, the stack-based paradigm is very easy to get
into trouble with. I started putting diagram comments in my PostScript
code, to remind myself of the state of the stack at various points.
Unfortunately it didn't have very good local variables, which would have
helped avoid overuse of the stack.
 
L

Lawrence D'Oliveiro

Thomas Bellman said:
Lawrence D'Oliveiro said:
"const" is in C89/C90.

Although with slightly different semantics from in C++... For
instance:

static const int n = 5;
double a[n];

is valid C++, but not valid C.

enum
{
n = 5,
};
double a[n];

works in C.
 
B

bruno at modulix

gregarican said:
bruno wrote:




It's the snide, curt replies such as your recent ones in this thread
that reinforce the generalization that the Python community can be
rude.

I'm afraid you're right, at least for the second one, and I do apologise

NB : the fist one didn't seem offensive to me, but english's not my
first language so I may have missed some subtility - if so, please
consider this message as applying to both.
 
B

Burton Samograd

bruno at modulix said:

You will have a functionally pure dialect of a very useful language
that makes it impossible to write pretty much anything of use :)

Although if you do manage to get something working, it's pretty much
guaranteed to work correctly due to the fact to purely functional
programs being very close to mathematical proofs...at least in theory
and assuming your language has no bugs. Imperative programming is
mathematics with state; functional programming *is* mathematics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,184
Latest member
XRUBennie9

Latest Threads

Top