In the /. discussion I mentioned before about code optimization and development the were links to two rather interesting articles on the net. The first one "They Write the Right Stuff" is about the guys (and gals) who write the software for the space shuttle. It is a really interesting read. It does away with all the romantic images about software as being a creative art performed by snowboarding youngsters. If you want to write code that works then you have to grow up.
The other article, not as good as the first one but still worth a read, is about an ex Microsoft guy who trains software developers. The key thing for him it the team, and how it works. His training camp focuses on getting a team to work together, to have a common vision. The article is called "Drop and Code Me Twenty!".
2005-02-28
2005-02-26
Optimizing code
There was an interesting discussion on /. yesterday. A guy wanted to know if people had any small code snippets they could share that did fairly common things in the fastest possible way. He wanted to make sure his code ran as fast as possible. Watching the following discussion was a very positive experience. Here are some quotes that sum up the general conclusion. The first quote I use a lot myself.
The following quote contains the essence of most of the responses:
Many replies were also pointing out that picking the right algorithm is much more important that micro optimizing the code.
Here's another beautiful quote:
I'm very happy to see this level of maturity from the /. crowd. I think there has been a shift the last five years or so. Before then too many programmers were concerned with speed. I think the reason for this shift is three fold:
1) Programs have become much more sophisticated. To be able to develop these programs one simply have to write maintainable code.
2) Computers have become much faster. You don't need to optimize your program to death to get decent performance out of it. It's OK to spend some clock cycles to get maintainable code.
3) today's CPUs are so complex that it's difficult to tell which piece of assembly code will run fastest. I'm mostly thinking of Intel's processors here with out of order execution, register renaming and multiple pipelines. Not to mention the cache hierarchy. It is nearly impossible to tell what the optimal assembly code for a given task should look like.
I very much welcome this attitude towards programming. Maybe we can start focusing on writing correct software now.
Premature optimization is the root of all evil
-- Tony Hoare's dictum.
The following quote contains the essence of most of the responses:
1) Code for maintainability
2) Profile your code
3) Optimize the bottlenecks
Many replies were also pointing out that picking the right algorithm is much more important that micro optimizing the code.
For 99% of the coders out there, all that needs to be known about code optimization is: pick the right algorithms!
Here's another beautiful quote:
"Programs should be written for people to read, and only incidentally for machines to execute."
- Structure and Interpretation of Computer Programs
I'm very happy to see this level of maturity from the /. crowd. I think there has been a shift the last five years or so. Before then too many programmers were concerned with speed. I think the reason for this shift is three fold:
1) Programs have become much more sophisticated. To be able to develop these programs one simply have to write maintainable code.
2) Computers have become much faster. You don't need to optimize your program to death to get decent performance out of it. It's OK to spend some clock cycles to get maintainable code.
3) today's CPUs are so complex that it's difficult to tell which piece of assembly code will run fastest. I'm mostly thinking of Intel's processors here with out of order execution, register renaming and multiple pipelines. Not to mention the cache hierarchy. It is nearly impossible to tell what the optimal assembly code for a given task should look like.
I very much welcome this attitude towards programming. Maybe we can start focusing on writing correct software now.
2005-02-24
Google Movies
Google did it again! They've added a really nice feature to their search engine, a "movie:" operator. It tracks film reviews and compiles them into a single page with a single score. Just in time for the Academy Awards. More info at the Google blog
Eleanor Rigby
I've just started reading Douglas Coupland's latest book Eleanor Rigby. It's amazing. I've read all fiction books by this guy. He has a way of talking about life, life as it is for ordinary people. Seeing the little details. He often deals with loneliness and the purpose of our lives. But all that is weaved in the story of the characters of his books. I'd like to quote the first couple of lines in his new book:
Douglas Copeland certainly has a feel for the human nature.
I had always thought that a person born blind and given sight later on in life through the miracles of modern medicine would feel reborn. Just imagine looking at our world with brand new eyes, everything fresh, covered with dew and charged with beauty - pale skin and yellow daffodils, boiled lobster and a full moon. And yet I've read books that tell me this isn't the way newly created vision plays out in real life. Gifted with sight, previously blind patients become frightened and confused. They can't make sense of shape or color or depth. My brother, William, says, "Well, think about it, Liz - kids lie in their cribs for nearly a year watching hand puppets and colorful toys come and go. They're dumb as planks, and it takes them a long time to even twig to the notion of where they end and the world begins. Why should it be any different just because you're older and technically wiser?"
In the end, those gifted with new eyesight tend to retreat into their own world. Some beg to be made blind again, yet when they consider it further, they hesitate, and realize they're unable to surrender their sight. Bad visions are better than no visions.
Douglas Copeland certainly has a feel for the human nature.
2005-02-16
QOTD
Quote of the day:
From an anonymous book reviewer on Amazon.com.
"The first time I read this book I felt what I could only explain as a
great disturbance in the Force: it was as if a billion washing
machinces all became unbalanced at once and were suddenly silenced."
From an anonymous book reviewer on Amazon.com.
2005-02-14
2005-02-07
Harry Potter musings
I was just thinking about Harry Potter today. I have no idea why. I haven't read any of the books recently. However, I was wondering what was going to happen with the character Draco Malfoy. The book series is coming to an end and the final destiny of many of the people in the books will be decided. I have a feeling that Draco Malfoy actually will turn good in the end of the seventh book. I don't know how this is going to happen but he will probably be betrayed by the dark side, then accepted by the good side and realizing that his previous attitude which he was raised with is bad. I think this developments very much makes sense considering the general ethics of the Harry Potter books. There is ofcourse the option that Draco will never change and either die of be trapped on the dark side. But as I said I feel that the books need a person which converts to the good side. And it would be very natural to pick Draco to be the convert.
2005-02-06
The Monad.Reader
As a Haskell programmer I take part in the Haskell community. I'm not a very active member, rather I'm a lurker. But there are other more social people in this community. Perhaps the most social character is Shae Erisson. He always hangs out at the #haskell irc channel greeting new people and help them around answering questions about Haskell. He also hosts a number of different wikis and other stuff on his web server. A really frendly guy.
Shae's most recent project is an eZine called The Monad.Reader. The title is ofcourse a pun but if you don't understand it is no use me trying to explain it. But trust me it's actually a really funny name. Well, I think this eZine idea sound like a really fun thing. I think I'm going to try to write something up for it. I have already come up with some ideas for what to share. I'm seeing forward to getting my first copy!
Shae's most recent project is an eZine called The Monad.Reader. The title is ofcourse a pun but if you don't understand it is no use me trying to explain it. But trust me it's actually a really funny name. Well, I think this eZine idea sound like a really fun thing. I think I'm going to try to write something up for it. I have already come up with some ideas for what to share. I'm seeing forward to getting my first copy!
2005-02-05
Me, a Google fan
OK I have to admit it. I'm a real fan of the Google company. It feels odd to say it though. I'm not the kind of guy who admires companies, products or trends. The people I look up to are researchers, composers, book writers and such. But still, I have to admit I am a Google fan.
First and foremost, Google search just rocks. There is no alternative. I use it so much every day. Anything that I want to find out, just Google for it and there it is. But it is more than the functionality. I think what plays an even bigger role is their slick design. Or rather the lack thereof. Their main page is so minimalistic it's almost embarrasing. And when you get to the seach results there is no clutter. Everything is very tidy and no graphical noise. The ads aren't annoying either which is a major accomplishment in itself.
Secondly, the thing that I actually use more than the search engine nowadays is Gmail. I rely on Gmail for all my mailing. OK, Gmail does not revolutionize emailing, as Google did web search. But it serves all my needs, it has a decent spamfilter, it saves all my old mails so that I can easily find them and I can reach it from pretty much anywhere. It also allows me to focus my activities using fewer programs. I can do mailing in my webbrowser using the same interface as for surfing. I like that.
Then there is google labs. It seems they have a lot of fun. They dare to test things. They want to go public and make everyone test their things. I like this kind of spirit. It makes me think of Star Trek.
And, ofcourse, here I am publishing using Blogger. It is a nice blogging facility. So, in short, I am a Google fan. Rumours says that Google is going to develop their own browser based on Firefox. Will I switch to using that instead of using Firefox? It is likely. (Depends on how Opera 8 turns out. I might switch back to Opera if I can use it for blogging and email...)
First and foremost, Google search just rocks. There is no alternative. I use it so much every day. Anything that I want to find out, just Google for it and there it is. But it is more than the functionality. I think what plays an even bigger role is their slick design. Or rather the lack thereof. Their main page is so minimalistic it's almost embarrasing. And when you get to the seach results there is no clutter. Everything is very tidy and no graphical noise. The ads aren't annoying either which is a major accomplishment in itself.
Secondly, the thing that I actually use more than the search engine nowadays is Gmail. I rely on Gmail for all my mailing. OK, Gmail does not revolutionize emailing, as Google did web search. But it serves all my needs, it has a decent spamfilter, it saves all my old mails so that I can easily find them and I can reach it from pretty much anywhere. It also allows me to focus my activities using fewer programs. I can do mailing in my webbrowser using the same interface as for surfing. I like that.
Then there is google labs. It seems they have a lot of fun. They dare to test things. They want to go public and make everyone test their things. I like this kind of spirit. It makes me think of Star Trek.
And, ofcourse, here I am publishing using Blogger. It is a nice blogging facility. So, in short, I am a Google fan. Rumours says that Google is going to develop their own browser based on Firefox. Will I switch to using that instead of using Firefox? It is likely. (Depends on how Opera 8 turns out. I might switch back to Opera if I can use it for blogging and email...)
2005-02-01
Rock Paper Scissors
I just visited my friend/exstudent Andreas Farre's new homepage. He had a link to one of the coolest sites I've ever seen. The Official Rock Paper Scissors Strategy Guide!
Now, the thing is I sometimes use rock paper scissors as a kind of a joke. Whenever people complain they have to wait long for something or think that things are taking too long time I suggest they should play rock paper scissors. However, people are usually quite happy to play a couple of rounds with me when I suggest this dispite the fact that they would probably laugh at it under different circumstances. I guess this is why I think of it as a joke. When bored poeple are so desperate for something to do they even bare playing rock paper scissors.
Hmm, I've made it sound like it is a game no sane person would ever want to play. It's not that bad. In fact, it is so intriguingly simple that I cannot help being charmed by it.
Now, the thing is I sometimes use rock paper scissors as a kind of a joke. Whenever people complain they have to wait long for something or think that things are taking too long time I suggest they should play rock paper scissors. However, people are usually quite happy to play a couple of rounds with me when I suggest this dispite the fact that they would probably laugh at it under different circumstances. I guess this is why I think of it as a joke. When bored poeple are so desperate for something to do they even bare playing rock paper scissors.
Hmm, I've made it sound like it is a game no sane person would ever want to play. It's not that bad. In fact, it is so intriguingly simple that I cannot help being charmed by it.
Blogging urge
Ok, I haven't been blogging for quite a while now. Not that I had a very high tempo before either. Anyway.
I'm getting pretty stressed up at work. This is my last term as a PhD student and my thesis has to be ready before summer. It feels tight. I'm going to have the result ready alright. That's not what I'm worrying about. The thing that really scares me is the writing. I'm really bad at writing. The more I think about it, the more it scares me. Nailing down the words can sometimes be the most difficult thing there is. But here I am writing in my blog and the words come out pretty easily. I guess it is my frustration oozing out through my fingers.
My hacking at work goes fairly well. Although I wish it could go faster. I spent the holidays hacking and I still didn't manage to get things to work in time for me to submit to the department's yearly winter meeting. Well, I managed to get some results the day before I were to present my results. So I managed to give a decent presentation. Just-in-time research :-)
I'm getting pretty stressed up at work. This is my last term as a PhD student and my thesis has to be ready before summer. It feels tight. I'm going to have the result ready alright. That's not what I'm worrying about. The thing that really scares me is the writing. I'm really bad at writing. The more I think about it, the more it scares me. Nailing down the words can sometimes be the most difficult thing there is. But here I am writing in my blog and the words come out pretty easily. I guess it is my frustration oozing out through my fingers.
My hacking at work goes fairly well. Although I wish it could go faster. I spent the holidays hacking and I still didn't manage to get things to work in time for me to submit to the department's yearly winter meeting. Well, I managed to get some results the day before I were to present my results. So I managed to give a decent presentation. Just-in-time research :-)
Subscribe to:
Posts (Atom)