Categories
Programming

Python Games

Yesterday, I posted about being generally uninterested in programming. Burnout is a pretty common case, and add on my preexisting condition, and you’ve got yourself an issue. In order to combat that, I decided to take up learning a very popular language: Python. I’ve always admired Python from afar. It seemed like a well-organized language with some interesting components. There is a module for everything and while performance isn’t quite as fast as C, it’s interpreted, so it’s to be expected.

To that end, I began writing a small game. Just guess a randomly chosen number in a range. You get a couple of attempts. Nothing hard, nothing that I’d have to dig too deep into learning how the whole thing works. A test to see if I enjoyed it.

I did enjoy it. For the most part. Learning (or relearning) the Python grammar after being embedded in C-styled languages for so long was a little bit of a hurdle. Overall, I was able to get things put together pretty well. I think I’m going to continue to extend and learn more about the deeper functions and modules available in core.

I’m not unfamiliar with programming, though, I’m sure Gordon Ramsay is not far off, eying my bread for a little sandwich making.

Idiot Sandwich

If you want to follow along, you can check out the edits and commit history I’ve posted to the repo. I may even enable issues to allow people to chime in where I might have done something wrong.

Categories
Programming

Children, Behave!

Thanks to a handy post by Kev Quirk, I was able to wrap my head around a bunch of stuff I had been meaning to get to with this blog. The big one was making custom edits to the theme template. Now, with WordPress, if you update your theme, any material edits you made to those files will be overwritten. To counteract this, WordPress implemented a concept known as “child themes“. These are skeletal themes that inherit most of the parent’s look, feel and functionality, but layer new stuff non-destructively. The advantage is that you can hack away at the child theme, making it into what you want, and when a theme update comes out, everything is still cool.

Initially, I just wanted to add the informational banner that Kev had implemented. That was simple enough. Looking through my very old posts, though, I noticed that my Garrett Quotes had the banner on them in addition to regular posts. While it’s not a detriment to the quote, it is an incorrect eyesore. So I began work on exempting certain categories. That lead me to updating and tweaking the theme, bit by bit.

In working on all this. I rekindled my desire to code and to organize with git. I implemented git flow in this repository and began tracking defects and hot-fixes and releases. It’s actually kind of fun to code, again!

While I’m no master codesmith, I am however tempered by my previous work. I strive to be more clear with the code I write. I comment everything. I also try to adhere to a more rigid standard style. While this may slow me down, it also means that I can look back on code and understand it more easily.