Procedural Programming

A big thing is made about teaching Java, and using Object Oriented techniques. “You can only program using Object Oriented methodologies in Java.”

Crap.

You can, and I have noticed it happening more, easily fudge up a procedural programming paradigm in Java.

Static methods appear as procedures and functions.

In CP2A, this is exactly what is starting to happen. Instead of building on the OO crap, stuff is being done in public static void main(String[] args), which is all procedural.

This is fine, but why bother teaching OO under Java first, and then this after? Just skip the middle man and start with the procedural stuff. I’d rather have done Pascal again… nah, just kidding.

On Teaching Programming

Before I begin, I’ll recap my qualifications, and why I think I can write this article, and have it stand as meaning something.

I have spent the last 9 years teaching. I know how to teach. I haven’t always managed to have the best results, but I have a solid understanding of educational theories and principles. I have taught a little bit of programming, somewhat unsuccessfully, although I have written programs of one sort or another consistently over the past 20 years. Most of my programming has not been for commercial purposes, in fact quite a lot of it has been programming for programming’s sake.

This year has so far been a huge eye-opener for me. I returned to study after a 9-year hiatus, and it was 4 years since my previous study in Computer Science/Engineering. As mentioned before, I haven’t exactly done nothing related to Computer Science in that time, but haven’t been in a formal education setting related to programming in about 13 years.

One of the things that stopped me from returning to study was that all three Universities in the city I live in have only taught Java in the introductory courses for the past god-knows-how-many-years. I’d tried a couple of times to learn Java from various books, but always returned to python, or other more productive languages. I’d studied C, and done quite well at that, a long time ago, so it wasn’t that I was afraid of “real” languages, but more that Java just had no appeal for me. I think the first time I tried I gave up at “primitives and objects are totally different.” I certainly remember thinking “You are joking!?” when this came up again at the start of this year when I learned Java.

So, now I’m studying full-time at Flinders University, doing Computer Science. A lot of what I’m about to say may be perceived to be somewhat critical of that institution, but please bear in mind that some of what I’m studying is useful, advanced and interesting. It’s just that some of it isn’t.

The introductory programming topic is all Java. But not even real Java. See, they are using the fantastic IDE called BlueJ, which removes a lot of the complexity of Object Oriented programming. By fantastic, I mean fucking shit. The whole point of programming is that it is somewhat complex, but I’ll get to that later. So this BlueJ thing takes a different approach. Instead of writing code, and seeing how that works, the first stuff you tend to do is graphical, and you instantiate classes by right-clicking on them, and selecting from a menu. In fact, for the first week’s work (or the first day, since I did the course intensively), I don’t think we wrote a line of code at all.

And the students who suffered through this, and the running of the same topic in normal semester last year, are really feeling it now. We are (almost) doing some real programming, and in many cases these students haven’t grasped what I consider to be the basics of programming. They haven’t totally understood selection and iteration, let alone recursion.

I think Object Oriented programming is a great paradigm. I mean, I wrote an Object Oriented chess game (without the artificial intelligence) in less than 10 hours of coding time. That’s a game, complete with GUI, that allows users to click-click to move pieces. It checks validity of moves, redraws the screen, and so on. Doing it procedurally would really suck.

But I went into that with a solid grounding in imperative programming. I learned how to construct loops and selection statements in BASIC back in the 80s. I used to criticise BASIC and Pascal, but I think I’m starting to see the value in having those type of languages, the ones that are really limited and limiting, but allow you to learn in a safe environment. By safe I mean less-threatening, because you can still, if you try hard enough, break things.

I think more importantly though, the first language people learn should be interpreted. For starters, it removes the barrier to entry of having to understand the compile/execute cycle. More so, it provides immediate feedback on what you type in.

Back to educational-land. I have studied a significant amount of Psychology, and know one thing. The sooner after an action you receive feedback, the more likely you will take away the lesson from the situation. If you type in a command, it will fail immediately, and you can then try to get it right.

