It grows!

Just a simple idea…

So, I invited some of the people who tried dynamic-efl.com (my worksheet making site) a while ago to return to the site and see if things appeared more streamlined, clearer. And what was the response?

“Toby, I tried to login, but I’ve forgotten my password. Doesn’t your site have one of those password-reset functions?”

Of course it doesn’t. Grr.

No problem, it should be pretty straight-forward to code and it needs to get done at some point, I suppose.

It still isn’t done.

Save the email addresses

It turns out that the way I had been creating users, I managed to accidentally forget to save their email addresses. Oops. So, even if the “email me a link to create a new password” function existed, it wouldn’t help.

I’ve fixed that.

Then, once I was working with the email addresses, it seemed logical to add them to the mailchimp list I’d been thinking about starting.

I got that done.

Of course, to avoid adding bad email addresses to the mailchimp list and getting flagged, it seemed logical to first add the addresses after they’ve been verified. But that required me to code up an email-verification system. No biggie, but that meant learning how to send email through django.

I got that done. (Interestingly, I can send it through gmail, which I find convenient.)

Since that was done, it seemed as good a time as any to add an ‘account_locked‘ flag to the Teacher model, which would throw up a message on several of the relevant pages saying “your account is locked…”

I got that done.

accountlocked

Then, it seemed ridiculous to have a ‘your account is locked’ message if the account wasn’t, actually, functionally locked. Once I dug out where exactly the downloads happened, it should be pretty simple to have it first check if the account is locked or not.

I got that done.

There still isn’t a password reset

It’s next on my list of things to do, but this sort of experience is pretty standard for me in my own coding. I think everyone imagines that ‘real coders,’ have a plan and sit down and build something logical from start to finish.

(Though there is comic evidence to suggest that isn’t true. I got this via “Coding explained in 25 profound comics,” which is worth a visit on its own.)

coding

So, perhaps this is just par the course for the coding experience. Either way, it’s part of why my next project will be to write a drop-in user management module for future django projects.

I’m enjoying this and learning to appreciate a lot about website administration. But I would not be upset if I only had to learn all this once.

If you’ll excuse me now…

…I’m off to write a password reset function.

Advertisements

The Right Way isn’t Easy

software_architecture

I don’t know how often I’ve come across this comic. But, stumbling about the internet teaching myself to code in what is probably the worst was possible (figuring out how to fix one problem at a time) I’ve come across it several times. I believe it’s from here.

Not long ago, I was writing to my nephew about how I wrote a text-based game for him. In it, I was honest about the fact that I did things the ‘wrong’ way, and that I was certain the ‘right’ way was easier.

Now I know: it’s certainly different, but it might not be easier. At least, not at first.

Recently, I’ve been inspired to re-visit a project to automate a part of my work (whenever I find myself thinking “this is monkey-work!” I begin developing an algorithm by which it could be done — I’ve never successfully done it) I thought that, since I was starting over from scratch, this would be the right time to do start learning to do it right.

You know from the title where this is heading: it’s not easy.

I’ve generated so many pages of text, describing how I want using the program to be, how the XML it uses should be structured. I’ve followed the advice of a programmer I know and, where possible, did the GUI first and the ‘guts’ second.

And it’s exhausted me. So far, I’m not super far into the project, and I have a much better idea of what I’m doing and where it’s going… But it’s not easy.

I made myself hold off on any coding until I had a pretty solid skeleton sketched out in prose. Then, once I started coding, what I think I should have done is only coded as much as felt needed to keep fleshing the skeleton in, not the other way around. It’s pretty typical for me to — as I work on code to add tags to XML elements — realize that I’ll need to organize things in a different way but not to update the planning documents.

It’s reached the point now where, instead of having all the planning done and being able to ‘mindlessly’ code as another friend described his approach to coding, I’ll need to find the energy and concetration necessary to get the planning documents back in harmony with what’s actually happening in the code.

Of course, this is my first rodeo, so to speak, and I wanted to begin trying this in oder to get the learning curve behind me. Nonetheless, the learning curve does not feel good.