Skip to main content

Posts about dgplug (old posts, page 16)

A Hundred Days of Code, Day 027 (Python Beyond The Basics - Object Oriented Programming)

Realised that while I do know rough and tumble basic Python, I have a long way to go before I can do things or even understand things.

Half of my frustration writing, is because I cannot do the things, I want to do, and I struggle along and by the time, some generous friend shows me or I find the answer on the net, I realise that I don’t know this part of Python at all!
I have a vocabulary problem. I know to talk like a child, not communicate like an adult.

So I have decided (let’s see how this pans out) to spend Saturdays learning something new about Python. Do some deep work.
Probably once I know enough this time could be spent working deeply on a project.
The realisation is that I need to do both, study as well as practice to learn as fast as I can.

To that end, I went and learnt about classes in Python today.
I used David Blaikie’s Python Beyond The Basics - Object Oriented Programming to get up to speed.
This was an excellent, class on the basics of classes and their implementation in Python.
I can honestly say, I know a lot more about reading and understanding Python code now that I have been through this class.
Classes, the Three Pillars, Subclasses, Exceptions, Debugging … all the basics are there.

Now, to put this knowledge to good use, in the coming weeks.

A Hundred Days of Code, Day 026 (Grokking Algorithms)

With my area in near-quarantine, I was too busy rushing around, making sure family was ok.

Had a lot of patches of free time, in the middle of things though.
So I decided to read about algorithms.
I know I need a good base in the future, and knowing about the turtles that underlie my new world.

I decided to start small, and picked up Grokking Algorithms.
I loved it.
It taught me about the big low hanging basic problems that folks need to solve using computers and the patterns / recipes / algorithms we use to solve it.
Problems like how to sort stuff (selection sort, quicksort) And how we can break down a big problem into a set of similar problems that get smaller and smaller and solving them all using a single solution from the inside of the problem onion, outwards, or from the smallest Matryoshka doll to the largest. (recursion)
And how lists function and how to find the most efficient way to get from point A to point B.
It covers a set of the basic algorithms in use today and has plenty of pointers to more efficient ways of how things are done in the real world and also where to find more advanced problems.

It’s engaging, teaches its points with stories and pictures and has exercises to ensure you are paying attention.
I loved it.
I loved it so much, I finished it in a day :)
If you are just beginning and you want an easy way to understand what all this computer stuff is made of, this is a very good book.

A Hundred Days of Code, Day 025

To get over the hump of just blindly following videos, and after some talking over with Kushal, we got to me solving problems that he would gimme.

So now I can alternate between a regular path and real world practice.
The first couple were about using psutil to do various things.
The first one would give me back my CPU and memory usage, while the other one gives me what programs are using the network on which ports.
This was fun to do!

Code’s here on Gitlab (1, 2) and on Github (1, 2)

A Hundred Days of Code, Day 024

Done with a new app!
This one is a small app that searches for some text you want, through a folder full of files. I learnt

  • about try / except blocks. this was necessary to catch non text files.
  • learnt about recursive programming. I understand it in principle now. I need more practice.
  • learnt about generators. This too, I get in principle, but need lots more practice.

Code’s here on Gitlab and on Github.

A Hundred Days of Code, Day 022

This probably should be my final day of doing nothing.
Am stretching to finish up something, so that I can then give more time to this #100DaysOfCode endeavour.
Wish me luck.

The #100DaysOfCode stretches A Hundred and Five!

The Long Road I took to Learn Basic Python

I have been wanting to switch careers to programming for a long time now.
Just that juggling a part time job, home work, and a broken back, always kept me from somehow giving it the time, that that I needed.

It has been two years now.

My lowest ebb, was September last year, when I caught a really nasty bug, was laid up in bed, for nearly a month and then checked myself into a hospital because I thought I was having a heart attack.1

In the meanwhile, people have learnt stuff, gotten careers and rocketed up their charts while I sit here spinning my wheels.
Or at least I used to think, I was spinning my wheels, until this month.

In my head, I used to be like, why is this so hard for me?

I write this, to remind myself from getting discouraged.
To remind myself of the progress I made, even if it hasn’t been much yet.
To show my future self, that past Jason, was not a fat slob.
He worked his ass off. And he was resilient.
I write this, because I had a few hard days again, but this time I don’t want to slide into a pit of despair once more.

The first thing, I reminded myself, was that everybody’s journey is different.
With my physical problems, it has not been easy to focus.
I have to juggle a ton of things, as a husband, son, consultant, patient and student.
And while it may seem all dark and gloomy, I was surrounded by incredibly loving and helpful people, which has made my journey, a lot easier than it would have been without them. My wife, my mother, my friends … all pillars of support!
So the pace I am at, might be much slower than other people, but it reminded me of something my physio said to me when I was sure, I would never be able to run more than 2 minutes straight.

You might be slow.
You might be fat.
You might be in pain.
But you will be better much sooner than other folks I know.
Because you are doing it.
While the rest are still sitting on their asses, moaning.

The second thing I did, was to take stock of how far, I have actually come.
Yes, I am not as financially well off as I would like to be.
Yes, life has kicked me in the nuts, more times, than I would like to count.
But I dug myself out of poverty.
I am working myself to the best shape of my life.
I could barely walk two years ago, and now I am practically running.
I am steadily inching to being my weight in my early twenties (while being much fitter than I was then)

So the problem is not me.
It might take time.
But I can do this.

And as I am doing this second public round of a hundred days of code, I realise all I have to do is to have no shame about my speed (or my abilities), and be resiient and persistent.

And to remind me about just how far I have come, I write this down.
I started nearly three years ago. I wasted a year, spinning my wheels.
And then I found Kushal and DGPLUG. A more supportive mentor and a more welcoming community, I hadn’t experienced in my life. I am still learning from them. And they still teach me with unending patience. If you are ever on IRC, just come say hi on the #learnandteach channel on Freenode.
I started learning the basics from a kids book, because the big ones were confusing.
I tried learning python after that, but I failed.
I tried lots of books, and online sites, but I just could not get it.
I realised that just learn the syntax and go, does not do a thing in my brain.
Or the excellent Python for You and Me would have been just the ticket.
Then I realised that maybe learning more basics would help.
And that this was not something I could learn in a few weeks or months.
So I studied the raw basics of computer science, so I could understand, what was what.
And then I understood some.
I then took my time and read the biggest non fiction book I ever read in my life. The Lutz Python Book.
And I understood some more.
I went and watched a series of videos by some kid on youtube.
And I understood some more.
Just doing all this took the better part of a year and a half.

Now here I am.
On the cusp of a moment, when I think the dam might break.
Because things make sense faster now.
I can read what other people write and actually understand.
I can think for myself and write short programs.
I can understand what the other folks teach and get it.
From here on, it seems just like a matter of loads of practice.

I write this though, to remind myself, that if this moment is not to be, then I needn’t worry.
I can see how far I have come.
I will do this.
All I need to be is shameless in my learning, patient in my attitude, and resilient in my mind.

P.S. I realised all this was inspired by an old Aurelius quote,

“True good fortune is what you make for yourself. Good fortune: good character, good intentions and good actions.”

  1. Spoiler. It wasn’t. Just an enlarged spleen acting up due to complications from the bug. Still serious. Just not a heart attack :) 

A Hundred Days of Code, Day 017

Finally done with the program!
It’s a tiny little game.
You’re a wizard battling monsters in a forest.

This was really difficult for me to write and understand.
But I kinda do now, and am better off for it.
Totally worth the slog.

I learnt,

  • the basics of object oriented programming
  • how to write classes
  • how to inherit classes
  • the basics of polymorphism

I’d heard of programming ‘paradigms’ before.
OOP was one of the most bandied about terms I’d heard.

And now that I am slowly understanding stuff, it seems more and more to me, that most stuff is nothing fancy.
It’s just a name. It’s just a name, so that you can convey a lot of information to others in just a few words.

And I realise that all these holy wars over paradigms and languages and editors are all just a fool’s errand.

They’re recipes to make stuff.
They are patterns you can use.
They are tools you can use to bring forth your imagination into being.

There are no better or worse languages, paradigms, tools or what have you.1 There is just this thing. And there is that thing. And there is another thing.

Choose what fits you, your mental model and what you think is best for the work you are trying to do, and the people you have to work with.
It’s mostly just common sense.

The code’s here at Gitlab and Github.

  1. I’m sure, there could be stuff that is objectively flawed, but that pales into insignificance over the flame wars I’ve read all these years.