Interpreted languages don’t need to be restricted to type-in-command : get-feedback styles of programming. They can be used in batch mode, but being able to experiment with the code as you go along makes a big difference to learning how stuff works. I’ll repeat the example I used last November. When I had a Commodore 128D (think of a C=64, but with a separate keyboard, a larger case, a floppy drive, and more memory: 128kb!)I remember at first being stumped by the error message that appeared when you moved the cursor up over the READY. prompt and pressed return.

OUT OF DATA ERROR.

(Apologies for the all caps, that was the way it was back then…)

It wasn’t until I started programming on that machine, which had a low entry cost since there was a built-in basic interpreter which was basically the access point to the OS. When you deal with data structures on C= BASIC, you use a command called READ, which works in conjunction with DATA. Because you could sometimes have a READ when there wasn’t a corresponding DATA statement (or argument), then you would run out of data. And the error message shown above would appear.

The first time I saw the error message on one of my own programs something clicked. I finally understood what the computer meant when I did the whole READY. thing. But more than that, I realised that computers are in many senses contextually insensitive. The computer had no idea that I wasn’t writing a program. It was inside the BASIC interpreter, therefore it was a program.

That’s the key. With computers, you need to spell stuff out instruction by instruction. In the early days, this was done with setting switches to reflect binary values. As we go on, we abstract this process. Next it was machine code, then assembly language, then higher-level languages.

In some ways, you lose something at each level. What you gain, however, in most cases exceeds that which you lose. I’d hate to try to write anything significant in assembler, let alone machine code. Being able to grasp the full idea that you are working on, being able to fit one concept in a screen, and not having to worry about things that are at a higher or lower level of abstraction enables you to better write bug-free code.

It is possible that the current limit of reasonable abstraction will be extended in the future - natural language processing and diagram-based programming tools may someday become the norm. At this point in time, however, syntax is still important, perhaps even more so than semantics. Programmers must still spell every keyword correctly. Compilers and interpreters aren’t smart enough to determine which else clause goes with which if determinant without some sort of structure, be it braces or indentation. They can’t just guess, and get it right, nor can they make sound judgements based on context.

So, it’s still important for beginning programmers to learn how to structure a loop, or several types of loop. More important, IMHO, than knowing about objects and inheritance. Yet the current trend towards OO as the be-all and end-all of learning coding means that these ideas are given precedence.

I think the saddest reflection of this is that students are not capable or interested in advanced programming topics. With 120 students at Flinders University doing Computer Programming 2A, this drops to 10 doing Programming Language Concepts. And PLC is going to make those 10 much better programmers. Because it teaches them about the structure and interpretation of computer programs. Not just how to knock together a few classes that kind-of work and get the job done.

But I rant.

Postsecret Teacher Edition

teacher1.jpg

No need to elaborate.

Ch...ch...ch...ch..changes!

Well, I’ve finished my job as a Teacher. I might write more about it later, but I’ve been flat out doing a heap of other things. I will just say, it’s great to not be doing that any longer. Sure I’ll miss some aspects of it (casual day, for instance), but I am much happier knowing that it’s all over.

More lasts

Well, I’ve had my last Year 10, 11 and 12 classes. That was a nice thing to have finished.

Even better was the last lot of school reports. Ever.

Now it is time to rant and rave about the reporting process(es) in schools. Or maybe that will be after I’ve finished…

The last time...

It’s an interesting situation, this whole change of career business. I’ve had lots of opportunity to say to myself, or anyone who will listen, “this is the last time I will do this.”

Most recently, this is the last time I will write reports. Something I have always despised, and I won’t miss it one iota.

I’ve also had the last Year Level Meeting, last Student Free Day (those are pretty good, but), and last time I have to submit student work for moderation.

In three days, I’ll have my last teaching lesson. That’s a big one!

