Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: proper use of .java files (layout) Date: Wed, 19 Dec 2012 10:12:50 -0800 Organization: A noiseless patient Spider Lines: 81 Message-ID: References: <50cfcd0b$0$293$14726298@news.sunsite.dk> <50cfd4b9$0$295$14726298@news.sunsite.dk> <50d1144b$0$290$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="95789bcd602b4527561dc0cb1c85cae5"; logging-data="20474"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MnncmmjvXZoCVQYFcnehut1RtcylIl58=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:PtKmxoNdWmHtGMYEBa4DDTMCW+Q= Xref: csiph.com comp.lang.java.programmer:20567 On Wed, 19 Dec 2012 09:33:59 +0000, lipska the kat wrote: >On 19/12/12 02:07, Eric Sosman wrote: >> On 12/18/2012 8:11 PM, Arne Vajhøj wrote: > >[snip] > >>> If the logic can be described precisely, then it can be >>> implemented in code. >> >> Yes. But my principal point in all of this is that it cannot >> always be implemented in *simple* code. Given the variety of card >> games, it is folly to try to capture the notion of "card" in a >> single, game-independent way. > >OK, I guess we got off on the wrong foot so I'll try again. >I'm not trying to be condescending. I'm genuinely interested in your >response. > >Can we agree that the names we give things help our understanding of >what those things are supposed to represent ? Sure. Remember, though, that the name is not the thing. >In our world, it almost always the case that, sooner or later, someone >who was not present during the design phase of our system will need to >understand it in order to maintain it. Good names for system concepts help. Sure. I go to the trouble of documenting them in a client billing system that I maintain. I am likely the only one to look at that part of the code, but I do it anyway because solid definitions are important. >If we think of a Card in the 'games played with cards' universe then, >unless I've missed something a card is a small piece of cloth or >cardboard that has some numbers, pictures or symbols on one or both >sides. Maybe a better name would be PlayingCard > >The concept of a PlayingCard is fixed in our collective memory by virtue >of the experiences we have of PlayingCards in our lives. >Of course different cultures use cards in different ways to play >different games but the point is, if you ask anyone on the planet what a >PlayingCard is them I suggest that the basic concept will always be there. But there are so many examples of definitions. I prefer to solidify the definition that I need before coding. My program may be a one-off so my card definition is never used elsewhere. If I suspect that it reasonably might be reused, then I will look more generally for that definition. At some point though, it is better to decide on something and run with it. >Can we also agree that any system needs a starting point and a good >starting point might be a name that seems to capture at least part of >what our system is supposed to do. > >If we agree on these few simple principles then I'd be interested to >know what name you might use for your starting point if not PlayingCard >(or Card). I would not bother. Determining the name comes as part of the design. I might even have more than one name because I might have to handle special cases. >I can't think of a card game that does not use PlayingCards of one sort >or another. One might argue that Tarot is not a game yet uses Cards. >This might mean that PlayingCard is unsuitable, so we fall back to Card >with PlayingCard a possible later specialization. That depends on your definition of the term. If you mean the run-of-the-garden 52-54 or so card deck, I can think of some easily. Gang of Four is one example. >If the base abstraction is not Card then what else might describe what a >Card is better than 'Card' Who knows yet? That is what the analysis and design are for. Sincerely, Gene Wirchenko