[haiku-commits] Re: r40523 - haiku/trunk/src/tests/kits/net/preflet/InterfacesAddOn

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 16 Feb 2011 11:34:15 +0100

Hi,

Modified: 
haiku/trunk/src/tests/kits/net/preflet/InterfacesAddOn/InterfaceAddressView.h
===================================================================
--- 
haiku/trunk/src/tests/kits/net/preflet/InterfacesAddOn/InterfaceAddressView.h   
    2011-02-15 20:34:47 UTC (rev 40522)
+++ 
haiku/trunk/src/tests/kits/net/preflet/InterfacesAddOn/InterfaceAddressView.h   
    2011-02-15 21:34:00 UTC (rev 40523)
@@ -20,7 +20,8 @@

  enum {
      AUTOSEL_MSG = 'iato',
-    STATICSEL_MSG = 'istc'
+    STATICSEL_MSG = 'istc',
+    NONESEL_MSG = 'inon'
  };

Nice progress on the NetworkSettings! Just a quick note about naming message constants. Different styles are used throughout our code and the coding style does not mention anything. Usually it's one of those three variants:

static const uint32 kModeAuto = 'iato';
static const uint32 kModeStatic = 'istc';
static const uint32 kModeNone = 'inon';

enum {
        MSG_MODE_AUTO   = 'iato',
        MSG_MODE_STATIC = 'istc'
        MSG_MODE_NONE   = 'inon'
};

enum {
        M_MODE_AUTO     = 'iato',
        M_MODE_STATIC   = 'istc'
        M_MODE_NONE     = 'inon'
};

In any case, you still seem to try hard to come up with names as short as possible. The goal however should be to find names as readable as possible with shortness a secondary goal (because shorter also means more readable). Especially the combining of words without separator makes it harder to read, though, and shortening SELECTED to SEL does not help much. As you see above, I have selected "Mode" as a more conclusive word to make it clearer what this message refers to. "Selected" is not as descriptive, since it would probably apply to any message generated from interface controls.

Best regards,
-Stephan

Other related posts: