Help a beginner - simple lowercase to uppercase and so on function

S

spinoza1111

...
 > Of course, by reference calling in a programming language is SUPPORTED
 > by passing the address by value. I am surprised you don't know this.

There is one more thing needed to support it.  Within the body of the routine
there should be no distinction whether a parameter is by reference or by
value, accessing its value should be the same.

That's nice. But it's not the same, is it? If you have the address you
must dereference it to get the value.
Or do you assert that C also has call by reference to reference, ad
infinitum?

No. I am saying that C has call by reference in the stupidest possible
way. It exposes the mothering address of data which is a security hole
of the first water. Hey let's index on the address and find out what
else is in storage!
 
S

spinoza1111

...
 > >  >                                                     Part of the
 > >  > problem, and I've said this before, is that Ritchie designed-in some
 > >  > fairly perverse thought patterns in order to be cute as a member of a
 > a
 > >  > protected technical caste.
 > >
 > > Value parameters that act as local variables is not entirely newly thought
 > > off by Ritchie...
 >
 > No, he had twenty years of bad practice to draw upon: weekend hippie
 > programmers who thought they were being clever.

The Algol 60 report is quite clear about it.
   "4.7.3.1. Value assignment (call by value). All formal parameters quoted
    in the value part of the procedure declaration heading are assigned the
    values (cf. section 2.8. Values and types) of the corresponding actual
    parameters, these assignments being considers as being performed
    explicitly before entering the procedure body. The effect is as though
    an additional block embracing the procedure body were created in which
    these assignments were made to variables local to this fictitious block
    with types as given in the corresponding specifications (cf. section
    5.4.5). As a consequence, variables called by value are to be considered
    as nonlocal to the body of the procedure, but local to the fictitious
    block (cf. section 5.4.3)."

And who of J.W. Backus, F.L. Bauer, J. Green, C. Katz, J. McCarthy, P. Naur,
A.J. Perlis, H. Rutishauser, K. Samuelson, B. Vauquois, J.H. Wegstein,
A. van Wijngaarden or M. Woodger are the "weekend hippie programmers"
avant le lettre?

They explained value parameters elegantly. But it's just nuts to say
that they used value parameters as work areas heavily. My guess is
that when storage was limited they did so reluctantly, because
gentlemen and scholars starting with Kong Fu-Zi (Confucius) believe in
what Confucius called The Rectification of Names. Using a field named
intCount which holds (sadly enough) the size of an array to decrement
down to zero makes intCount, at the end of execution, a false name and
deceives the program maintainer, often repeatedly. It creates
confusion and ill-will, as Master Kong knew the non-rectification of
names caused warlordism and oppression.

To list heavyweights and this passage from the Algol 60 report is
dreamlike associative logic, like saying that "C is used widely in
embedded programs therefore I should be able to use it for business
data processing so there".
 > Suppose you want to run your C source code on a machine, on whose
 > stacks the parameters are read-only. For whatever reason, you can only
 > modify your local variables.

Well, apparently the people mentioned above gave clear semantics...

They may have been concerned with storage efficiency on small
machines. Need we be?
 
S

spinoza1111

spinoza1111said:
[...] the Standard explicitly gives us this right, and therefore
we know we can do this provided we are using a conforming
implementation.
Yeah, the standard is a big fat help when you're using a non-
conformant compiler.

If you're using a non-conforming compiler, you're not writing in C.
That should make you very happy, right?
Non-conformant compilers are Legion, but we can
always defraud the user by saying that our non-working code is
"standard".

It's pretty easy to find a conforming C90 implementation for most
platforms nowadays. The most likely problem you'll hit is not so much
non-conformance as the lack of a libc - a "freestanding
implementation". I've never hit that problem personally, however,
despite having worked with several freestanding implementations.

Programming on purpose means not messing around, and programmers who
think that  it shows intelligence to mung parameters not intended to
be munged are messing around and showing off.

You are attempting to impose an arbitrary restriction on parameters
that simply does not exist in the real world. I can see why a
programmer might decide to refrain from altering parameters as a
conscious self-limiting choice. (I myself make many such choices
whilst programming, although that doesn't happen to be one of them.)
What I don't see is why anyone would consider it bad practice.
I don't care if they are "Dennis Ritchie".

I know you don't. It seems that you struggle with the concept of
expertise.

I certainly do, because most programming "experts" are aliterate,
narrow, dull and unimaginative. They substitute work hours for thought
and wind up getting screwed by employers who use a macho definition of
easily verified "success": they prefer fast code, and meeting
deadlines, because these can be measured, and they can be ranked.

They are unable to talk about technology per se but turn to
personalities in order that their own weaknesses not be exposed.

Dennis Ritchie might be one of these "experts". Kernighan was awed by
the fact that he took only an hour (ooooo) to develop a program
mislabeled as "handling regular expressions", but he did so by (1) not
handling regular expressions in a meaningful way and (2) lazily using
parameters as work areas.

None of these experts are scientists, applied or otherwise, and post
Sep 11 and post crash it is clear to me at least that computers should
have been programmed by scientists and not cheesy little technicians.
 
D

Dan Henry

These tiresome verbal quibbles are the stock in trade
Of fat bearded and pompous men, who then pretend
That their roteish knowledge of words and words only, their pedantry,
Is true knowledge. Passing by reference in C
Is passing an address by value, and is oft distinguished
By calling it passing by reference. But Fat Bastards
And other dastards of the data processing tribe,
Like to interrupt conversation between friends
And destroy even the semblance of comitious amity
Replacing it by frowns, hard looks and contumacious contumely,
And this is why they pretend to be so fussy about terminology.
They question credibility with no necessity, and men defend themselves
'Gainst such vile reproach as is natural, men not being elves,
Sprites that can turn aside and shyly flee to forest wide.
Dolt, I have long forgot more C than thou shalt ever see
Fool, I have gained wisdom enow for its usage to eschew.
Creep, my use of words deceivest thou thy dull villain's brain:
Pedant, thy open and knavish tricks I hereby do disdain.
Ape, keepst thou thy paw from response:
Snake, crawls't away whilst thou livest for this nonce.
I was passing gas by value coding parms before thou wast born:
I was referencing inversely to asterisk when men did thee as infant,
scorn.
Call me by reference, call me by name,
Call me what name thou wilt, you'll me not shame:
Call me by value, caitiff, and make an end

Call you a troll, I've done.
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top