Question: Why should structured be typedef-ed? Isn't this a bad habit left over from C? All it does is making searching for the symbol difficult.

And why do structures have different naming conventions than classes? Aren't they about the same thing?

For reasons that I don't quite understand, I still use structs for little things without methods; if nothing else, it saves the "public:" line. Maybe we should all give up on structs...

Those quibbles aside, I congratulate drizzle on joining the camel case world. Welcome!


Jay Pipes wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

Are we committed to our published naming convention of the following?

http://drizzle.org/wiki/Coding_Standards#Naming_Style

"Bools should be named "is_something" or "has_something". "

"Methods should begin with a lower case verb explaining the action.
"foo.setBar()" or "foo.replaceString()". "

Let's stick to this if it's what we want to be consistent on...

As a case-in-point, here is the recently converted-to-class Replicator
plugin:

class Replicator
{
private:
  bool enabled;
protected:
  virtual bool session_init_hook(Session *) { return false; }
  virtual bool row_insert_hook(Session *, Table *) { return false; }
  virtual bool row_update_hook(Session *, Table *,
                               const unsigned char *,
                               const unsigned char *) { return false; }
  virtual bool row_delete_hook(Session *, Table *) { return false; }
  virtual bool end_transaction_hook(Session *, bool, bool) { return false; }
  virtual bool statement_hook(Session *, const char *, size_t) { return
false; }
<snip>
};

If we are sticking to our own naming convention, shouldn't the above be:

class Replicator
{
private:
  bool is_enabled;
protected:
  virtual bool onSessionInit(Session *) { return false; }
  virtual bool onRowInsert(Session *, Table *) { return false; }
  virtual bool onRowUpdate(Session *, Table *,
                               const unsigned char *,
                               const unsigned char *) { return false; }
  virtual bool onRowDelete(Session *, Table *) { return false; }
  virtual bool onEndTransaction(Session *, bool, bool) { return false; }
  virtual bool onSendStatement(Session *, const char *, size_t) { return
false; }
<snip>
};

Cheers,
- -jay

p.s. Also, let's make sure we put parameter names along with types....
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknHrA8ACgkQ2upbWsB4UtHeYwCfTuTLhSa4EAPm6hsNDwVrtkhE
5PwAn13nb/ihrM9nynqhMHPNs08FCoFa
=ESj9
-----END PGP SIGNATURE-----

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp


--
Jim Starkey
President, NimbusDB, Inc.
978 526-1376


_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to