In 1998-99 I took on teaching an evening course at Algonquin Community College. Algonquin has a huge campus; it grants diplomas in a very wide variety of fields, mostly work-related. In other words, it's not where you would go if you want to study the humanities. In the fall term I was to teach an introduction to programming in COBOL, with emphasis on the Y2K problem. COBOL was obsolete, but a lot of businesses were still dependent on code written in that language so there was a perceived need for people who could read and fix COBOL programs. In the spring term I taught an introduction to C.
My students were mainly in their 20's. Very many were fairly recent immigrants. I had a largish group from Latin America who worked together, but the overwhelming majority were from mid-eastern countries. The women wore heavy multi-layered dark clothing, and some wore hijabs. The men wore western dress, usually jeans and open-necked buttoned shirts. Almost all sported mustaches.
My previous teaching experience had been in secondary school teaching adolescents. Though many were Algonquin, they were all western (Christianized) in attitude. I had also taught seminars and short courses to people in the high tech field. No culture clash there. But, I was totally unprepared for some of the issues I faced with adults from the mid-East.
First, many regarded it as rude for me to address a female directly. If I did direct a question at a woman, she would hide her face and her companions would start giggling. I would not get an answer. Males, on the other hand, were hyper sensitive about perceived challenges to their masculinity. I had to tread as carefully with them as I had to with 14-year-old boys when I taught in high school.
Generally, we got along. I tried to adjust to their expectations and eventually most seemed to realize that I was not there to convert or harass them in any way. But, I did have a serious problem: none of them were prepared for the concepts that I had to impart. Computer languages are not just sets of keywords and rules; they have a syntax and a style unique to each language. When approaching problems in programming you need to be able to see the solution broken down into a step-by-step process with nothing taken for granted.
How computers recognize data is another problem. Bits are either on (set) or off (clear). Bits are grouped together so that eight of them in a row make up a byte; bytes make up words, longwords, integers, boolean expressions, floating point numbers, and so on. Early personal computers could process four or eight bits simultaneously. Then 16-bit computers reigned for a long time before 32-bit processors became standard. Now personal computers that can process 64 bits at a time are available. Every increase like this represents an exponential increase in computer power and speed. You have to know this and understand it so that your programs will make sense and work.
Getting people to see the difference between the number 1234 and the characters 1234 is often difficult. Numbers can be manipulated mathematically; characters cannot. Human don't care whether an integer they see on a page is a character or a number because they can treat it either way as needed. Computers cannot do this. It has to be a number or a character and the computer cannot simply switch from viewing it one way to another as needed. We have to do it for them. To complicate matters the basic operations of computers are done in powers of 2, as pointed out above. The most efficient way to treat numbers, then, from the computer's point of view, is as hexadecimal numbers. What this means is that a number that can be represented in four bits can be precessed as a unit. Two four-bit units can make up a two-digit number and can be expressed in a byte--which a computer can process in one step.
Look at it this way: we can use only 0's and 1's to represent all data. So, when we count, using only 1's and 0's we get: 0, 1, 10, 11, 100, 101, 110, 111, and so on. We call this series, binary numbers ("binary" meaning two, because we have only two digits to work with.) By "counting" in the numbers we usually use (decimals), we can determine that binary 10 equals decimal 2, and binary 111 equals decimal 7. (It helps avoid confusion if we do not name binary numbers as if they were decimal. We name them: one, one-zero, one-one, and so on.) If we use four bits the highest number we can make is 1111, or 15, (in decimal counting.) So, with four bits we can make numbers from 0 to 15. If we go above 15 we are going to have to start adding more bits. So, 16 = 10000 (made up of five bits). As said above, the most efficient way for the computer is to see numbers as groups of 4-bits.
Here's how we count in hexadecimal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
"F," as we should be able to figure out by now, is the same as our decimal number 15. What happens when we want to represent 16 as a hexadecimal number? We do the same thing as we do with decimal numbers: we increment the "10" position. So, decimal 16 in hex is 10. Now we can count using the same method: 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F. 1F (which in binary is: 11111) is equivalent to the decimal number 31. The next number after 1F would be 20, and so on. Now, by using two groups of four bits, we can make an 8-bit number which is 11111111 in binary, FF in hex, and 255 in decimal.
Now we have arrived at a situation where any combination of two hexadecimal "digits" can be used to represent 256 possibilities (counting 0). All characters of the alphabet, upper and lower case, as well as digits and punctuation can easily be represented by 256 2-digit numbers (from 00 to FF). Or, we can use 2-digit hexadecimal numbers to represent 256 colours. We can use a pair of such numbers to represent coordinates on a screen (giving us 65536 unique points, from 0,0 to FF,FF). If you worked with early personal computers you probably saw a lot of 2-place hexadecimal numbers.
This is just one example of the kinds of changes I had to make in the students' thinking and processing. When they saw something like A1, they had to see it as a number (decimal 161). If they saw 1554 they had to determine whether it was a group of characters or a decimal number (or, possibly, a hexadecimal number). They had to recognize immediately that a set bit (value 1) always represents on, yes, true; while a clear bit (value 0) represents off, no, false. They had to get used to ideas like "flipping bits" (changing a 1 to a 0 or a 0 to a 1). They had to understand basic logic sentences like "If a then b else c." and "If not a then b = c."
I had thirteen weeks, two evenings a week, to not only get all this firmly in their minds, but to teach them enough COBOL that they would be able to recognize dates that were going to cause problems when the clocks went from 1999 to 2000 and how to fix them.
No comments:
Post a Comment