Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: [PATCH] The Freeciv motto. (PR#547)
Home

[Freeciv-Dev] Re: [PATCH] The Freeciv motto. (PR#547)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] The Freeciv motto. (PR#547)
From: gs234@xxxxxxxxx (Gaute B. Strokkenes)
Date: 04 Sep 2000 15:28:42 +0200

Jeff Mallatt <jjm@xxxxxxxxxxxx> writes:

> At 2000/09/03 13:20 , Gaute (B) Strokkenes wrote:
> >Jeff Mallatt <jjm@xxxxxxxxxxxx> writes:
> >
> >> At 2000/09/03 09:25 , Gaute (B) Strokkenes wrote:
> >> >
> >> >This patch replaces the function freeciv_motto() in common/shared.c
> >> >with an equivalent string in client/climisc.c.  Updates the gtk and
> >> >xaw clients; other clients should be trivial.  Tested on the xaw
> >> >client.
> >> 
> >> I prefer the way it is.  What reason(s) do you propose for making
> >> this change?
> >
> >1) This is (gui-independent) client-only code, not common code.
> >   Therefore, it belongs in client/ rather than common/, not so much
> >   because of the bloat but because it makes the code harder to
> >   understand.
> 
> Is the server not part of Freeciv?

Sure it is.  Why?

> Should we go through every file in common and move functions out
> which happen to only be called by either the server of the clients?

I wouldn't bother to go and look for them.  But I wouldn't complain if
anyone else did, either.  Off course, sometimes there are convenience
reasons to keep things in common (there is a closely related function
nearby, you can't think of a better place to put it, and so on.)  But
I don't see any convenience here.

> >2) There is absolutely no reason why the motto needs to be wrapped in
> >   a function.  It's not done that way anywhere else in Freeciv, and
> >   there's no reason to do it that way here.  If the motto needs to be
> >   changed you can change the string as easily in climisc.c as you
> >   could within a function.  Unless I am gravely mistaken, there will
> >   not be any need to generate the motto on the fly, either.  Again,
> >   the issue is not the bloat, but the added complexity.
> 
> To me, the function isolates complexity, and makes the calling code cleaner.

I don't see what you mean.  What's cleaner about
    motto = give_me_the_string();
compared to
    motto = _(the_string);
?

The only complexity being isolated is that of a completely ordinary
translatable string constant.  It happens to be used more than once,
but that is more than adequately dealt with by giving it a name and
putting it somewhere.

-- 
Big Gaute (not to be confused with LG)
I'm an East Side TYPE..



[Prev in Thread] Current Thread [Next in Thread]