And then, at the end of next week, my last day.

Roll on, last day!

Students (not) submitting work

I’m feeling pretty down today. Which really annoys me, because I have a Touch Football tournament on this weekend, and I’d love to be able to really focus on that, and prepare. At least I will have plenty of motivation to go hard, though.

See, my Year 12 IT Studies kids are supposed to be handing in work, or have handed it in already. I have to submit my results to SSABSA tomorrow, and at this stage I don’t have anything that even slightly resembles a full marks book.

I have found this to be the worst aspect of teaching. Trying to get all of the required work from a cohort of students.

It makes me feel like a bad teacher. Why can’t I manage to get all of the students, or even a majority of them, to submit all of the required tasks? Am I doing something wrong? I know there are stacks of things I would approach from a different direction if I were teaching the subject again, or if I could do it over. But surely I m not single-handedly responsible for their lack of work.

Having had discussions with other teachers at my school makes me think not. One of the Maths teachers mentioned she had 3 out of 17 students who have submitted all of their tasks. A Science teacher had similar things to say of his class.

At some stage, students need to stand up and take responsibility for their own actions. Regardless of excuses they make (the computer network is down, or whatever), I have continually reminded my class of the tasks they have not completed. And yet with some students, I have received no more than 20% of their assessable work. And these are the very same students who have not attended at all in the “extra week” I have put on for them, since I was absent all of last week.

Perhaps I just need to go “fuck it”, and hand out a whole bunch of failing grades.

Of course, that would only result in me getting hauled through the admin team’s offices, wanting to know why so many students scored so badly. So I spend countless hours giving students way more help than I would really like, and quite a few of my website projects look fairly similar.

Stiff shit. I’m over this whole thing. I am just killing days until the year finishes.

On doing stuff, not teaching it.

I think lots of people I know are shocked when they hear I am stopping teaching at the end of this year, and going back to Uni. For those that do know me, and haven’t heard, I’m heading back to Uni, and intend to complete a postgrad Bachelor of Computer Science at Flinders Uni. After that, I may or may not return to teaching. I’ve written this essay from the point of view that I won’t.

Many people, when I mention I am a teacher talk about the endless holidays, and the short work hours. Whilst to some extent I will miss these (having a nice long break at the end of the school year, plus another three lots of a fortnight off at a time are pretty nice, and being able to escape at 3:10 like I did today is also kinda cool), there are lots of reasons for me not to remain a teacher.

For starters, I get bored very easily if I am not doing stuff that challenges me intellectually. Nothing against teaching woodwork and metalwork, and I really do enjoy making stuff with my hands, but I’m really glad that I just finished teaching kids how to create a cake tin. Never again will I have to go through that process.

I’m not really sure why I became a teacher to begin with. It was probably a bit of an accident. I started out doing a Computer Systems Engineering degree, but at 16 I really wasn’t mature enough to handle independent living and study. I was clever, but perhaps not as smart as I thought. After doing miserably in some subjects that I should have breezed through, I had to look for alternatives. I worked for six months, met the love of my life, and decided to become a teacher.

Because I had spent more than one full year at University already, my entrance into another course was based solely on my achievement level in the previous course. Whilst I had some High Distinctions (including Programming in C, and Discrete Mathematics), I had an awful lot of failing grades, and the only teaching degree I was offered a place in was Technology Education. In some ways, I’m really glad I got into that course. If I hadn’t put it on my list, then I really don’t like to think where I’d be now. And, I learned some fantastic skills in that course, that I use in my home life as well as at work.

I’ve never fully enjoyed teaching. Don’t get me wrong, there are lots of things I do like about it, like getting to know some great people (kids as well as teachers), but I was never satisfied. I probably wouldn’t go back and change anything in my first few years of work - discovering Touch Football for instance totally changed my life - but towards the end of my five years at Windsor Gardens, I was really ready for a change. I thought a change of school was all I needed, but I was wrong. I needed a change of occupation.

