Skip to content
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

Training Review #76

Open
kaleb-keny opened this issue Oct 30, 2020 · 0 comments
Open

Training Review #76

kaleb-keny opened this issue Oct 30, 2020 · 0 comments

Comments

@kaleb-keny
Copy link

kaleb-keny commented Oct 30, 2020

Hey thank you for developing the training program, with the pokemon idea being fantastic honestly for this case.
Here are some comments coming from someone that knows a bit of python, but 0 Vyper:

  • The self which is normally used in a class, can be used to access any variable defined at the class level... So what confused me, is that self is used to grab public storage variables and functions, but not used to grab constants? Which somewhat confused me a bit. Maybe https://vyper.fun/#/1/working_with_structs needs some clarification on where self is used and where it shouldn't, if constants don't need a self.
    Like in python the concepts of local and global variables, if can be added to the tutorial on how they look like in vyper would help alleviate my confusion.
  • I spend quite a bit of time to try and understand https://vyper.fun/#/2/interfaces . Maybe this concept is quite important to grasp, but in the end I finally understood part of it. so probably need to mention that the interface needs to take in as a parameter, the address of the target contract (in which the function called lives), because for me the way it was written, given a contract address I did not know which contract was being referred to. Now on the second part of storage variables. I understood the implementation kind of, that interfaces can be defined in the init (kind of like when a class is imported in a different class as a variable), but then, where can we specify payable / nonpayable or view can be specified here? or is there something of a default on all contract functions. Like as in the example below, does self.car.getSpeed() have view/payable or which type of characteristic:
car: Car

@external
def __init__(car_address: address):
    self.car = Car(car_address)

@external
def getCarSpeed():
    self.car.getSpeed()
  • One more point if possible... The use of the debugger. This is like kind of the most important thing of any coding language. If there was a chapter on that, it would be amazing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant