Re: Hooks

Mat Noguchi <[email protected]>
Newsgroups gmane.games.devel.sweng
Message-ID <D7F4D9E414140644BF099886C28C6636299D42B8D0@bngexchange01.bungie.bng.local>
> What leap?  That a global search&replace for (private|protected) to
> public was The One True Path?  That does nothing to minimize surface
> area.

I keep being reminded that subtlety is very hard to express.

I said: 
> So you really have to insulate yourself against clients but open yourself for higher powers.

Private/protected serve to insulate yourself against your clients, but they do nothing to open yourself up to a higher power. I was not suggesting getting rid of private/protected, although in the end, what you end up with makes private/protected an incidental detail. What I was suggesting is a bit harder to articulate, but I'll try. 

I have argued in the past that you should avoid global allocations when possible; in that case, even though the allocation is a detail that clients don't have to worry about, someone does have to worry about it, so you should try to make how a module/component/unit of code allocates memory something that can be managed by someone else, in as much detail as possible.

That has nothing to do with public vs. private. That has to do with how you organize code.

MSN
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tom Plunket
Sent: Tuesday, June 08, 2010 4:28 PM
To: [email protected]
Subject: Re: [Sweng-Gamedev] Hooks

Mat Noguchi wrote:
>> It may seem like you need static state, somewhere to start things off, but
>> you don't. You start off by creating an object, and you keep your state in
>> that object and in objects it references. In Newspeak, those objects are
>> modules.
>
> I mentally replaced "static" with "private" and it still made sense.

The larger the set of operations on a data set, the more it resembles
static aka global state.

Pushing globals into static classes is no more a solution than pushing
tons of mutable data into classes with dozens of functions.

If you're looking to reduce surface area, you've got to reduce the API
that manipulates each bit of data.

> Once I made that leap, writing maintainable (at least for me) code became a
> lot easier.

What leap?  That a global search&replace for (private|protected) to
public was The One True Path?  That does nothing to minimize surface
area.

-tom!

--
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.