in Coding, Prose

Writing some proper code

I have been a hobbyist coder for a couple of years, having started with HTML and CSS and then moving on to Python. I’ve dipped my toes recently into the waters of C and Java, and found the waters shark-infested. Python, by contrast, is like this:

python

Learning Python just requires import python-learning

However, as with all things that are easy, my code has often been shambolic. I’ve mashed together things that worked, never refactored in case it broke the build, not bothered to remove comments when I was deleting code…

All of these things are fine when you’re just mucking about and not producing anything that you can’t easily clean up later. And to a certain extent it doesn’t make too much difference to the user: as long as it works, they don’t much mind that it’s chaos behind the scenes.

But: I’m aiming to start a computer science course in September at Birkbeck, and over the next six months I’m hoping to help out at Codebar and start running Python for colleagues again. So to that end I’m going to refactor an earlier project into code that works, that’s readable, and that other people can understand.

If you’d like to see what I’m doing, you’re welcome to keep an eye on my github pages – all my code is going to be open and transparent, and if you want to download it and run it yourself I’ll put some instructions in there too.

The first thing I’ll be working on is a piece of software to match individuals with suitable roles. The use case is the scheme I’m on at the moment, which moves (almost) all of us round every six months. As such it matches applicants better where their skills are lower than the post they’re going into. I don’t know how much that case is useful, but it could be tweaked so that applicants are better matched with roles where their skills are equal to or only slightly below that required.

... door for washington to further validate peter principle crazy crawfish

Or you can make your application of the Peter Principle more efficient. Your call.

In any case: I’ll be posting here about the approach I’ll be taking over the next couple of weeks to get the code up to scratch. A lot of it has been taken from the incredibly good work by @ZedShaw in his excellent book Learn Python the Hard Way. It’s currently available for free, and as soon as I have just a little bit of cash I’ll be splurging on the hard copies of several in the series.

That’s all for now. Let me know what you think by speaking to me on Twitter, leaving a comment here, or even face-to-face. Is that still a thing? I hope so.

Write a Comment

Comment

  1. since youre going to study compsci, you can correct me on this; but i believe python is strongly-typed. it isnt static-typed, because it is duck-typed (and dynamic-typed.)

    but it isnt weakly-typed, like javascript. each variable (dynamic, where the type is tied to the value, rather than the identifier) has a single and specific type– you can determine the type of x with print(type(x)) and 5 + “5” gives you a typeerror.