Warning to newbies

R

Richard Bos

Seebs said:
A couple of things:

1. In my native language (English), "increment i" is more idiomatic than
"i increment", so it's easier to pronounce.

Do you also write "+= x 2", then? Because "increase x by two" is more
idiomatic than *"x increase by 2". If you want to apply that principle,
Forth seems a better language to apply it to, to me.

Richard
 
S

Seebs

They're right about the situation, wrong about the exclusivity. This is
one of the ways in which programming is an art rather than a science.
You can't replace other artists - e.g., painters, but most appropriately
writers - either. Or, well, you can, if they're hacks; but then, monkey
programmers are interchangable as well.

Good point. But I didn't strictly claim that programming was unique, merely
unusual. There is an interesting comparison between programming and
commercial art, to be sure; there are people who make a living doing bespoke
art, and do it well. It's a very different application than doing art for
art's sake, much as commercial programming work is different from programming
for programming's sake.

But the main point is that spinoza1111's claim that programmers are denied
ownership of the means of production is not merely not always true, but
essentially never true. It is, as I'm coming to expect from him, a marvel
of falsity, being not merely wrong, but exactly wrong.

Anyone can add two and two and get four. Some people can add two and two and
get five, or three. Only someone with a genius for error can get -INF.

-s
 
S

Seebs

Do you also write "+= x 2", then? Because "increase x by two" is more
idiomatic than *"x increase by 2". If you want to apply that principle,
Forth seems a better language to apply it to, to me.

Heh. Good point, but "plusequals" is prounounceable enough and verby enough
for my tastes. "x equals x plus two" and "x plusequals two" both work for
me.

Idiomatic does not necessarily imply grammatical. :)

-s
 
N

Nick Keighley

Do you also write "+= x 2", then? Because "increase x by two" is more
idiomatic than *"x increase by 2". If you want to apply that principle,
Forth seems a better language to apply it to, to me.

ah! so Lisp is easier to read than C!

(+! x 2)
 
T

Tim Rentsch

Ben Bacarisse said:
I'm not. In fact I know that there can't be any simple expression
that does not cause the result to be wrong because it can be wrong "by
logic" so to speak. If the input is "axxxx....xxx" of length SIZE_MAX
replacing the 'a' with "bb" will result in a string whose length is
not representable in a size_t.

You have a good point none the less. I should have written

strlen(src) - matches*mlen + matches*rlen + 1

because it will work for a wider range of inputs.

Eh? If SIZE_MAX > INT_MAX (and it almost certainly is), these
two expressions will have exactly the same value. Are you
worried about the case where SIZE_MAX <= INT_MAX?
 
B

Ben Bacarisse

Tim Rentsch said:
Eh? If SIZE_MAX > INT_MAX (and it almost certainly is), these
two expressions will have exactly the same value. Are you
worried about the case where SIZE_MAX <= INT_MAX?

Well, there is that but that was not going through my head at the
time. At some point I'd had some code that adjusted a pointer in
this way and there is matters if the addition happens before the
subtraction. I carried that worry over to an unsigned calculation
where it does not.
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top