Issue Description
bool as a success indicator is used inconsistently across the engine. This leads to major discrepancies between the docs and the code.
|
/// <returns>True if cannot remove item from the collection because cannot find it, otherwise false.</returns> |
Suggested Solution
Imho both .NET (true is success) and native (false is no-issue status code) approaches have their pros and cons. I suggest reserving bool itself for .NET-style and introduce a special type to wrap status codes, whenever they are preferred.
const bool done = TryDotNetStyle();
const StatusCode statusCode = TryCodesStyle();
const bool done = TryCodesStyle() == StatusCode::Success;
const bool done = IsSuccess(TryDocesStyle());
// etc.
Additionally, StatusCode wrapper could reserve more bytes so, whenever used, they can express more states.
Issue Description
boolas a success indicator is used inconsistently across the engine. This leads to major discrepancies between the docs and the code.FlaxEngine/Source/Engine/Core/Collections/Dictionary.h
Line 667 in 2e305da
Suggested Solution
Imho both .NET (
trueis success) and native (falseis no-issue status code) approaches have their pros and cons. I suggest reservingboolitself for .NET-style and introduce a special type to wrap status codes, whenever they are preferred.Additionally,
StatusCodewrapper could reserve more bytes so, whenever used, they can express more states.