Part the third: in which our heroine experiences disquiet

I’m now 4 weeks in to this great learning adventure, and am increasingly daunted by the breadth of tools I need to be comfortable with now that my work is no longer contained to a couple of .py files.

It was one thing to be getting to know python more each day, and to learn some CSS and HTML as a brain break.  It is a whole different world, now, incorporating all of the above with Flask and Jinja and SQLite3, not to mention knowing that I’ll need decent javascript skills, and familiarity with APIs, too, before I can even conceptualize what my personal project will be.

“Why the sudden shift in perspective, from heady exhuberance to such trepidation and insecurity” you ask, if not in so many words.

We’re finally starting to pull the pieces of this crazy world together, and that’s the hard part. Like recalcitrant cats, the languages are just a lot to keep in mind at one time, never mind integrate with each other seamlessly.

This week we used all of the above to create a Task list, in a couple of different ways.  The exercise itself was great; we went through everything the ‘hard’ way, function by function, with lots of duplicate code and redundancy.  We customized it as we went, adding features we thought would be useful.  The walkthrough Christian wrote for us explained why we were doing what we were doing, and gave us the opportunity to ‘push’ ourselves by not relying on the spoilers he provided.  Sometimes, we could use the spoilers to just confirm we’d done things the same way as Christian.  Other times, I frankly had no idea how to go about what he was suggesting we could do… though once I checked the spoilers, I could definitely understand what was going on.

Once we’d built the thing once, start to finish, we went back through and cleared out a bunch of the duplicate code by making sub-routines of the really boilerplate stuff.  Then, we finally introduced some structure into the spiderwebbed mass of functions we’d built. I’d never felt so happy to be doing housekeeping.  Things made SO much more sense when moved into related classes; functions relating to user attributes and actions moved into a User class, and things relating to tasks themselves became part of the Task class.  The organization made the whole file a lot more comprehensible.

May I always be self-aware enough to write comprehensible code.

Ultimately, the SQLite table-building we did by hand was also thrown out the window; thank you, oh brilliant developers, for making tools to take care of that for us!  I’m glad we went through everything the hard way, to really get a handle on how the database is set up, but I hope I don’t have to do it by hand too often in my life.

Keeping the model file consistent, as we made these changes in structure, was complicated enough, considering how many functions referenced each other.  Keeping the css, html, and python files all  in order, referencing the most up to date names, was a real stretch for me.  As we changed how we handled each function, each database query, it was really easy to get confused about what was going where. Ultimately, through the help of some syntax errors and friends, we had a functional task list with some (purposely, humorously) awful CSS. At least we got to include some ridiculous cat pictures.

I found the exercise really helpful, but ultimately, I’m still worried about being able to put all the pieces together, myself, without training wheels.  Christian assures me that it will come together in the end, and I’ll be able to do it on my own.  He’s not been wrong so far, so I’m reluctantly withholding judgement on my ability to grasp everything in the 6 short weeks remaining.  Everything I’m learning is still fun, and fascinating, and enriching, and I wouldn’t be anywhere else for the world.  I do hope I’m up to the challenge, though.

This entry was posted in Personal Journey, Python Development. Bookmark the permalink.

Leave a Reply