So, making another wrong decision I moved to my current school. As with a new job, everything was okay for a little while. I had some new challenges, and some new opportunities. Around this time last year I was offered the chance to teach Stage 2 (final year of High School) Information Technology Studies. Perhaps, I rationalised, this was what I needed to do. Teach another subject, something I might find a little more interesting and exciting.

But this too, wasn’t the right decision. I was gung-ho at the start of the year. I’d done some preparatory work, but the amount I could do was limited since I didn’t want to do stuff that wasn’t relevant (the Curriculum Statement was in flux at that stage). I was like a man possessed, writing assessment tasks and the like. And I quite enjoyed it.

But, as the year dragged on, I realised I still wasn’t happy. It wasn’t until I re-did Jaq’s website that I realised what was missing. I’d been writing about coding, and doing a very small amount (but all the time limiting the depth of stuff I was doing, since I had to try to teach concepts to kids, and get them to do the coding), but redoing the website made me realise: I want to do stuff, instead of teach stuff.

This was something, when I look back, I’ve been subconsciously doing all along. At times, when I’ve got a group of kids doing something practical, I’ll create a project too. If they are getting me down, then I’ll focus on what I’m doing. Whether it’s a cake tin, or something more substantial, I really enjoy making stuff. Turning up bowls on a wood lathe, writing a computer program, it’s all good.

When I built Jaq’s website (credit where it is due: she designed it, I just made it work!), I had a couple of tasks that required some serious thought. The first was the actual page layout code, including the JavaScript that controls loading of new images onto the page rather than a complete reload. This is designed to reduce bandwidth, but also make for a more seamless user experience. This wound up being a fair bit of work, but most of that work was getting it to work in Internet Explorer.

The other thing I ended up doing was writing a pair of application programs. One of them attached tags to image files (using xattrs, which work on OS X and some other platforms, but don’t copy from machine to machine very well at times, so I’d rethink before using the same system). The other one generated HTML code from a folder full of images and text files. This was planned so that Jaq can just replace an image, set of images, or textual content, including making significant changes (like changing the number of items), and the program creates the whole website from the templates.

This was an interesting solution, and if I were to redo it again (which I may at some stage) then I would probably consider using PHP, and having all of the HTML data generated on the fly, rather than in advance. Doing it all in python was a piece of cake, and it helped me realise that I really do love coding.

I’ve done plenty of coding for myself in the past decade-and-a-bit that I haven’t been doing anything much work-wise that has been related to this. I can’t remember exactly when I taught myself python, or javascript, or AppleScript. I know that at least some of these had to have been in the past decade, but I do recall doing some python a long, long time ago. Version 1.5.2 rings a bell.

I could conceivably find myself a job now in this industry, but I’d much prefer an opportunity to go back to study, and ensure that I have the right sort of skills. Even though it will result in me having to learn Java, which I’ve put off for ages, I think that it’s the best approach.

Deep down, I’ve known this is what I should have done. I just wish I’d made the decision earlier.

Teaching Humour

Most of what comes up on xkcd.com is nerdy humour. Nice to see something teaching-related: Certainty on xkcd.com I have other reasons for considering alternative careers to teaching, but this one counts a bit too!

Slow DownMorcheebaCharango (Instrumental) ★★★½

Cardboard Coffins

The latest National Interest podcast had a segment on Carboard Coffins. These are an environmentally friendly replacement for regular coffins, and interestingly both interviewees were from Adelaide. I realised, at the end of the story, that I knew the John Smith that was referrred to as having been buried/cremated (I missed this bit) in a cardboard coffin. He was a lecturer we had at Uni, who died a couple of years ago from cancer. John taught us an Energy Systems class, where we studied a heap of environmentally sensitive topics, such as sustainable housing, and other bits like that. Pete, a good friend of mine had a bit more to do with him after Uni finished. Hi Pete.