Aug 28
Aesthetic objection against error handling
This is from a reply I wrote to: I am an Exception Extremist
I understand very well what your objection to all this is. It is not beautiful. And programs should be beautiful. Having to handle the errors makes the program less readable, less clear and therefore makes it look like a beautiful novel that has all these pencil markings between the lines speaking of things that can go wrong that have nothing to do w/the actual storyline.
In a perfect world disk space would be infinite and network access always there. Hosts would never go down and malloc would never return null. Sadly, this is something that will be the assumptions made in a university course book rather than in this oh-so-imperfect reality which we inhabit.
In a way needing to handle errors is an offense against perfection and this is what we dislike. We came up w/the concept of god to express that which is perfect and this perfection we love. We would like our creation to resemble this god as closely as we can ever make it.
In this ugly world we ache to create something beautiful and perfect and in our effort to do that through programming we’re being torn down by the very reality we wish so desperately to escape.
Sounds like a Greek tragedy. :-)
In any case, every time I see really beautiful engineering I am deeply moved. I really loved the bridge in France that the Romans built that stood there unmaintained for a thousand years.
Aug 2
Best PDF you ever read about Productivity
After more than a decade of SW development, engineering, systems administering, production support and all around hacking, I have to say that this is the document that summarises everything I intuitively feel to be the case regarding productivity.
Simply put: Less really is much, much more.
Ref:
No commentsJun 13
Scientist debate Nuclear vs. Renewable
I used to think that nuclear power is something that we need to stop climate change. Lately, I’ve grown skeptical towards this idea. Looking at it in a bit more detail it begins to look like it’s not as good as we’re being led to believe and it’s also worse than I thought.
One good reason to go against nuclear is that it drains the capital we need for creating better and better ways of harnessing renewable energies. This is the argument that originally made me rethink this issue.
This TED debate made 10% of the audience to go from for nuclear to against it. Do you dare to take the chance of changing your mind? It’s free for all to watch.
No commentsJun 13
What we forgot about moral debates
When you look around enough, you sometimes come across real grains of gold. I think that most of us nowadays think that there is little to be said about moral issues. So did I. What this shows is that how poorly we’re educated regarding debate and especially - the fundamentals of philosophy. We believe that the moral debates are something we should stay away from to be able to get along w/one another.
After watching Michael Sandel’s TED-talk , I changed my mind. This is such basic stuff about Aristotle that we all might want to be a bit ashamed that most of us don’t know this. Whomever you’d like to put at fault for our ignorance, please take a look at the talk. It may make you see the whole issue of morality in a completely new light.
No commentsJun 2
What really motivates us
The surprising truth about what motivates us is in the root of the Agile movement.
- Adequate pay
- Autonomy
- Mastery
- Purpose
Got more time? Watch Drive by Dan Pink.
No commentsMay 30
Fundamental patterns: Psychological distance
If you ever think that `how could people that?’, it’s probably because of psychological distance.
Psychological distance is a concept for how close a person feels to another person or an event in relation to them. Your loved ones are close to you psychologically and some far removed events and people in most cases are a lot further.
This concept is very important because of its military applications and I will talk about them now. However, this is just the prelude of what I actually want to say.
Consider a battle field in the middle ages. It’s all hand-to-hand combat, people looking into eyes of their victims, hearing their screams, seeing their breath in the cold air and smelling their blood. It is a gruesome scenario of bodyparts and murder. Despite all the romanticism, most people quite quickly understand that taking the life of another person while looking into their eyes and acknowledging them to be wholly and truly human is not something that is easy for a normal person to do.
In case you’re a fan of sword-fighting movies, you just might miss my point. To make it more vivid, consider and visualize actually choking someone to death. How would it look? How would it feel to see the other person gasp for air and try to frantically get you to stop killing them? Can you see the sheer horror, panic and hatred in their eyes? The point is - you almost certainly wouldn’t be up to it. Few people are and that’s just as well - they shouldn’t. None of us should.
Now consider another scenario. Dropping bombs. Isn’t it a lot easier to just a press a button in an airplane that’s kilometers away from the destruction?
That’s your crash course into what psychological distance is in the military context. The further away you are from your victims, the easier it is to kill them.
Why?
Because the more psychological distance there is the less human your object becomes. This is called dehumanisation.
We almost got the ugly basics in place, but let’s look at one more thing: the dissolution of responsibility. You see, in the field of battle the lowly soldier murders. But it is the officers and generals who lay out the strategies of death and the politicians who start the wars. The hands of these leaders are never covered in the blood of the people they set out to murder. It is very easy to give commands of genocide from an ivory tower, because the psychological distance to the reality of mass-murder is so great. The lowly soldier cannot help but obey, he will be shot by his own, if he doesn’t. Additionally and importantly, the responsibility for his actions are removed from him. While it is he who murders, it is not his choice and in that sense he really is not quite that responsible for his ungodly actions.
So you see, the military has made a science from the taking of life. It is a carefully crafted organisation that is effective in taking life because of the psychology of the humans involved.
Now, that was way too long for a prelude, but couldn’t be helped. I still left many things unsaid, but we must press on now that we have the basics down.
Consider any organisation. Maybe it’s a political party or a company. Maybe it’s a government, or a post office. Consider how these organisations are being constructed. They’re hierarchial. Unless a specific effort is made, psychological distance is built into the structure. The lowly workers follow their orders w/o feeling too responsible for the outcome of their actions while the higher-ups are well removed from the realities of the daily struggles of their subordinates.
Now, considering what was discussed above, it should be clear to the reader that the hierarchial structure has serious psychological and social consequences. It is a structure that is good for creating a work force that doesn’t take responsibility for their actions as well as managers who have little knowledge or psychological commitment to their staff. It should be obvious that this is mostly not good.
In addition, we’re not really built for this kind of structure. We’re tribal animals and it’s in our blood to pull together in small groups where we personally know each other and care about one another. When we know each other, we can leverage the strenghts we lack from those around us. When we care about one another, we’re more willing to commit and we feel and act way more responsibly.
It’s an interesting subject and many software agilists might want to think about it more. However, we have to move on again.
Now consider global warming. It’s the same thing all over again, isn’t it? It is very easy to toss your hands into the air and think that it’s all for our leaders to do. We feel the distance from the consequences in time and it’s all too easy to belittle the size of the consequences of our own actions.
From psychological distance grows the tragedy of the commons . None of us are willing to act responsibly, because the responsibility is distant or shared. I think this also explains in part how the subprime crisis came about and how it was possible for the few to take so much from the rest and make us all pay for their actions.
I leave further examples as an exercise for the reader. W/the above, I’m content and will call psychological distance a fundamental pattern.
More Fundamental patterns:
You might also be interested in the Milgram experiment and Killology.
No commentsMay 4
Finnish wind turbine stock available for you and non-profit orgs!
This is very good news, indeed, from the Green front!
Sumituuli Oy is building a new 2 MW wind turbine using a new promising steel tower structure by Rautaruukki Oyj. The effort is supported by the Finnish Ministry of Employment and the Economy for 743 000 Euros and there’s stock available! The stock gives you the right to receive clean electricity whose production you yourself own!
Last time I looked into this kind of thing there was no stock available. Now, the stock is only available for private persons and non-profit organisations. It is for an honest, good cause. No corruption, no games, no lobbying. No bombing a third world country to stone age, just green power, or even: Green Just Power!
I think this is quite remarkable in many ways. First of all, you can get really green electricity knowing that this company isn’t there to profit from the sales of any other less clean types of energy. Secondly, you get to concretely take part in changing the way our electricity is being produced. Thirdly, you can take part in buying back the power production systems that our country sold away like a thief in the night, and as an added bonus you will have something to say for yourself when the next generation asks you about what you were thinking back then when you still had the chance to do something to save our environment. And it’s Finnish! I don’t really know what more you could ask for. It’s just so all there.
I am looking into investing into this when I’m back to my daily routines in June. So join the effort! This might be the best thing you ever do! And it’s right here, it’s not like the electric car that is right there for you next year - every year.
Details follow in Finnish:
Osakeanti
Osakeanti, jossa mahdollisuus merkitä:
- B -sarjan osake á 1000 €
- C -sarjan osake á 200 €
Osakeannilla katetaan 2 MW:n tuulivoimalan rakentamista varten tarvittava pääoma.
Antiin toivotaan osallistuvan erityisesti luonnollisia henkilöitä ja yleishyödyllisiä yhteisöjä. Tavoitteena pitää yhtiö edellä mainittujen tahojen omistuksessa ja hallinnassa.
Kotisivu
http://www.sumituuli.fi/
Sumituuli Oy:lle 743 000 euroa Ajoksen tuulivoimalaa varten (31.8.2009)
http://www.tem.fi/index.phtml?98603_m=96414&s=3804
Osakkeet:
http://www.sumituuli.fi/osakemerkinta.htm
FAQ:
http://www.sumituuli.fi/kysymyksia.htm
Sumituulen hanke myötätuulessa (05.01.2010)
http://www.taustavoimaa.fi/ekosahko/ajankohtaista/Arkisto/100105-Sumituulen-hanke-myotatuulessa.htm
May 3
My environmental retrospective
It’s been a while since I wrote anything about how we can take care of our planet. I’ve had long discussion about these things again and one possible way to look at this is that there is nothing we can do. There is also the the viewpoint that little things matter and we all can easily do a few little things to make things a bit better. While both of the above viewpoints can quite easily be defended, I will talk about the little things that we can do and about little things that I do and maybe some of the things where I could do a bit better.
Let’s first look at things that I think I’m doing well and then at things where I could do better. To get a general idea, I started by re-taking the Ecological footprint quiz . Here’s my score, nothing to be too proud about, requiring 4.17 earths if we all lived like me. Apparently, I’m doing well on Carbon and and Housing Footprints and utterly suck when it comes to my Food Footprint.
Where I excel is putting my money where my mouth is when it comes to paying for household energy. I think I already have a decade of 100% wind or water energy behind me. Naturally, that is not what I’m getting to my home, but that is what I’m paying for. So I give myself a good score here.
When it comes to transportation, I don’t drive excessively. Especially, I live quite close to where I work. However, my car isn’t really very eco-friendly, gulping 10 litres for every 100 kilometers on average. I could do w/less comfort and power the Honda Accord is giving me, but I have to say that I love the car and driving and my excuse for having what I have is that I tend to like car vacations as opposed to those taken via air planes. Carbon and car-wise, I feel like das Autobahn is my greatest weakness.
I’m constantly debating whether it would make more sense to buy an electric car for normal use and then just rent a proper vehicle during vacations. I would love to get an electric engine for my current car, if it would be able to provide the same service as the current one does. I’d be willing to pay for it, certainly some thousands of Euros, but maybe not more. I cannot wait for things to get better on this area. On the brighter side, I don’t fly much, but I can’t take too much pride in that because it is also due to my fear of flying. I can fly, but mostly prefer not to, because of both convenience and environmental factors when I can choose differently.
I’m quite big on recycling. I could’ve done a better job at it, but overall, I cannot say that I would score low by any meters here. Basically everything that I get a rid of is being disposed of responsibly. However, sometimes I’m tired and get lazy and don’t quite live up to my standard in this. I sometimes don’t throw chicken bones into bio garbage and little things like that. But I make a somewhat valiant effort, overall, in this.
Clearly my biggest shortcoming is food and eating. I eat way too much restaurant and take away food. I have no idea where the foods come from and know basically nothing about how the companies conduct themselves who produce these foods. It’s a reasonable assumption that they buy the cheapest stuff they can to make a profit that keeps their heads above the water. Also, I eat way too much top of the food-chain foods like meats. Maybe about the only thing I can say for myself in this area is that I’ve tried to eat more pork and less beef and adjusted to that quite well. I actually like pork better now than I ever did. However, there are clearly things I could do better on this department and it would also save me a lot of money that could be used to other more worthy causes.
When it comes to buying generic items, I don’t really think that I do too well in that department either. It’s exhausting to try to buy items and try to weigh all the relevant variables. I don’t think that you can really buy, for example, a car navigator only based on how green it is. It needs to serve a purpose, so it should be reliable, have a good user interface and be well made to endure the test of time and it shouldn’t be outrageously expensive, either. This is an area which I find really hard because choosing products is so complex when you try to think about all the relevant factors. In addition, there are things like how the company conducts itself who produces the product and so on.
I really wish there was a way to make this easier. Maybe that’s a business idea for someone or maybe something some non-profit could pick up - make a web page where you can weigh all the variables for all types of products to give the public a way to make these measurements. That’s one thing that we all could use. Maybe there is something like that, I need to research this.
However, I try to buy things used and use things until they need to replaced. That’s where I think I’ve done quite well. I also try to use services instead of buying more stuff, where I think I score quite high, as well.
Now, let’s gather a list of ten things that I could do better that seem like goals that could be reached w/o excessive effort:
- I could pay more attention to what and how I eat. I could eat out less and pick the places a bit more carefully, when I do. I could eat more chicken. I could eat more domestic foods.
- I could start giving money again to parties who work to help the environment. I’ve lately only basically supported open source, education and science.
- I could sometimes ride my bike to work during the summer months.
- I could get an adjustable light switch to the other big living room lamp and maybe some motion sensor light switches to other places.
- I could work a bit harder to consider the environmental consequences of the general items I buy.
- I could drive less to lunch and eat more where I’m at or just eat at walking distance.
- I could consider whether there was a way to make my home more green. Maybe the windows could be insulated or other things like that.
- I could stop running the tap when I wash my teeth. I could buy less exported beverages or try to buy ones that aren’t from the other side of the world.
- I could try to stay up more during the daylight hours to need less electric light.
- I could consider environmental factors more when I’m buying clothes.
- I could be paying more attention to these things again in general!
- I could just buy less, even if I’m not that big on buying stuff anyway.
What things I should keep on doing that I’m doing well:
- Keep on doing the 100% renewable on electricity, keep on recycling and buying used stuff and using services instead of buying more crap.
- I can keep on preferring laptops to other computers and I can keep on having my computers use power-saving modes.
- I can continue to prefer other means than flying when it comes to vacations and other trips.
- I can keep on trying to buy clothes that are durable and don’t need to be replaced too often.
- I can keep on asking where the items come from and how they are made when I’m buying them.
- I can keep on not having shopping as a hobby.
Oh well, I think that’s quite good enough for now.
Have a green day! :-)
No commentsApr 29
Recursive binary search in C
I saw this article on twitter: Are you one of the 10% of programmers who can write a binary search? and of course I had to try it out. I actually found it easier to write the routine using recursion. I also wrote a small test for the code and used the sample given in the above article as a reference function to tweak my version to the same performance step-wise as the sample.
So here it is: Recursive binary search in C .
I have to say, though, that the optimal solution takes some thinking and isn’t as trivial to write as one might assume from the article. This is especially true for the inefficiency that results if you don’t put the +1 and -1 into the algorithm. Many things in programming are like this. However, the fact of the matter is that in most cases less is still more. Don’t optimise before measuring the real need, unless it clarifies the code.
No commentsApr 25
Science proves it: Carrot and stick Fails!
I’m quite sure that most people know this intuitively. However, if you have 20 minutes to spend, please let Dan Pink make his case on science of motivation.
No comments