Today I was reminded of the rather lame joke:
Francis, a poet of no real renown visits his slightly less well educated brother, Jack, a man of the World, but definitely not books. It's the usual weekly meeting for them. Francis sips his cappuccino and nibbles on a scone with clotted cream. Jack tucks into his slightly more rustic bacon and egg muffin, and sugar and milk laden coffee. Francis animatedly discusses his troubles. His arms move with an exaggerated grace and elegance and his beret hanging precariously from his head. Jack just listens to his brother, trying to absorb some of his sophistication, in between trying to remember where he had left his lucky toothpick. Anyway, Francis looks Jack square in the eye and says:
"I'm really stuck for a while now. I just can't seem to think of one word for two weeks and it is killing me!"
Jack has a flash of inspiration:
"How about 'fortnight'?"
Okay, it's an old one, but it is now two weeks until I leave Dublin to start my life in Canada, with my fiancée and our boys. I am excited at the prospect, not just because it has been a while since we were last together, but also as it is a new beginning in many ways. Anyway, things are getting tighter and tighter and I have a lot to do. To be honest (not that I'm normally not), things aren't exactly going smoothly. Some groups seem to be determined to make my life difficult. I've had great fun and games with shipping companies and I find the level of service in that sector to be quite lacking. I have a feeling that it's because I really don't want to pay the same to ship a very small amount as they seem to think is appropriate for shipping the contents of a house. Actually, it's probably as much that I am looking to ship far too little for some (those who do removals) and far too much for others (those who courier packages) and it really doesn't help that I'm shipping to somewhere very remote (compared to the source, Dublin).
Well, they aren't the only people making my life fun. A guy sold a bodhrán to me for what I considered to be a fair price. Actually, he had promised the bodhrán to me and then reneged on selling it when I went to collect it. This was to be a gift for some people over in Canada and had taken me a while to find the right instrument. Then I went looking for one elsewhere and unsurprisingly, a good one is hard to find. Anyone who has ever bought a quality musical instrument, especially a handmade and slightly unusual instrument will know this. In the end, I had to settle for one that I'm not too pleased with, but which will do the job. It's a fine instrument, but not quite as good a match as I was looking for.
Then there was another incident with a shop in Dublin. Again, I can't be giving out names here and since the item involved is going to be a Christmas present for one of the readers, I won't be giving details of the item itself. It suffices to say that a certain shop said they would have the item in stock, and I called in to them or phoned them pretty much every day for two weeks. Each time I was told, with an air of certainty, that they would have said item in stock the very next day. I was at my wits end, but since the item was required I decided to try one last avenue, I ordered from the same company, on-line. I felt that even if it didn't arrive before I left for Canada, at least someone here could collect it and it would almost certainly arrive by Christmas. The item arrived the next day. It seemed that it was easier for me to get stock from their warehouse than it was for their own stores to do so. Hours of my time wasted because they couldn't be bothered to have proper stock control.
Okay, this list goes on and I doubt that you want to read a list of woes, but I have been thinking, can I come up with one word to describe the two weeks, those that are just about to unfold. Hectic springs to mind, though the Irish word, rí-rá is probably more accurate. It's going to be a challenge, but it will be worth it. I'll get to have some fun (driving a car at silly angles around a track, meet with my brothers, etc.) and I'm going to have a lot to do (packing, getting documents in order, making sure I have all the presents I should have) but in the end, it will be so worthwhile. In fact, maybe that is a better word, worthwhile.
Anyway, thanks for putting up with me venting. I'm sure that tomorrow I'll have something interesting on the technology front to share. Actually I know exactly what I'm going to write about and if you have any interest in algorithms and why one should always question them, this will be for you.
Until tomorrow,
Neil
Thursday, November 18, 2010
Tuesday, November 16, 2010
Technology Round-up A
I've been looking around at some new technologies and possibilities, as I often do and I decided to post a few interesting links.
Firstly, there was a time many years ago that I scorned the idea of a mobile phone. I didn't need one and I felt that nobody should. I was a Luddite. Now, I feel that mobile phones are not only very useful as a tool and way to stay connected, they are becoming the single most important piece of information technology that we carry or even use on a regular basis. They've all but made the PDA a thing of the past and they are marching steadily towards doing much the same with the PC.
It won't be long before many people, particularly those who use PCs casually, for things like email, internet browsing and such, will just use a mobile phone. It makes sense, we carry the phone everywhere we go, the computing power available is beginning to match the requirements for most common computing tasks and they are relatively inexpensive. All that is really needed is to conquer the limitations in terms of interface. Many things don't suit their relatively tiny screens and touch screen keyboards, while improving hugely over time, are still fiddly at best to use. Of course, certain interface improvements will reduce the reliance on keyboards and such, but the mobile phone's single biggest drawback is going to be size. How do you make something small enough to fit in a pocket and yet still provide an interface that suits human requirements? There are many solutions, some involving eye-wear, and such, but an interesting possibility is the Mozilla Seabird:
I've no real expectation that this technology will come to the main stream in the near future, but the concept is interesting. It shows that the designers have thought about the issue of how to make a phone that can take advantage of the situation that the user finds themselves in and doesn't require the user to carry around extraneous equipment. Unfortunately, I'm sure that we don't yet have the technology to build this phone, especially not with the probable power requirements that it would have. It's still a cool possibility for the future.
Now, lets get our head back down to Earth and I'll tell you about another piece of cool technology. It's a bit of free software (in both meanings of the term) and it has some cool results. It's called Swinger.py and it makes your music swing. I haven't had a chance to try it out myself, but the results on this page speak for themselves. I've never heard Guns 'n Roses sound quite so swinging. It's not likely to be to everyone's taste, but I think it's a little cool. Here's one of the tunes for those who don't want to click (Guns 'n Roses, Sweet Child 'O Mine):
Okay, moving on from trivialities and on to something a little more suited to actually doing something productive today. I'm a little paranoid. Not without reason, but that's another discussion for another day. Let's just say that I like a certain degree of security and sometimes that means that I want some files on my computer to be encrypted so that a thief won't be able to access sensitive information. This information is not just mine, but customers too. Anyone who stores such data should be taking at least some precautions. Anyone who stores sensitive data should really already have precautions in place to guarantee that physical access to the storage does not result in having the ability to access all of the information stored on it. To that end, I strongly suggest looking at a short article in Lifehacker:
http://lifehacker.com/5677725/five-best-file-encryption-tools
It's not even remotely comprehensive, but if you're not applying one of these technologies, or similar, and you store sensitive data, please let me know so I can make sure to not do business with you until you do ;) Okay, in all seriousness, this is up there with backups and the like. Most SMEs have gotten the message about needing to do backups (though most don't yet know to make sure they do off-site ones, but that's another day's work), so if you have them working, now please look at the above and virtual private networks (if remote access is needed). Sorry for being a little preachy, but I've seen far too many small businesses who just seem to play fast and loose with their customers' data.
Finally, it seems that Hitachi have found a way to make capacitative screens work with styli, which is good news for the future of mobile phones. Here's the link. This should allow more ways of using your mobile phone without having to touch the screen with your bare hands (a bit of a pain at -20C) and should help with the problem of fat-fingers, which we all suffer from from time to time.
Anyway, that's my first technology round-up. I'm sure there will be more in future. I leave you with a quote from one of my favourite authors, Isaac Asimov
Neil
Firstly, there was a time many years ago that I scorned the idea of a mobile phone. I didn't need one and I felt that nobody should. I was a Luddite. Now, I feel that mobile phones are not only very useful as a tool and way to stay connected, they are becoming the single most important piece of information technology that we carry or even use on a regular basis. They've all but made the PDA a thing of the past and they are marching steadily towards doing much the same with the PC.
It won't be long before many people, particularly those who use PCs casually, for things like email, internet browsing and such, will just use a mobile phone. It makes sense, we carry the phone everywhere we go, the computing power available is beginning to match the requirements for most common computing tasks and they are relatively inexpensive. All that is really needed is to conquer the limitations in terms of interface. Many things don't suit their relatively tiny screens and touch screen keyboards, while improving hugely over time, are still fiddly at best to use. Of course, certain interface improvements will reduce the reliance on keyboards and such, but the mobile phone's single biggest drawback is going to be size. How do you make something small enough to fit in a pocket and yet still provide an interface that suits human requirements? There are many solutions, some involving eye-wear, and such, but an interesting possibility is the Mozilla Seabird:
I've no real expectation that this technology will come to the main stream in the near future, but the concept is interesting. It shows that the designers have thought about the issue of how to make a phone that can take advantage of the situation that the user finds themselves in and doesn't require the user to carry around extraneous equipment. Unfortunately, I'm sure that we don't yet have the technology to build this phone, especially not with the probable power requirements that it would have. It's still a cool possibility for the future.
Now, lets get our head back down to Earth and I'll tell you about another piece of cool technology. It's a bit of free software (in both meanings of the term) and it has some cool results. It's called Swinger.py and it makes your music swing. I haven't had a chance to try it out myself, but the results on this page speak for themselves. I've never heard Guns 'n Roses sound quite so swinging. It's not likely to be to everyone's taste, but I think it's a little cool. Here's one of the tunes for those who don't want to click (Guns 'n Roses, Sweet Child 'O Mine):
Okay, moving on from trivialities and on to something a little more suited to actually doing something productive today. I'm a little paranoid. Not without reason, but that's another discussion for another day. Let's just say that I like a certain degree of security and sometimes that means that I want some files on my computer to be encrypted so that a thief won't be able to access sensitive information. This information is not just mine, but customers too. Anyone who stores such data should be taking at least some precautions. Anyone who stores sensitive data should really already have precautions in place to guarantee that physical access to the storage does not result in having the ability to access all of the information stored on it. To that end, I strongly suggest looking at a short article in Lifehacker:
http://lifehacker.com/5677725/five-best-file-encryption-tools
It's not even remotely comprehensive, but if you're not applying one of these technologies, or similar, and you store sensitive data, please let me know so I can make sure to not do business with you until you do ;) Okay, in all seriousness, this is up there with backups and the like. Most SMEs have gotten the message about needing to do backups (though most don't yet know to make sure they do off-site ones, but that's another day's work), so if you have them working, now please look at the above and virtual private networks (if remote access is needed). Sorry for being a little preachy, but I've seen far too many small businesses who just seem to play fast and loose with their customers' data.
Finally, it seems that Hitachi have found a way to make capacitative screens work with styli, which is good news for the future of mobile phones. Here's the link. This should allow more ways of using your mobile phone without having to touch the screen with your bare hands (a bit of a pain at -20C) and should help with the problem of fat-fingers, which we all suffer from from time to time.
Anyway, that's my first technology round-up. I'm sure there will be more in future. I leave you with a quote from one of my favourite authors, Isaac Asimov
It is change, continuing change, inevitable change, that is the dominant factor in society today. No sensible decision can be made any longer without taking into account not only the world as it is, but the world as it will be ...Until next time, good luck,
Neil
Janus Rules!
My life is seeming being ruled by Janus. In Roman mythology, he is the the god of time, gates, beginnings and endings, and January is named in honour of him. My life is currently full of many endings, beginnings and moving on. I'm currently looking forward to starting a new life in Canada, leaving the old life of Ireland behind. At the same time, I will be getting married, starting a new job, making new friends, and all of this will be happening between December and January.
Now, I won't be severing all ties with my Irish life. I have friends and family and while they aren't making the journey with me, they will be with me in my heart. I won't forget them and I will do my best to keep them as an integral and crucial part of my life. They help enrich my life in so many ways, from simple acts of kindness to thought provoking discussion and a myriad of other ways too. Leaving them behind is tough, but I will stay in touch with them.
Another way that Janus is involved with my life is that I am pressed for time. As I leave Ireland in only a few weeks, and in that time I have a world of activities planned, from packing stuff up, to going on a skid-pad testing day with my sister (her birthday present from me), to visiting my brothers and their families in England, to celebrating my father's birthday and the many little things I have to get done so that I will have an easier life moving to Canada.
I am so looking forward to the changes, but I have to say that I like my life, so I will want to bring along a lot of the past with me too.
Anyway, thanks Janus for the opportunities, but please give me a few more hours in the day!
Now, I won't be severing all ties with my Irish life. I have friends and family and while they aren't making the journey with me, they will be with me in my heart. I won't forget them and I will do my best to keep them as an integral and crucial part of my life. They help enrich my life in so many ways, from simple acts of kindness to thought provoking discussion and a myriad of other ways too. Leaving them behind is tough, but I will stay in touch with them.
Another way that Janus is involved with my life is that I am pressed for time. As I leave Ireland in only a few weeks, and in that time I have a world of activities planned, from packing stuff up, to going on a skid-pad testing day with my sister (her birthday present from me), to visiting my brothers and their families in England, to celebrating my father's birthday and the many little things I have to get done so that I will have an easier life moving to Canada.
I am so looking forward to the changes, but I have to say that I like my life, so I will want to bring along a lot of the past with me too.
Anyway, thanks Janus for the opportunities, but please give me a few more hours in the day!
Sunday, November 14, 2010
Function, Form and Quality
I was going to write a scathing article on how most consumer items developed today squarely place form, image, style, and status before function. But, I've decided instead to try to look at things a little differently.
There are many aspects to our lives, most of which have some interface with technology or traditionally functional items. From the man who complains about his partner on a private internet chat forum, to the boy who cycles his bicycle for fun, to the lady switching on a light so she can read. We are surrounded by appliances, things which do a job, or in some cases, many jobs, and which we rely on for modern living. In all cases, these items are there to make our lives somehow better, though sometimes it seems that they are sent from the deepest depths of hell to vex us and leave us in a bad mood.
That interface between humans and the things we use is vitally important. In many cases, we just want it to work and do so with the least amount of fuss, but in some cases, just doing a designated job is not in and of itself enough. Often, we want an experience which makes us feel good. We want a quality experience. A simple example of this is the car. For some, it is a purely utilitarian tool, where the brand, the appearance, the slightly more tactile door handles, the extra little finishing touches, are all of no significance. For them, things such as fuel economy, safety, load capacity, cost of ownership and such all matter more. But, they are not the norm. For most of us, myself included, other things make a difference. We pick a colour we like, select some optional extras, and generally pick a car which reflects our values. If you want a car which makes a statement about yourself, there are plenty to pick from. If you want a car which carries you in comfort, they too are abundant. So, we take out our wallets, work out what we can afford and decide which car best meets our desires as well as our constraints.
But, why do we do this? In some cases, there are real utilitarian purposes behind things we don't usually view as such. For example, most salespeople have to keep up a certain level of professional image. Their car might be an extension of that image, so picking a car which portrays the right message might be of professional importance to them, to the point that it might make the difference between them winning a deal and not.
For many of us though, there is a different reason. We want to have a higher quality experience. Good enough is just not good enough. It has to go the extra mile and satisfy our desires too. Some people will even take this to an extreme, like those who seemingly dedicate time and money to having something that gives them the best experience they can have.
A car is ostensibly designed for one purpose; it transports you. Some people, myself included, pervert that and for them, the journey is often all that matters. My little sports car is not very good for transport. It is poor at handling wet roads (it aquaplanes on even the least standing water), noisy, uncomfortable, inefficient, not pretty (I'm being delicate here), demanding to drive, has nowhere for luggage, leaks water from the roof, and all in all, it is not a good car. But, sometimes for my purposes, it is more ideal than the vast majority of cars out there. Unlike most cars, the interface between the machine and the driver is not softened. It demands attention when being driven, but with that attention, it rewards with response. Most cars have a very noticeable delay between the time you turn the steering-wheel and the time it takes to fully respond. My little car is incredibly direct. Every little action has a noticeable reaction. In the end, one can be much more at one with the car, and in doing so, one is much more rewarded by the experience. At least, that is what it is like for me. The beauty of it is that as there is little attempt at dampening the experience, for those who want the thrill of speed will get it at speeds that are still very safe.
So, for me, the quality of the experience is greater with my car than with most others, though at times, the cost in terms of comfort and such is too much to bear and I pick to drive a different car. Many others get the same satisfaction out of other items, such as an audiophile listening to her high quality sound-system, or the Internet user interacting with the beautifully designed browser, or the food connoisseur who delights in the fine taste of his wild Atlantic salmon.
Often, as an engineer, it is easy to dismiss technically inferior products, especially when they are more expensive, but in real terms, to do so is often to miss the value that the consumer sees in those products. For instance, Apple iPods are known for not having industry leading sound quality. Actually, they are often rated at average or below. For an item designed for listening to music, you would expect that this is a bad thing. An engineer, with her engineering hat on, would almost certainly dismiss the iPod as being of less value than its industry peers, that are usually cheaper and have greater functionality. So, why is the iPod so successful? There are many factors, but ultimately, it offers greater value to the consumers who buy it. For some, it is the interface, for others, it is the appearance, and for others still, it is the brand. All of these do in some way contribute to the quality of the item, to the experience that the end user has. One thing that I have often found is that the limitations that the iPod imposes are often accepted and dismissed as being the same for all competitors, even when such is not true. Many consumers believe they are buying the best music player, and that anything it can't do, others can't either. This gives a degree of comfort that should not be dismissed.
In the end, we as engineers have to look at the quality of the experience. When we design an interface, being cool is good, being functional is good, but most important of all is the experience and the quality that the user gets from it. If it has pretty animations, that's nice, but as soon as they start to distract and annoy the user, they just take away from the experience. Having extra features is good, but as soon as it becomes difficult for the user to do what they want, or makes them feel ignorant, then things have gone too far. We need to design the interface that allows all end users get what they want, and yet is not so hard for beginners to use that they are turned off.
For those of us who work with computers, there is an added bonus. Quality often is relatively free to implement. Using a walnut veneer to a car dashboard makes it more expensive to make the car. Similarly, high quality audio equipment is more costly to make than cheaper equipment, but with computer interfaces, the cost is at most our time, and with some careful forethought and proper design, that can be kept under control. If one applies proper modular design approaches and makes some smart choices, the interface (the single biggest source of user experienced quality of software) can be detached from the rest of the application and so interface design can take place as an almost separate and parallel process to the actual functional design. We can deliver a quality product without really compromising on functionality and without actually adding to the material cost of the product. Of course, extra time is spent in developing the product, but after that, the actual cost is small and the unit cost is basically the same.
Of course, most of us already know the above, but sometimes, as a software-engineer, it is easy to fail to apply the same principles we do to interface design and compare products on their measurable differences usually coming to the conclusion that consumers usually pick the wrong item, which of course, is to fail to realise that they are making the right decision for them and it is just that we have difficulty measuring that which was important for them in making their decision.
We may never be truly able to measure quality. Lets be honest, we have difficulty in properly defining it. But at the end of the day, it is probably the most important thing. So, rather than make important that which we can measure, why not just remember that often it is that which we can't measure that is truly important. Of course, that doesn't mean that we ditch the use of benchmarks and metrics in general, just that they so rarely tell the full picture, or even half of it at times.
If you've never read the book "Zen and the Art of Motorcycle Maintenance" by Robert M Persig, I would highly recommend it and you might even find that it explains some of my above thoughts a little better than I can
There are many aspects to our lives, most of which have some interface with technology or traditionally functional items. From the man who complains about his partner on a private internet chat forum, to the boy who cycles his bicycle for fun, to the lady switching on a light so she can read. We are surrounded by appliances, things which do a job, or in some cases, many jobs, and which we rely on for modern living. In all cases, these items are there to make our lives somehow better, though sometimes it seems that they are sent from the deepest depths of hell to vex us and leave us in a bad mood.
That interface between humans and the things we use is vitally important. In many cases, we just want it to work and do so with the least amount of fuss, but in some cases, just doing a designated job is not in and of itself enough. Often, we want an experience which makes us feel good. We want a quality experience. A simple example of this is the car. For some, it is a purely utilitarian tool, where the brand, the appearance, the slightly more tactile door handles, the extra little finishing touches, are all of no significance. For them, things such as fuel economy, safety, load capacity, cost of ownership and such all matter more. But, they are not the norm. For most of us, myself included, other things make a difference. We pick a colour we like, select some optional extras, and generally pick a car which reflects our values. If you want a car which makes a statement about yourself, there are plenty to pick from. If you want a car which carries you in comfort, they too are abundant. So, we take out our wallets, work out what we can afford and decide which car best meets our desires as well as our constraints.
But, why do we do this? In some cases, there are real utilitarian purposes behind things we don't usually view as such. For example, most salespeople have to keep up a certain level of professional image. Their car might be an extension of that image, so picking a car which portrays the right message might be of professional importance to them, to the point that it might make the difference between them winning a deal and not.
For many of us though, there is a different reason. We want to have a higher quality experience. Good enough is just not good enough. It has to go the extra mile and satisfy our desires too. Some people will even take this to an extreme, like those who seemingly dedicate time and money to having something that gives them the best experience they can have.
A car is ostensibly designed for one purpose; it transports you. Some people, myself included, pervert that and for them, the journey is often all that matters. My little sports car is not very good for transport. It is poor at handling wet roads (it aquaplanes on even the least standing water), noisy, uncomfortable, inefficient, not pretty (I'm being delicate here), demanding to drive, has nowhere for luggage, leaks water from the roof, and all in all, it is not a good car. But, sometimes for my purposes, it is more ideal than the vast majority of cars out there. Unlike most cars, the interface between the machine and the driver is not softened. It demands attention when being driven, but with that attention, it rewards with response. Most cars have a very noticeable delay between the time you turn the steering-wheel and the time it takes to fully respond. My little car is incredibly direct. Every little action has a noticeable reaction. In the end, one can be much more at one with the car, and in doing so, one is much more rewarded by the experience. At least, that is what it is like for me. The beauty of it is that as there is little attempt at dampening the experience, for those who want the thrill of speed will get it at speeds that are still very safe.
So, for me, the quality of the experience is greater with my car than with most others, though at times, the cost in terms of comfort and such is too much to bear and I pick to drive a different car. Many others get the same satisfaction out of other items, such as an audiophile listening to her high quality sound-system, or the Internet user interacting with the beautifully designed browser, or the food connoisseur who delights in the fine taste of his wild Atlantic salmon.
Often, as an engineer, it is easy to dismiss technically inferior products, especially when they are more expensive, but in real terms, to do so is often to miss the value that the consumer sees in those products. For instance, Apple iPods are known for not having industry leading sound quality. Actually, they are often rated at average or below. For an item designed for listening to music, you would expect that this is a bad thing. An engineer, with her engineering hat on, would almost certainly dismiss the iPod as being of less value than its industry peers, that are usually cheaper and have greater functionality. So, why is the iPod so successful? There are many factors, but ultimately, it offers greater value to the consumers who buy it. For some, it is the interface, for others, it is the appearance, and for others still, it is the brand. All of these do in some way contribute to the quality of the item, to the experience that the end user has. One thing that I have often found is that the limitations that the iPod imposes are often accepted and dismissed as being the same for all competitors, even when such is not true. Many consumers believe they are buying the best music player, and that anything it can't do, others can't either. This gives a degree of comfort that should not be dismissed.
In the end, we as engineers have to look at the quality of the experience. When we design an interface, being cool is good, being functional is good, but most important of all is the experience and the quality that the user gets from it. If it has pretty animations, that's nice, but as soon as they start to distract and annoy the user, they just take away from the experience. Having extra features is good, but as soon as it becomes difficult for the user to do what they want, or makes them feel ignorant, then things have gone too far. We need to design the interface that allows all end users get what they want, and yet is not so hard for beginners to use that they are turned off.
For those of us who work with computers, there is an added bonus. Quality often is relatively free to implement. Using a walnut veneer to a car dashboard makes it more expensive to make the car. Similarly, high quality audio equipment is more costly to make than cheaper equipment, but with computer interfaces, the cost is at most our time, and with some careful forethought and proper design, that can be kept under control. If one applies proper modular design approaches and makes some smart choices, the interface (the single biggest source of user experienced quality of software) can be detached from the rest of the application and so interface design can take place as an almost separate and parallel process to the actual functional design. We can deliver a quality product without really compromising on functionality and without actually adding to the material cost of the product. Of course, extra time is spent in developing the product, but after that, the actual cost is small and the unit cost is basically the same.
Of course, most of us already know the above, but sometimes, as a software-engineer, it is easy to fail to apply the same principles we do to interface design and compare products on their measurable differences usually coming to the conclusion that consumers usually pick the wrong item, which of course, is to fail to realise that they are making the right decision for them and it is just that we have difficulty measuring that which was important for them in making their decision.
We may never be truly able to measure quality. Lets be honest, we have difficulty in properly defining it. But at the end of the day, it is probably the most important thing. So, rather than make important that which we can measure, why not just remember that often it is that which we can't measure that is truly important. Of course, that doesn't mean that we ditch the use of benchmarks and metrics in general, just that they so rarely tell the full picture, or even half of it at times.
If you've never read the book "Zen and the Art of Motorcycle Maintenance" by Robert M Persig, I would highly recommend it and you might even find that it explains some of my above thoughts a little better than I can
Tuesday, November 9, 2010
Zen and the Art of Moving
Some tips in no particular order, about moving from one continent to another that I have learned the hard way (most are common sense, but I'm not common):
1. Trim down your belongings as soon as possible. Acquire only those that you will need between now and the day you move.
2. Anything that you are taking with you that can be easily replaced at your destination should probably not be coming with you in the first place.
3. Make a list of the things that you want rid of and offer it around your friends. It gives you a good excuse to meet them and won't hurt your friendship at all.
4. Books are heavy. Boxes of books are usually very difficult to move. Often cardboard boxes will not be strong enough, and your back will never thank you for finding this out. Spreading your books among your other, less dense items will usually help.
5. Computers often have a switch so they can take either a 110V or 220V input. Don't assume yours has this switch.
6. A great way to avoid replacing lots of electrical plugs is to take a power strip and replace the plug on its cord. Just make sure that all devices attached can handle the local power supply. Most electronics that I have bought in the last 5 years will work just fine.
7. Don't assume that you'll be allowed to bring your car. Canadian law is quite strict (and seriously dumb, if you ask me) and there is a good chance that your car will not be allowed. I could rant about this for hours, but all I'll say is that Canada is not a particularly safe country to drive in and has very restrictive laws about cars. Maybe they are focusing on the wrong things.
8. Make sure to have all and any medications that you are likely to need and the associated prescription to show if anyone inquires about them. Don't assume that the medications that you are used to getting over the counter or by prescription will be available at all at your destination. Countries differ hugely and if you are unlucky, the one drug you've found that actually works well for you will almost certainly be unavailable wherever you move to.
9. Credit cards can be very useful if you get into a tight spot, but a little cash can really help.
10. If you can help it, never use a credit card to make a phone call in another country. Actually, this didn't happen to me, but did to my fiancée once when she came to Ireland.
11. Keep a detailed inventory of everything you are taking and which box it is in. If it's not worth writing down the description of the item, it is almost certainly not worth taking.
12. Lots of things that are part of your life will change; food, the music on the radio and the programs on the TV. It's not that where you are going to will be better or worse, just different. You can accept it or try to bring it with you. The latter is made all the more possible with the internet, but for your own sanity, try to find the good in the new things. Though I would also keep the ties with home. A little extra variety is probably a good thing.
13. Expect to be asked if you know so-and-so from wherever you lived. Everyone assumes that just because they live within a 10 mile radius of wherever you came from, that you will definitely know them. As an Irishman, it is expected that I know at least 90% of adult Irish males. Canadians seem to get the same from others too. As an Irishman, I will have absolutely no problem with stringing along those who ask me such questions. Of course, I won't take it too far and I'll let them know, within a year or so.
14. Get things like a driving record, letter to state that you are in good standing with your bank, and anything else that you might find useful when you arrive. Opening a bank account is likely to be a little easier with such a letter and getting a driving license can be a real pain if you don't have details about your driving history. Canada has a graduated driving license (which I think is a good thing), which takes years to go through (which I'm not so keen about) if you don't already have a license for a few years and proof of this is essential.
15. The chances are that lots of others have gone through the exact same move that you are doing, check out the online forums. Most people are quite happy to share their experiences as if nothing else, it usually allows them to vent ;)
I'm a hoarder. I collect quite an amount of stuff, including DVDs, books, computer parts, car parts, and much much more. So, when it comes to moving, I am the world's worst for doing so. I have gathered so much that it is a pain to trim off all the excess and whittle it down to the stuff I need.
It wouldn't be a problem if I had only to move to somewhere else in Ireland, or even to another European city. I could always borrow a big car, or hire a van and move all the stuff I need. Actually, no that wouldn't work, but it would still be easy to ship all the things I want to keep. Even my little car.
Instead, I'm moving about 7,000km from the fairly busy city of Dublin in Ireland to a relatively quiet city in Northern British Columbia in Canada. The cost of shipping is a pain, but almost as difficult as that is the actual organising of it. It seems that many companies are content in ignoring requests for a quotation and those that do provide them are slow to do so. Oh, and I think that shipping 800kg of items (which includes my little car) should not cost in excess of €4000. The daft thing is that when I take the car out of the mix, the total remains pretty similar.
Okay, enough whinging. At least the Canadian system is quite good. I'll be allowed to bring my stuff in whenever I want. All I have to do is give them a list of everything I intend to bring and they'll tick it off the list when I get around to bringing it over. This means that I can put off taking over most of my belongings until a time that suits me (in other words, not during the Winter).
Thankfully my family are quite happy to look after my stuff in Ireland for a few months at least.
But, a little more about why I am moving. A few years ago I met this wonderful woman called Dyani. She lived with her two boys in Northern BC and was studying at the time. Well, I have to say that we quickly fell for each other and with time, decided to get married. That was two years ago. Since then I have been trying to complete some studies of my own and make some preparations for moving to Canada. There were ups and downs. Actually, mostly ups. The Canadian government's rules about immigration were threatening to spoil the party for a while, but that's now pretty much behind us with only a few significant hurdles left and none we are at all worried about and I will soon (less than 1 month) be moving over to live with her and our boys.
Okay, there are lots of things I could say about the process, some of which I will when I am fully finalised with it. But for now, I believe that discretion is the better part of valour.
I am truly looking forward to my life in Canada, to braving the bitterly cold winters (I'm used to -5 as the coldest I experience every year, but where I'm moving to, -20 is very common) and the scorchingly hot summers (in Ireland, the mid to high 20s are about the hottest it ever gets, where I'm going, 30 is common). It is a beautiful place, with lovely people and most importantly of all, Dyani is there and that's enough reason for me.
Good luck,
Neil
1. Trim down your belongings as soon as possible. Acquire only those that you will need between now and the day you move.
2. Anything that you are taking with you that can be easily replaced at your destination should probably not be coming with you in the first place.
3. Make a list of the things that you want rid of and offer it around your friends. It gives you a good excuse to meet them and won't hurt your friendship at all.
4. Books are heavy. Boxes of books are usually very difficult to move. Often cardboard boxes will not be strong enough, and your back will never thank you for finding this out. Spreading your books among your other, less dense items will usually help.
5. Computers often have a switch so they can take either a 110V or 220V input. Don't assume yours has this switch.
6. A great way to avoid replacing lots of electrical plugs is to take a power strip and replace the plug on its cord. Just make sure that all devices attached can handle the local power supply. Most electronics that I have bought in the last 5 years will work just fine.
7. Don't assume that you'll be allowed to bring your car. Canadian law is quite strict (and seriously dumb, if you ask me) and there is a good chance that your car will not be allowed. I could rant about this for hours, but all I'll say is that Canada is not a particularly safe country to drive in and has very restrictive laws about cars. Maybe they are focusing on the wrong things.
8. Make sure to have all and any medications that you are likely to need and the associated prescription to show if anyone inquires about them. Don't assume that the medications that you are used to getting over the counter or by prescription will be available at all at your destination. Countries differ hugely and if you are unlucky, the one drug you've found that actually works well for you will almost certainly be unavailable wherever you move to.
9. Credit cards can be very useful if you get into a tight spot, but a little cash can really help.
10. If you can help it, never use a credit card to make a phone call in another country. Actually, this didn't happen to me, but did to my fiancée once when she came to Ireland.
11. Keep a detailed inventory of everything you are taking and which box it is in. If it's not worth writing down the description of the item, it is almost certainly not worth taking.
12. Lots of things that are part of your life will change; food, the music on the radio and the programs on the TV. It's not that where you are going to will be better or worse, just different. You can accept it or try to bring it with you. The latter is made all the more possible with the internet, but for your own sanity, try to find the good in the new things. Though I would also keep the ties with home. A little extra variety is probably a good thing.
13. Expect to be asked if you know so-and-so from wherever you lived. Everyone assumes that just because they live within a 10 mile radius of wherever you came from, that you will definitely know them. As an Irishman, it is expected that I know at least 90% of adult Irish males. Canadians seem to get the same from others too. As an Irishman, I will have absolutely no problem with stringing along those who ask me such questions. Of course, I won't take it too far and I'll let them know, within a year or so.
14. Get things like a driving record, letter to state that you are in good standing with your bank, and anything else that you might find useful when you arrive. Opening a bank account is likely to be a little easier with such a letter and getting a driving license can be a real pain if you don't have details about your driving history. Canada has a graduated driving license (which I think is a good thing), which takes years to go through (which I'm not so keen about) if you don't already have a license for a few years and proof of this is essential.
15. The chances are that lots of others have gone through the exact same move that you are doing, check out the online forums. Most people are quite happy to share their experiences as if nothing else, it usually allows them to vent ;)
I'm a hoarder. I collect quite an amount of stuff, including DVDs, books, computer parts, car parts, and much much more. So, when it comes to moving, I am the world's worst for doing so. I have gathered so much that it is a pain to trim off all the excess and whittle it down to the stuff I need.
It wouldn't be a problem if I had only to move to somewhere else in Ireland, or even to another European city. I could always borrow a big car, or hire a van and move all the stuff I need. Actually, no that wouldn't work, but it would still be easy to ship all the things I want to keep. Even my little car.
Instead, I'm moving about 7,000km from the fairly busy city of Dublin in Ireland to a relatively quiet city in Northern British Columbia in Canada. The cost of shipping is a pain, but almost as difficult as that is the actual organising of it. It seems that many companies are content in ignoring requests for a quotation and those that do provide them are slow to do so. Oh, and I think that shipping 800kg of items (which includes my little car) should not cost in excess of €4000. The daft thing is that when I take the car out of the mix, the total remains pretty similar.
Okay, enough whinging. At least the Canadian system is quite good. I'll be allowed to bring my stuff in whenever I want. All I have to do is give them a list of everything I intend to bring and they'll tick it off the list when I get around to bringing it over. This means that I can put off taking over most of my belongings until a time that suits me (in other words, not during the Winter).
Thankfully my family are quite happy to look after my stuff in Ireland for a few months at least.
But, a little more about why I am moving. A few years ago I met this wonderful woman called Dyani. She lived with her two boys in Northern BC and was studying at the time. Well, I have to say that we quickly fell for each other and with time, decided to get married. That was two years ago. Since then I have been trying to complete some studies of my own and make some preparations for moving to Canada. There were ups and downs. Actually, mostly ups. The Canadian government's rules about immigration were threatening to spoil the party for a while, but that's now pretty much behind us with only a few significant hurdles left and none we are at all worried about and I will soon (less than 1 month) be moving over to live with her and our boys.
Okay, there are lots of things I could say about the process, some of which I will when I am fully finalised with it. But for now, I believe that discretion is the better part of valour.
I am truly looking forward to my life in Canada, to braving the bitterly cold winters (I'm used to -5 as the coldest I experience every year, but where I'm moving to, -20 is very common) and the scorchingly hot summers (in Ireland, the mid to high 20s are about the hottest it ever gets, where I'm going, 30 is common). It is a beautiful place, with lovely people and most importantly of all, Dyani is there and that's enough reason for me.
Good luck,
Neil
Thursday, November 4, 2010
Programming and Reprogramming the Mind
As a programmer, I was brought up on a diet of BASIC, Pascal, C and a little LOGO. Okay, BASIC was a simple, if not very good language, but it was a start. Pascal was a big improvement and I learned more in one Summer of programming Pascal than in the previous 5 years of BASIC, but it really is a very similar way of programming. C, while different, was much the same in reality. They are all imperative programming languages and as such you use the same mindset to program in any of them.
For those who already know what an imperative programming language is, you can skip this paragraph. For the rest of you who want to know what this means, I shall try to explain what imperative programming languages are. Firstly, one has to realise that a computer is what is sometimes referred to as a finite-state machine. This means that at any time, a computer has to be in one of a number (potentially huge number) of finite states. An imperative programming language will define a set of instructions that the computer is to perform and in which order, basically going from one state to another. In natural language, we are used to these kinds of instructions. Most instruction manuals use this kind of approach. A simple example for doing the weekly shopping is this:
1. Get out pen
2. Get out paper
3. Write shopping list
4. Go to shop
5. Gather items on shopping list and place in basket
6. Bring items to cashier
7. Pay cashier for items
8. Bring items home
It's all fairly easy to understand and it's a way that many coders use to think about programming. But, it's not the only way.
Now, some might think I'm going to move on to discussing Object Oriented Programming, and they're right. The next step for me was to learn OOP as I learned C++, Java and later on, C#. Strangely enough, I really didn't see much of a change. Yes, these languages allowed me to do some things I longed to do, and do so in much easier ways than I had with C or Pascal, but on the whole, there wasn't a real shift in thinking. For one, I, like most procedural language programmers, had already discovered and implemented some of the more useful aspects of OOP and done so through my own coding style. For instance, for a long time before learning OOP, I had generally written functions to handle any data-structures I defined. This made it much easier to handle code complexity, modify the way the structure behaved and find and fix bugs. It's generally similar to the idea of having classes that keep all data private and only using methods for data manipulation. Of course, all competent programmers recognise the benefits of using this approach and most apply it, even those who prefer to not use OOP.
Of course, this is hardly the only benefit of OOP. In fact, by virtue of the fact that I was applying this approach long before I was introduced to OOP, one might even say that it is not a benefit of OOP, but of sane coding practice in any imperative programming language. The reason that OOP didn't really require any mindset shift is quite simple. It's still imperative programming. I was still writing in much the same way as I had before, just using different syntax and some very handy short-cuts (such as inheritance and polymorphism).
For those who have stayed with me, but required the paragraph describing what an imperative language is, with OOP, I was still using the same type of list, but now I could get away with a few less steps in the list and a slightly differently expressed list. Especially so when I was using a much longer one. One might say that rather than having to write code to handle the concept of a bag and a shopping basket, I could just write a generic piece of code for a device which held items and just specialised it a little for each. Effectively, it reduced the level of redundant code.
The type of programming which has forced me to rethink things is that of Functional Programming (FP). For a long time, I have dabbled on and off in FP. I never really wrote too much, always just little programs to satisfy my curiosity. I found the beauty of LISP to be inescapable. It provided a different way of thinking about things. But, I never really embraced it as I should. I guess I lacked the motivation and necessity. Now, I am not saying that I have suddenly found either, but I have found a couple of interesting essays on the topic and I am going to have to give LISP a lot more thought.
But, I get ahead of myself. Again, I should explain to the more determined of you what FP is. A lot of the difference dates back to the 1930s. When mathematicians were theorising how computational machines would work, they developed a few different approaches and one is that of FP. It's not like imperative programming. One does not treat the computer as a state machine, but rather as a single function which takes other functions as arguments, and so on and so forth. I'm going to steer clear of the mathematics involved as they're not exactly trivial, but this approach has some very interesting results.
But, I hear you cry (and before I go further), I don't just want to be able to deal with numbers, I want to deal with words and things like that. Of course you do, and so do we all, but all such stuff is treated as numbers by a computer. And all ways that the computer can manipulate these numbers can be expressed in mathematical terms (because that's what they are).
FP does have some interesting effects. One can manipulate the functions in ways which are just not easy or possible with programs written in imperative programming languages. You see, in an imperative programming language, there is a defined order to the instructions. They depend on being in order, otherwise you get the wrong results. Lots of effort is put into finding the parts of programs which don't interfere with each other, so they can be run side-by-side to use multiple CPUs. I have a friend who makes a very comfortable living taking other peoples' programs and doing just that. It's a task which is very difficult to automate, and even the best automated efforts today often give only a fraction of the improvement that my friend can very easily get.
In FP, we can actually do a whole lot of rearranging of stuff because we have made sure that the intermediate states don't matter at all. We can break up the function into it's parts and run them in any order we want. A simple example in mathematics is where we add all the numbers from 1 to 4:
1+2+3+4=
3+3+4=
6+4=
10
Of course, we could also have done the following:
1+2+3+4=
3+3+4=
3+7=
10
This is a trivial example. But, now instead of doing things one step at a time, imagine we could do two:
1+2+3+4=
3+7=
10
Okay, in this simple example, it only saved us a tiny amount of time, but with much more complicated systems, we can get much bigger savings and do so without any extra effort from the programmer.
There are many other benefits of FP, such as being able to delay evaluating functions until we are certain that we will have to do so, or being able to debug functions much more easily.
Unfortunately, the natural code that a modern computer uses is, in all cases I am aware of, an imperative programming language. This means that FP code will effectively have to be translated into imperative programming code, which, thankfully, has been possible. In fact, it has been proven that anything that can be done through a FP language can also be done using an imperative programming language (and vice-versa).
Now, the smarter of you will see one very obvious result of this and that is that if one can write FP code through imperative programming code, why would you bother with the former at all? And how can the benefits that I talk about actually exist at all? This is an interesting logic conundrum. I'll see if I can explain that too. You see, when we write code, we are not writing the code that the computer will run, we are writing something which will be interpreted and then run by the computer. This can be interpreted by a compiler (a program which turns programming language into a native code program) or by an interpreter (a program which turns the code into native code as it is being executed). We will assume that we are using an interpreter, but the result is the same. At this stage, a lot can be done with the code. The interpreter is able to take short-cuts, if they are available to be taken. Unfortunately, the interpreter can only do so much and even good ones will not be able to reorganise imperative programming instructions beyond a very limited amount. You see, it is very difficult to be certain that the state of the machine as influenced by one instruction will not be important to another. The FP interpreter can do much more and with greater ease. It can decide to delay interpreting a function until it has to, or decide to interpret two functions side-by-side, and so on.
But, surely this means that FP is exceptionally suitable for very fast programs, especially where one has multiple CPUs. Unfortunately, not for the moment. As said before, modern computers are not built with FP in mind, not only that, but the fact is that there is lots of work for the interpreter to do and often the benefits come with a high cost in terms of memory and CPU time.
So, why is functional programming so interesting to me and why now?I guess, I've always found what little LISP I have coded to be quite rewarding and at the same time, the required shift in mindset has never been one I've fully embraced. One big reason is that some of the benefits of functional programming are quite amazing and possibly more important now than ever before. But, the biggest reasons are that I suspect that in the future we will move to FP for performance reasons. Not just the performance of executing the code, but the performance in developing the code. As a programmer, I spend so much of my time trying to keep complexity under control. A well written piece of code will be relatively easy to understand and avoid unnecessary complexity. This complexity is the cause of most of the bugs I find in both my own code and that of others. It causes people to make coding mistakes both in terms of logic errors and typos and it makes debugging much more difficult. For relatively simple code, one will spend almost the same amount of time coding as debugging. For complicated code, one will spend far longer debugging. Some code has taken me about 100 times as long to debug as write, and that's with a huge amount of effort to make the code as easy to debug as possible and keep complexity to a minimum.
The single greatest benefit of FP is that the complexity is kept in control in a much more efficient way. While OOP keeps some of the complexity at bay, it fails to address the single biggest source for all of us, the source that makes debugging a hard task and that is the curse of the side-effect. You know, the things that functions do that go beyond the scope of just that function, such as changing the contents of a variable passed in by reference. Well, those things and the fact that imperative programming languages need them and rely on them, also means that we can trample memory, corrupt data structures and so on. These are things that many languages try to avoid, but which all imperative programming languages suffer from and which they actually require. FP needs to do nothing to keep such side-effects under control because they simply can't happen. An FP function is self-contained. Nothing it does will interfere with any other function, except to return its return value. This is why any FP functions can be run side-by-side and why they are both easy to debug and much less likely to result in hard bugs. It's a beautiful model and one I must learn to embrace.
Anyway, I've waffled on for long enough. If you are a coder and you want to see a different way, please look into learning a functional programming language, such as LISP or Scheme (actually, the latter is probably a better starting point).
I leave you with a comic from XKCD:
For those who already know what an imperative programming language is, you can skip this paragraph. For the rest of you who want to know what this means, I shall try to explain what imperative programming languages are. Firstly, one has to realise that a computer is what is sometimes referred to as a finite-state machine. This means that at any time, a computer has to be in one of a number (potentially huge number) of finite states. An imperative programming language will define a set of instructions that the computer is to perform and in which order, basically going from one state to another. In natural language, we are used to these kinds of instructions. Most instruction manuals use this kind of approach. A simple example for doing the weekly shopping is this:
1. Get out pen
2. Get out paper
3. Write shopping list
4. Go to shop
5. Gather items on shopping list and place in basket
6. Bring items to cashier
7. Pay cashier for items
8. Bring items home
It's all fairly easy to understand and it's a way that many coders use to think about programming. But, it's not the only way.
Now, some might think I'm going to move on to discussing Object Oriented Programming, and they're right. The next step for me was to learn OOP as I learned C++, Java and later on, C#. Strangely enough, I really didn't see much of a change. Yes, these languages allowed me to do some things I longed to do, and do so in much easier ways than I had with C or Pascal, but on the whole, there wasn't a real shift in thinking. For one, I, like most procedural language programmers, had already discovered and implemented some of the more useful aspects of OOP and done so through my own coding style. For instance, for a long time before learning OOP, I had generally written functions to handle any data-structures I defined. This made it much easier to handle code complexity, modify the way the structure behaved and find and fix bugs. It's generally similar to the idea of having classes that keep all data private and only using methods for data manipulation. Of course, all competent programmers recognise the benefits of using this approach and most apply it, even those who prefer to not use OOP.
Of course, this is hardly the only benefit of OOP. In fact, by virtue of the fact that I was applying this approach long before I was introduced to OOP, one might even say that it is not a benefit of OOP, but of sane coding practice in any imperative programming language. The reason that OOP didn't really require any mindset shift is quite simple. It's still imperative programming. I was still writing in much the same way as I had before, just using different syntax and some very handy short-cuts (such as inheritance and polymorphism).
For those who have stayed with me, but required the paragraph describing what an imperative language is, with OOP, I was still using the same type of list, but now I could get away with a few less steps in the list and a slightly differently expressed list. Especially so when I was using a much longer one. One might say that rather than having to write code to handle the concept of a bag and a shopping basket, I could just write a generic piece of code for a device which held items and just specialised it a little for each. Effectively, it reduced the level of redundant code.
The type of programming which has forced me to rethink things is that of Functional Programming (FP). For a long time, I have dabbled on and off in FP. I never really wrote too much, always just little programs to satisfy my curiosity. I found the beauty of LISP to be inescapable. It provided a different way of thinking about things. But, I never really embraced it as I should. I guess I lacked the motivation and necessity. Now, I am not saying that I have suddenly found either, but I have found a couple of interesting essays on the topic and I am going to have to give LISP a lot more thought.
But, I get ahead of myself. Again, I should explain to the more determined of you what FP is. A lot of the difference dates back to the 1930s. When mathematicians were theorising how computational machines would work, they developed a few different approaches and one is that of FP. It's not like imperative programming. One does not treat the computer as a state machine, but rather as a single function which takes other functions as arguments, and so on and so forth. I'm going to steer clear of the mathematics involved as they're not exactly trivial, but this approach has some very interesting results.
But, I hear you cry (and before I go further), I don't just want to be able to deal with numbers, I want to deal with words and things like that. Of course you do, and so do we all, but all such stuff is treated as numbers by a computer. And all ways that the computer can manipulate these numbers can be expressed in mathematical terms (because that's what they are).
FP does have some interesting effects. One can manipulate the functions in ways which are just not easy or possible with programs written in imperative programming languages. You see, in an imperative programming language, there is a defined order to the instructions. They depend on being in order, otherwise you get the wrong results. Lots of effort is put into finding the parts of programs which don't interfere with each other, so they can be run side-by-side to use multiple CPUs. I have a friend who makes a very comfortable living taking other peoples' programs and doing just that. It's a task which is very difficult to automate, and even the best automated efforts today often give only a fraction of the improvement that my friend can very easily get.
In FP, we can actually do a whole lot of rearranging of stuff because we have made sure that the intermediate states don't matter at all. We can break up the function into it's parts and run them in any order we want. A simple example in mathematics is where we add all the numbers from 1 to 4:
1+2+3+4=
3+3+4=
6+4=
10
Of course, we could also have done the following:
1+2+3+4=
3+3+4=
3+7=
10
This is a trivial example. But, now instead of doing things one step at a time, imagine we could do two:
1+2+3+4=
3+7=
10
Okay, in this simple example, it only saved us a tiny amount of time, but with much more complicated systems, we can get much bigger savings and do so without any extra effort from the programmer.
There are many other benefits of FP, such as being able to delay evaluating functions until we are certain that we will have to do so, or being able to debug functions much more easily.
Unfortunately, the natural code that a modern computer uses is, in all cases I am aware of, an imperative programming language. This means that FP code will effectively have to be translated into imperative programming code, which, thankfully, has been possible. In fact, it has been proven that anything that can be done through a FP language can also be done using an imperative programming language (and vice-versa).
Now, the smarter of you will see one very obvious result of this and that is that if one can write FP code through imperative programming code, why would you bother with the former at all? And how can the benefits that I talk about actually exist at all? This is an interesting logic conundrum. I'll see if I can explain that too. You see, when we write code, we are not writing the code that the computer will run, we are writing something which will be interpreted and then run by the computer. This can be interpreted by a compiler (a program which turns programming language into a native code program) or by an interpreter (a program which turns the code into native code as it is being executed). We will assume that we are using an interpreter, but the result is the same. At this stage, a lot can be done with the code. The interpreter is able to take short-cuts, if they are available to be taken. Unfortunately, the interpreter can only do so much and even good ones will not be able to reorganise imperative programming instructions beyond a very limited amount. You see, it is very difficult to be certain that the state of the machine as influenced by one instruction will not be important to another. The FP interpreter can do much more and with greater ease. It can decide to delay interpreting a function until it has to, or decide to interpret two functions side-by-side, and so on.
But, surely this means that FP is exceptionally suitable for very fast programs, especially where one has multiple CPUs. Unfortunately, not for the moment. As said before, modern computers are not built with FP in mind, not only that, but the fact is that there is lots of work for the interpreter to do and often the benefits come with a high cost in terms of memory and CPU time.
So, why is functional programming so interesting to me and why now?I guess, I've always found what little LISP I have coded to be quite rewarding and at the same time, the required shift in mindset has never been one I've fully embraced. One big reason is that some of the benefits of functional programming are quite amazing and possibly more important now than ever before. But, the biggest reasons are that I suspect that in the future we will move to FP for performance reasons. Not just the performance of executing the code, but the performance in developing the code. As a programmer, I spend so much of my time trying to keep complexity under control. A well written piece of code will be relatively easy to understand and avoid unnecessary complexity. This complexity is the cause of most of the bugs I find in both my own code and that of others. It causes people to make coding mistakes both in terms of logic errors and typos and it makes debugging much more difficult. For relatively simple code, one will spend almost the same amount of time coding as debugging. For complicated code, one will spend far longer debugging. Some code has taken me about 100 times as long to debug as write, and that's with a huge amount of effort to make the code as easy to debug as possible and keep complexity to a minimum.
The single greatest benefit of FP is that the complexity is kept in control in a much more efficient way. While OOP keeps some of the complexity at bay, it fails to address the single biggest source for all of us, the source that makes debugging a hard task and that is the curse of the side-effect. You know, the things that functions do that go beyond the scope of just that function, such as changing the contents of a variable passed in by reference. Well, those things and the fact that imperative programming languages need them and rely on them, also means that we can trample memory, corrupt data structures and so on. These are things that many languages try to avoid, but which all imperative programming languages suffer from and which they actually require. FP needs to do nothing to keep such side-effects under control because they simply can't happen. An FP function is self-contained. Nothing it does will interfere with any other function, except to return its return value. This is why any FP functions can be run side-by-side and why they are both easy to debug and much less likely to result in hard bugs. It's a beautiful model and one I must learn to embrace.
Anyway, I've waffled on for long enough. If you are a coder and you want to see a different way, please look into learning a functional programming language, such as LISP or Scheme (actually, the latter is probably a better starting point).
I leave you with a comic from XKCD:
Tuesday, November 2, 2010
Another Day
My weekend went very well. I got my chance to say goodbye to some family, but most importantly of all, I got to spend some good times with them too.
Saying a final goodbye to Lucie (our family dog, who died last year) was both tough and uplifting. We shared stories about her, about the good times, about her strengths and her weaknesses and in the end, I came away knowing a little more about my friend and with a place to remember her by. She was a good dog, and a great companion and we will miss her.
Getting to have one last wander around my grandparent's home was nice too. As a child, me and my siblings spent quite some time there. It was a wonderful retreat, a place to roam and run around. The nearby woods were a wonderful alternative playground for us kids, who spent the rest of our time in suburban Dublin.
There is so much I could talk about, some of it sad, some happy, but if you don't mind, for now I will keep these memories to myself.
All in all, it was a good weekend.
Saying a final goodbye to Lucie (our family dog, who died last year) was both tough and uplifting. We shared stories about her, about the good times, about her strengths and her weaknesses and in the end, I came away knowing a little more about my friend and with a place to remember her by. She was a good dog, and a great companion and we will miss her.
Getting to have one last wander around my grandparent's home was nice too. As a child, me and my siblings spent quite some time there. It was a wonderful retreat, a place to roam and run around. The nearby woods were a wonderful alternative playground for us kids, who spent the rest of our time in suburban Dublin.
There is so much I could talk about, some of it sad, some happy, but if you don't mind, for now I will keep these memories to myself.
All in all, it was a good weekend.
Subscribe to:
Posts (Atom)
