Last active
February 1, 2023 17:06
-
-
Save bartubozkurt/9a30f87208b24c45a428aeb2ad61b1e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Bad */ | |
contract A { | |
uint x; | |
constructor() public { | |
x = 0; | |
} | |
function A() public { | |
x = 1; | |
} | |
function test() public returns(uint) { | |
return x; | |
} | |
} | |
/* Better */ | |
contract A { | |
uint x; | |
constructor() public { | |
x = 1; | |
} | |
function test() public returns(uint) { | |
return x; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment