vyper.fun icon indicating copy to clipboard operation
vyper.fun copied to clipboard

Training Review

Open kaleb-keny opened this issue 4 years ago • 0 comments

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.

kaleb-keny avatar Oct 30 '20 08:10 kaleb-keny