This week, I finished a2. I fixed the __eq__ expressions for a more efficient design: before, they didn't 'stack properly' and hence were not respecting the tree structure of regexes, but after a rigorous debug process I think I worked the kinks out. In any case, I could easily replicate everything on the assignment sheets.
Through working on this, I came to really appreciate OOP. I started with a really complex and long code design for the regexes, but through constant streamlining managed to slim it down more and more; at every step it became evident which parts could be put together more efficiently. So the __init__became very vital as well, because I ended up making a down to up approach, where I initialized basic regex objects, and with them started creating much more complex ones.
In any case, I really think this assignment helped me understand ADTs more in general (i.e versus direct inheritance) and also solidified my comprehension of methods, namely the __eq__, which I didn't know before. Now I see that a class can have its own eq method, and this opens up new possibilities and a more versatile way of interacting with other objects (vs, for example, just using the =)
In any case, super excited for part 2 !
Through working on this, I came to really appreciate OOP. I started with a really complex and long code design for the regexes, but through constant streamlining managed to slim it down more and more; at every step it became evident which parts could be put together more efficiently. So the __init__became very vital as well, because I ended up making a down to up approach, where I initialized basic regex objects, and with them started creating much more complex ones.
In any case, I really think this assignment helped me understand ADTs more in general (i.e versus direct inheritance) and also solidified my comprehension of methods, namely the __eq__, which I didn't know before. Now I see that a class can have its own eq method, and this opens up new possibilities and a more versatile way of interacting with other objects (vs, for example, just using the =)
In any case, super excited for part 2 !
No comments:
Post a Comment