Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #28740

Re: what is the best way

From Les Cargill <lcargill99@comcast.com>
Newsgroups comp.lang.c
Subject Re: what is the best way
Date 2012-11-28 12:43 -0600
Organization A noiseless patient Spider
Message-ID <k95lub$imi$1@dont-email.me> (permalink)
References (1 earlier) <k931s6$jk1$1@dont-email.me> <ahkk83Fn8fdU2@mid.individual.net> <slrnkbaf30.1jc.grahn+nntp@frailea.sa.invalid> <k93lco$ag8$1@dont-email.me> <5d30cf70-fccd-45fa-a417-5c6bc18f0b77@googlegroups.com>

Show all headers | View raw


Malcolm McLean wrote:
> On Wednesday, November 28, 2012 12:21:24 AM UTC, Les Cargill wrote:
>> Jorgen Grahn wrote:
>>
>>> Yes -- that seems highly unusual and impractical.  E.g. anyone who
>>> wants to use the interface provided by foo.h will be poisoned by
>>> everything needed to implement foo.c!
>>
>>
>> I've never found this to be a significant burden, but I do spend
>> some time in trying to make interfaces as clean as possible.
>>
>>
> The problem is that whizzbanggui.c contains the typedef of a struct point.

Uh oh.

> You're implementing pythagoras, which takes two points. So naturally they
> get passed as struct points. But now everyone has to pull in the whole of
> whizzbanggui, just to use that trivial definition.

There's an entire ... discipline? in the art of stacking boxes
on top of other boxes so that everything is covered. Bad as I hate to 
admit it, to my ear, a "point" is an object and unless it has
exactly one client/user, it has to be published in a reasonable manner.

Maybe you have a "primiTypes.h". Maybe you have "point.h".

> If you define your own struct Point / struct myPoint, then you need adapter
> code to convert between two identical structures when calling pythagoras
> and whizzbanggui from the same program. So that's not a good solution either.
>

Or you could make "point" either completely independent in the two, or 
make "point" a standalone object, or....


--
Les Cargill

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

what is the best way Andre <pas.mois@ailleur.be> - 2012-11-27 16:19 +0100
  Re: what is the best way Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-11-27 15:35 +0000
  Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-27 08:59 -0800
  Re: what is the best way James Kuyper <jameskuyper@verizon.net> - 2012-11-27 13:14 -0500
    Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 08:43 +1300
      Re: what is the best way James Kuyper <jameskuyper@verizon.net> - 2012-11-27 15:02 -0500
        Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 09:29 +1300
  Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 12:48 -0600
    Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 08:56 +1300
      Re: what is the best way Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-11-27 22:19 +0000
        Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 18:21 -0600
          Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-28 05:08 -0800
            Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-28 12:43 -0600
      Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 18:15 -0600
        Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 14:21 +1300
          Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:06 -0600
            Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-28 15:21 +1300
              Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:31 -0600
              Re: what is the best way glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-28 04:00 +0000
              Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-28 05:17 -0800
                Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-29 08:30 +1300
                Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-29 05:47 -0800
                Re: what is the best way Ian Collins <ian-news@hotmail.com> - 2012-11-30 07:37 +1300
                Re: what is the best way Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-11-29 11:35 -0800
    Re: what is the best way Keith Thompson <kst-u@mib.org> - 2012-11-27 17:25 -0800
      Re: what is the best way Les Cargill <lcargill99@comcast.com> - 2012-11-27 20:15 -0600
      Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-27 23:48 -0500
    Re: what is the best way Sergio Durigan Junior <sergiodj@riseup.net> - 2012-11-28 03:06 -0200
      Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-28 01:35 -0500
  Re: what is the best way pete <pfiland@mindspring.com> - 2012-11-28 00:13 -0500

csiph-web