Messing Around with Python

In my ongoing saga of “How do I build a web app?” I decided that a good first start would be to build just a regular program that does the things I’d ideally like my first web app to do. In this case, in the spirit of National Novel Writing Month, I’ve been thinking about what’s needed to make a wordcounter/streak tracker/maybe some other things. You know, a cohesive idea like that.

The wordcounter and streak tracker will probably be fairly easy to implement just on my machine, as it’s pretty much all numbers, so I’m starting there (famous last words?). I’ve actually already started with them. Once I’m happy with them, I’ll try setting them up to work as a really basic, no-styling web app locally, and then we’ll take a crack at deploying using Docker. Probably still without styling, because the longer I can put off untangling the horrible spaghetti that is CSS, the better.

Why Python? Some pretty superficial reasons, honestly:

  1. I have prior experience in it, though not for a while;
  2. I own a textbook that’s designed to teach you programming using the Python language, which should be useful considering it’s been a while since I’ve really made any significant projects;
  3. and I don’t have to install any new languages on my computer to make it work.

I considered Java, which fulfills condition 1 and makes up for condition 2 by having JavaDocs (JavaDocs is a work of art), but which doesn’t fulfill condition 3; then I considered Ruby, which is something that I’ve wanted to become proficient in for a while, but which doesn’t actually fulfill any of those conditions. Sad face. Better, I think, not to try to learn two things at once if I don’t have to (especially when I’ll need one to learn the other).

So far I’ve only implemented three methods: one for getting an updated wordcount & changing the total, one for setting the most recent day updated if needed, and one for checking whether the most recent update requires the most recent day to also be updated. (That’s a lot of recents and updates – I may need to adopt better terminology.) There’s also a main function for getting input through the command line & using it to update the words total & most recent day.

Plans for the future:

  • methods for tracking the total number of days a person has updated their wordcount
  • methods for tracking the number of days in a row a person has updated their wordcount
  • working out how to make this work with HTML/Javascript to create a local web app
  • Potentially: working out how to effectively backdate updates and integrate them into the streak; working out how to store all this w/ cookies on the user’s machine

Questions for the future:

  • How/where am I going to store info in between sessions?
  • Can I implement this using the MVC model, or is that too much while I’m getting back in the swing of things? (Potentially I could do the whole thing, then refactor all of it into MVC, but that sounds like a huge pain.)
  • What even is the relationship between Python & Javascript for this stuff? It’s been a very long time since I used Javascript.
  • Probably more things that’ll come up soon!

Leave a Reply

Your email address will not be published.