Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Function terminology QUESTION

Reply
Thread Tools

Re: Function terminology QUESTION

 
 
James Kuyper
Guest
Posts: n/a
 
      10-14-2013
On 10/14/2013 08:24 AM, Les Cargill wrote:
> James Kuyper wrote:
>> On 10/13/2013 10:13 PM, Les Cargill wrote:
>>> �� Tiib wrote:
>>>> On Sunday, 13 October 2013 21:17:51 UTC+3, Les Cargill wrote:

>> ...
>>>>> No. Those are absolute synonyms. A "method" is just a function where
>>>>> you don't care about the return value.
>>>>
>>>> Not sure what you mean. Return value is simply special "out" parameter
>>>> present in many programming languages that may be missing or present
>>>> in subroutines. That does not make something a "method".
>>>>
>>>
>>> I put it in quotes for a reason - Pascal for example has "procdures"
>>> and "functions" which follow the distinction I laid out.

>>
>> Yes, I'm also familiar with other languages that make the same
>> distinction - between functions and procedures. Can you cite a context
>> where that same distinction is made using the term "method" rather than
>> "procedure"?
>>

>
> I beleive "method" is C++ (or perhaps other OO language)
> specific.


The C++ standard does not use the term with that meaning, but it is in
common use in the OO community, and can be used to describe what C++
calls "member functions". And in that context, a method differs from an
ordinary function by reason of being connected to an object (I'm not
sure whether C++ static member functions, which are connected to an
object type rather than to a specific object, are considered methods).

It has nothing to do with whether or not a function has a return value.
Methods are quite capable of returning values, and ordinary functions
are quite capable of not returning a value.

> It was the OP's term....


Yes. He seems quite clueless about C, but apparently has some
familiarity with programming in general. Therefore, it seems quite
likely that he was using the term in it's OO meaning described above,
which is completely unrelated to the meaning you describe.

Again, can you cite any context where "method" is used to refer to a
function with no return value, rather than a function that's connected
to an object?
--
James Kuyper
 
Reply With Quote
 
 
 
 
James Kuyper
Guest
Posts: n/a
 
      10-14-2013
On 10/14/2013 08:32 AM, Les Cargill wrote:
> Keith Thompson wrote:
>> Les Cargill <(E-Mail Removed)> writes:
>>> Öö Tiib wrote:
>>>> On Sunday, 13 October 2013 21:17:51 UTC+3, Les Cargill wrote:
>>>>> rashan wrote:

>> [...]
>>>>>> Would one be for functions and another for sub/method or so? Or ByRef/
>>>>>> ByVal?
>>>>>
>>>>> No. Those are absolute synonyms. A "method" is just a function where
>>>>> you don't care about the return value.
>>>>
>>>> Not sure what you mean. Return value is simply special "out" parameter
>>>> present in many programming languages that may be missing or present
>>>> in subroutines. That does not make something a "method".
>>>
>>> I put it in quotes for a reason - Pascal for example has "procdures"
>>> and "functions" which follow the distinction I laid out.

>>
>> Yes, it does. (More precisely, Pascal procedures don't have
>> return values at all.)
>>
>> But I don't understand what you mean when you say that you "put it
>> in quotes for a reason". What is that reason?
>>

>
> Really???
>
> http://en.wikipedia.org/wiki/Scare_quotes


We know what scare quotes are, and what they mean. What's unclear is the
reason why you chose to use scare quotes in this particular context.
That article lists several reasons for using scare quotes, none of which
seem reasonable unless we assume that you didn't understand what
"method" means in an OO context - which seems increasingly likely.

>> Bottom line: that's not what the word "method" means.
>>
>> I suggest that you've simply made a mistake. Trying to justify it
>> is not helpful. (Unless you can support your claim that "method"
>> is used to mean "a function where you don't care about the return
>> value", which would surprise me.)
>>
>> [...]
>>

>
> I was gently trying to steer the OP towards that distinction.


You were trying to steer him toward that distinction (between functions
associated with objects and functions that are not), by asserting that
the term referred to an entirely unrelated distinction (between
functions which return a values and ones that do not)? This is sometimes
necessary, when you have a strong current running across your path - you
might have to start your trip to Boston by steering in the direction of
New York - but it seems like an odd approach to use in this context.

--
James Kuyper
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      10-14-2013
Les Cargill <(E-Mail Removed)> writes:
> Keith Thompson wrote:
>> Les Cargill <(E-Mail Removed)> writes:
>>> Öö Tiib wrote:
>>>> On Sunday, 13 October 2013 21:17:51 UTC+3, Les Cargill wrote:
>>>>> rashan wrote:

>> [...]
>>>>>> Would one be for functions and another for sub/method or so? Or ByRef/
>>>>>> ByVal?
>>>>>
>>>>> No. Those are absolute synonyms. A "method" is just a function where
>>>>> you don't care about the return value.
>>>>
>>>> Not sure what you mean. Return value is simply special "out" parameter
>>>> present in many programming languages that may be missing or present
>>>> in subroutines. That does not make something a "method".
>>>
>>> I put it in quotes for a reason - Pascal for example has "procdures"
>>> and "functions" which follow the distinction I laid out.

>>
>> Yes, it does. (More precisely, Pascal procedures don't have
>> return values at all.)
>>
>> But I don't understand what you mean when you say that you "put it
>> in quotes for a reason". What is that reason?

>
> Really???
>
> http://en.wikipedia.org/wiki/Scare_quotes


Yes, really!!!

>> Bottom line: that's not what the word "method" means.
>>
>> I suggest that you've simply made a mistake. Trying to justify it
>> is not helpful. (Unless you can support your claim that "method"
>> is used to mean "a function where you don't care about the return
>> value", which would surprise me.)
>>
>> [...]

>
> I was gently trying to steer the OP towards that distinction.


Instead you've created a great deal of confusion by providing a
completely incorrect definition of the word "method". The scare
quotes (if that's what they were) don't make it any more reasonable.

The distinction between returning a value and not returning a
value is not relevant to the OP's question; you introduced it to
the discussion.

I think you had a mistaken idea about what the word "method" means,
and now you're trying to pretend that you wrote something that
made sense. I suggest you stop digging.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Stephen Sprunk
Guest
Posts: n/a
 
      10-14-2013
On 14-Oct-13 07:32, Les Cargill wrote:
> Keith Thompson wrote:
>> Les Cargill <(E-Mail Removed)> writes:
>>> Öö Tiib wrote:
>>>> On Sunday, 13 October 2013 21:17:51 UTC+3, Les Cargill wrote:
>>>>> No. Those are absolute synonyms. A "method" is just a
>>>>> function where you don't care about the return value.
>>>>
>>>> Not sure what you mean. Return value is simply special "out"
>>>> parameter present in many programming languages that may be
>>>> missing or present in subroutines. That does not make something
>>>> a "method".
>>>
>>> I put it in quotes for a reason - Pascal for example has
>>> "procdures" and "functions" which follow the distinction I laid
>>> out.

>>
>> Yes, it does. (More precisely, Pascal procedures don't have return
>> values at all.)
>>
>> But I don't understand what you mean when you say that you "put it
>> in quotes for a reason". What is that reason?

>
> Really???
>
> http://en.wikipedia.org/wiki/Scare_quotes


Are you sure they were really scare quotes? It is normal in English to
use quotes when defining words or when it is a "mention" rather than a
"use". For instance,

"A" is an article.

In this case, those are not scare quotes; they are necessary to show
that you are mentioning the word rather than using the word since the
latter would be invalid grammar, though they may still be used even when
not strictly necessary. For instance,

A "dog" is a four-legged animal.

Scare quotes, in contrast, are used to cast doubt on the use of a
particular word that, without them, would seem legitimate. That doesn't
seem to apply to your use of "procedures" and "functions".

S

--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking
 
Reply With Quote
 
Les Cargill
Guest
Posts: n/a
 
      10-15-2013
Stephen Sprunk wrote:
> On 14-Oct-13 07:32, Les Cargill wrote:
>> Keith Thompson wrote:
>>> Les Cargill <(E-Mail Removed)> writes:
>>>> Öö Tiib wrote:
>>>>> On Sunday, 13 October 2013 21:17:51 UTC+3, Les Cargill wrote:
>>>>>> No. Those are absolute synonyms. A "method" is just a
>>>>>> function where you don't care about the return value.
>>>>>
>>>>> Not sure what you mean. Return value is simply special "out"
>>>>> parameter present in many programming languages that may be
>>>>> missing or present in subroutines. That does not make something
>>>>> a "method".
>>>>
>>>> I put it in quotes for a reason - Pascal for example has
>>>> "procdures" and "functions" which follow the distinction I laid
>>>> out.
>>>
>>> Yes, it does. (More precisely, Pascal procedures don't have return
>>> values at all.)
>>>
>>> But I don't understand what you mean when you say that you "put it
>>> in quotes for a reason". What is that reason?

>>
>> Really???
>>
>> http://en.wikipedia.org/wiki/Scare_quotes

>
> Are you sure they were really scare quotes? It is normal in English to
> use quotes when defining words or when it is a "mention" rather than a
> "use". For instance,
>
> "A" is an article.
>
> In this case, those are not scare quotes; they are necessary to show
> that you are mentioning the word rather than using the word since the
> latter would be invalid grammar, though they may still be used even when
> not strictly necessary. For instance,
>
> A "dog" is a four-legged animal.
>
> Scare quotes, in contrast, are used to cast doubt on the use of a
> particular word that, without them, would seem legitimate. That doesn't
> seem to apply to your use of "procedures" and "functions".
>
> S
>



I reveiewed the post I'd made; I had typed "method" when I meant to type
"procedure".

<rends garment; heaps ashes on head>

CAN WE NOW GET ON WITH OUR LIVES?

--
Les Cargill
 
Reply With Quote
 
gwowen
Guest
Posts: n/a
 
      10-18-2013
On Tuesday, October 15, 2013 1:25:37 AM UTC+1, Les Cargill wrote:

> CAN WE NOW GET ON WITH OUR LIVES?


Are you kidding? 99% of things that help people write useful C code (e.g. POSIX, threads, optimisation) have been declared "non-standard" (i.e. *unclean*) by the UseNet Cabal, so arguing about terminology and esoterica[0] is pretty much all we have left, once you tire of saying:

"you'll get a better answer by asking in comp.programming.long-defunct-newsgroup-that-gets-3-posts-a-year"

[0] Lets discuss signed arithmetic vs unsigned arithmetic again, so I can prove that my perfect recall of the standard is better than your near perfect recall of the standard. Bonus points if you pretend that everyone is coding to C11 these days.
 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      10-18-2013
On 10/18/2013 07:00 AM, gwowen wrote:
> On Tuesday, October 15, 2013 1:25:37 AM UTC+1, Les Cargill wrote:
>
>> CAN WE NOW GET ON WITH OUR LIVES?

>
> Are you kidding? 99% of things that help people write useful C code
> (e.g. POSIX, threads, optimisation) have been declared "non-standard"


As of C2011, threads are entirely standard in C, so long as you're
asking about C threads. A while back we had someone insisting on talking
about POSIX threads here, rather than in any of the very active other
forums that are dedicated to that standard, where he could have talked
with experts on the subject. It would have been entirely appropriate to
compare C threads with POSIX threads, and I'd be very interested in
reading such a discussion, though I'm not competent to contribute to it.
However, he had no interest in discussing C's new threading model at all.

It's also entirely appropriate to discuss what kinds of optimization are
(and are not) permitted by the C standard, and to discuss
platform-independent optimization techniques. But why would you want to
discuss platform-specific optimization techniques in a forum not
dedicated to that platform? You'd be wasting the time of the people
here that are not interested in that platform, and you'd be deliberately
avoiding the greater expertise of the people in that forum.

> (i.e. *unclean*) by the UseNet Cabal, so arguing about terminology


There's nothing "unclean" about non-standard topics, they're just more
appropriately discussed elsewhere. If the topic is of sufficient
interest to generate a question, it's virtually guaranteed that there is
some active forum somewhere discussing it, and if it's not about the use
of standard C, it's virtually guaranteed that the appropriate forum has
more participants willing and competent to discuss that topic than
comp.lang.c does.

> and esoterica[0] is pretty much all we have left, once you tire of
> saying:


I don't know about that - even with most of the trolls filtered out,
there's still enough substantive discussion in this forum to cause me to
spend more time monitoring this newsgroup than I can really afford to be
spending. You might have a lot more spare time on your hands than I do.

> "you'll get a better answer by asking in
> comp.programming.long-defunct-newsgroup-that-gets-3-posts-a-year"


If the most appropriate forum for discussing a given topic gets only 3
posts a year, that topic is no longer of interest to any significant
number of people, and does not generate any significant number of
questions, neither here nor anywhere else. In the unlikely event that
such a question arrives in an inappropriate forum such as this one, the
chances of finding anyone who's even heard of the topic, much less an
expert on the topic who can answer such questions, are quite miniscule.

Note: I said "forum", not newsgroup. Usenet is NOT the entire world. The
most appropriate forum for discussing a particular topic might be
mailing list, a chat room, or a facebook page, or any of a steadily
widening range of other possibilities.

Most of the questions that inappropriately end up here are about such
things as POSIX, Windows, Intel machines, or embedded systems, among
other things. All of them are very active topics of discussion,
generating at least dozens of questions and answers every day, possibly
even hundreds or thousands. However, those questions are being asked and
answered in the right forum, which is NOT here.
--
James Kuyper
 
Reply With Quote
 
Ben Bacarisse
Guest
Posts: n/a
 
      10-18-2013
gwowen <(E-Mail Removed)> writes:

> On Tuesday, October 15, 2013 1:25:37 AM UTC+1, Les Cargill wrote:
>
>> CAN WE NOW GET ON WITH OUR LIVES?

>
> Are you kidding? 99% of things that help people write useful C code
> (e.g. POSIX, threads, optimisation) have been declared "non-standard"
> (i.e. *unclean*) by the UseNet Cabal, so arguing about terminology and
> esoterica[0] is pretty much all we have left,


Are we reading the same group? I recall threads on

coding rules for shaddow variables
error handling code patterns
flood-fill algorithms
writing a function to check for C-syntax string literals
the syntax of do .. while; and why it needs a terminating ';'
card shuffling algorithms
uses of const qualified pointers
tail call elimination
towers of hanoi solutions
the efficiency of recursive solutions
XML parsing and its use for configuration settings

and quite a few of these involved actual C code. I'm sure this is not
an exhaustive list.

<snip>
--
Ben.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Function terminology QUESTION August Karlstrom C Programming 1 10-13-2013 10:30 PM
Re: Function terminology QUESTION James Kuyper C Programming 0 10-13-2013 01:52 PM
Re: Function terminology QUESTION Eric Sosman C Programming 0 10-13-2013 12:34 PM
Re: well-defined terminology versus generally accepted terminology regarding pointers and arrays Paul C++ 63 04-24-2011 12:42 PM
terminology question - "foreign function library" mirandacascade@yahoo.com Python 2 12-24-2006 09:27 PM



Advertisments