-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use isNotEmpty() instead of !isEmpty() #1023
base: develop
Are you sure you want to change the base?
Conversation
5bf59a8
to
a98d04c
Compare
The CI hangs. Can someone re-trigger the missing jobs? |
CI doesn't hang, it purposely doesn't execute the HAL tests until you add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I guess?
We're going to deprecate the containers in favor of stdlibc++ (or ETL) in #1020, so don't spend too much time polishing them ;-P
Yes, the reason for the existence of most of the modm containers is that we couldn't rely on any standard library facilities at all before we had added libstdc++ for AVR. The containers are heavily dated and don't follow established practices regarding naming and semantics. That makes it hard to replace them with something else without changing all your code and interoperability with the standard library is impossible. The plan is to get rid of everything the standard has a conceptually equivalent replacement for and deprecate the redundant containers in modm (#1020). I'd like to replace the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add the isNotEmpty()
methods but I am sceptical of the global refactoring of !isEmpty()
to isNotEmpty()
.
Sure it wouldn't do any harm now, but the plan is to get rid of the non-standard modm container interface in the near future. More or less everyone agrees on how container operations should be named and which the basic operations are, (e.g. standary library, ETL, boost, EASTL).
If we stick to conventions the code will be easier to work with for many people and it will be possible to change containers to some other implementation without big code modifications.
For me personally I don't see a readability improvement in isNotEmpty()
over !isEmpty()
because I am used to !empty()
which is how it would by idiomatically expressed with any other container implementation.
a98d04c
to
bfd3771
Compare
Using only one part of #857