Re: [dev] [vis] [PATCH] Set spacewidth and expandspace in config.def.h

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Sun, 4 Jan 2015 17:55:24 +0100

On Sun, Jan 04, 2015 at 04:37:06PM +0000, Dimitris Papastamos wrote:
> > -Editor *editor_new(int width, int height) {
> > +Editor *editor_new(int width, int height, int spacewidth, bool expandspace) {
>
> I am not affiliated with vis or have any familiarity with it
> but this doesn't make sense. I'd expect spacewidth/expandspace to be global
> variables in this case as they affect global state.
>
> This approach quickly doesn't scale if you want less parameters to
> be configured by the user and skews the semantics of the function.

I agree that this approach does not scale.

A less scalable approach may be to add spacewidth/expandspace fields to
the Config struct in vis.c and use them to initialize the Editor fields
(through the 'config' global set in main). This approach would probably
require less changes however.
Received on Sun Jan 04 2015 - 17:55:24 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 04 2015 - 18:00:15 CET