Closed feliciss closed 8 months ago
VALID
as a prefix looks a bit strange, like exist another INVALID
prefix const.
Or we put CONST
as a prefix, const CONST_ ETHEREUM_SCHEME
.
Throught this is a redundant prefix, but it has no side effect.
@baichuan3 @stevenlaw123 @wow-sven
VALID
as a prefix looks a bit strange, like exist anotherINVALID
prefix const. Or we putCONST
as a prefix,const CONST_ ETHEREUM_SCHEME
. Throught this is a redundant prefix, but it has no side effect.
it's ok
Starting with E_
as error codes and using other variable names for non-error variables should be able to distinguish between them.
Starting with
E_
as error codes and using other variable names for non-error variables should be able to distinguish between them.
I second this.
Starting with
E_
as error codes and using other variable names for non-error variables should be able to distinguish between them.
EIndexOutOfBounds
=> E_IndexOutOfBounds
? is a little strange. Or
EIndexOutOfBounds
=> E_INDEX_OUT_OF_BOUNDS
?
Starting with
E_
as error codes and using other variable names for non-error variables should be able to distinguish between them.
EIndexOutOfBounds
=>E_IndexOutOfBounds
? is a little strange. OrEIndexOutOfBounds
=>E_INDEX_OUT_OF_BOUNDS
?
The first one, as stated here:
Constant names: should be upper camel case and begin with an E if they represent error codes (e.g., EIndexOutOfBounds) and upper snake case if they represent a non-error value (e.g., MIN_STAKE).
https://move-language.github.io/move/coding-conventions.html.
Errors should be upper camel case.
In this version, it's upper snake camel case.
Or I would suggest EIndexOutOfBounds
=> ErrorIndexOutOfBounds
. That way, it wouldn't change the convention.
We can discuss this at the dev meeting. But the error code in move stdlib is not following the coding conventions. We need to handle this for different frameworks.
- ErrorIndexOutOfBounds & EIndexOutOfBounds, Different frameworks use a different prefix.
- CONST_ETHEREUM_SCHEME or C_ETHEREUM_SCHEME.
- E_INDEX_OUT_OF_BOUNDS.
1 looks good?
Yes, we need to configure the error code prefix for each framework.
MoveStd -> E
MoveosStd -> Error
RoochFramework -> Error
Yes, we need to configure the error code prefix for each framework.
MoveStd ->
E
MoveosStd ->Error
RoochFramework ->Error
Okay. I'll investigate.
Yes, we need to configure the error code prefix for each framework.
MoveStd ->
E
MoveosStd ->Error
RoochFramework ->Error
I referenced examples folder to enforce the compliance as same as MoveosStd and RoochFramework.
Several implementations showed mishandling of constants. Such as:
And to tackle with it, some implementations suggested using a prefix
V
, for example:I suggest to unify the coding style to avoid the
E
starting word. It should be started withVALID
instead ofV
which indicates a variable:Because the const in move with every capital words already indicates it's a variable.
Update:
I think the upper snake case is okay for beginning with
E
? @jolestarReference:
E
if they represent error codes (e.g.,EIndexOutOfBounds
) and upper snake case if they represent a non-error value (e.g.,MIN_STAKE
).