You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A major version step from 2.6 to 3.0 could be used to remove some legacy typedef's where using standard types would clarify what those types are (after introducing using std::vector;, savings of length are mostly marginal)
Improve readability of code (and Doxygen documentation):
using standard types where applicable ensures that new users understand what types are being used
new features oftentimes leverage existing code, where copy/paste of outdated syntax perpetuates issues, leading to unnecessary review feedback (if caught)
shorten function signatures (if std:: is omitted where possible)
Possible Solutions
Simple find/replace in *.h/*.cpp files.
The text was updated successfully, but these errors were encountered:
I'd say that making these changes has very little to do with the 3.0 version change, assuming we leave the old typedefs available but marked as deprecated. However, this might be as good an opportunity as we're going to get in terms of having relatively few major PRs open (or large pre-PR projects that I'm aware of) that will require significant manual conflict resolution to rebase them.
One somewhat related change that had been on my mind, in that it would touch a lot of the same lines of code, is making full use of the C++11 override specifier, and removing the virtual keyword from overrides (i.e., virtual should only appear on the base class declaration of a method). Currently, we only do this for a handful of classes that are either recent additions or have had major recent changes.
Ok. From my perspective, these are changes that are easily implemented but somewhat of a pain to review, which is the reason I was asking. I'm 👍 with moving forward, although I'd like to resolve the virtual in a different enhancement/PR (which I'd be happy to review). If you're ok as well, I'll wait until the current slew of PR's is merged, and start ticking the items off thereafter.
Abstract
A major version step from 2.6 to 3.0 could be used to remove some legacy typedef's where using standard types would clarify what those types are (after introducing
using std::vector;
, savings of length are mostly marginal)typedef vector<vector<size_t>> grouplist_t
(unused) ... Standardize code cantera#1565typedef vector<int> vector_int
(60 instances) ... Standardize code cont'd cantera#1568typedef vector<double> vector_fp
(1400 instances) ... Standardize code cont'd cantera#1568typedef double doublereal
(4426 instances, longer than necessary; use has been discouraged for some time) ... Standardize code cont'd cantera#1568There are two different 'compositions', which are identical (one typedef is worth keeping in this instance):
typedef map<string, double> compositionMap
(84 instances) ... Standardize code cantera#1565typedef map<string, double> Composition
(79 instances) ... Standardize code cantera#1565It would also be possible to eliminate
std::
in many instances (due to newly introducedusing std::xyz
:std::make_shared
(1 remaining instance) ... Standardize code cont'd cantera#1568std::set
(11 instances) ... Standardize code cantera#1565std::shared_ptr
(20 instances) ... Standardize code cont'd cantera#1568std::unique_ptr
(25 instances) ... Standardize code cont'd cantera#1568std::pair
(37 instances) ... Standardize code cont'd cantera#1568std::function
(81 instances) ... Standardize code cont'd cantera#1568std::map
(121 instances) ... Standardize code cont'd cantera#1568std::vector
(461 instances) ... Standardize code cont'd cantera#1568std::string
(1619 instances) ... Standardize code cont'd cantera#1568Motivation
Improve readability of code (and Doxygen documentation):
std::
is omitted where possible)Possible Solutions
Simple find/replace in
*.h
/*.cpp
files.The text was updated successfully, but these errors were encountered: