In
the first weeks of CSC148, I have been introduced to the implementation of
core object oriented concepts in python as well as to its many
unique features. Over these weeks, I learned
how to implement and write proper class doc-strings for regular,
super and sub classes in python. I realized that python doesn't have
access modifiers but using features like property one can make
attributes private to an extent. For instance, one can use property
to prevent a value from being altered by the user or client by not
creating a setter. Besides the main concepts, I encountered many
useful built-ins and special methods that help free up time to focus
on the main implementation rather than side features like formatting
a print statement. They also make coding faster and improve
readability. I especially like the special methods like __str__ as
one need not worry about calling the right method but can use the
natural way one would carry it out. In this case, one can use the print statement instead of calling __str__. I feel python is probably one of
the most programmer friendly languages and I am really enjoying
learning the syntax and features of python so far.
No comments:
Post a Comment