eyalroz / removedupes

Remove Duplicate Messages
https://addons.thunderbird.net/en-US/thunderbird/addon/removedupes/
Other
88 stars 6 forks source link

Define global object members separately to improve readability #139

Closed eyalroz closed 4 months ago

eyalroz commented 1 year ago

At the moment, our code looks something like this:

RemoveDupes.Whatever = {
  member1 : function(foo) { 
    return foo + 1; 
  },
 member2 : function(bar) {
    // whatever
  }
};

Instead, let's write:

RemoveDupes.Whatever = {};
RemoveDupes.Whatever.member1 = function(foo) { 
  return foo + 1; 
};
RemoveDupes.Whatever.member2 = function(bar) {
  // whatever
};

This improves readability, as we don't have to go very far to realize which brace-pair we're in; plus, it reduces the indentation level.