Hacker News new | ask | show | jobs
by wccrawford 5534 days ago
It matters sometimes.

A while back, I wrote a program to solve a puzzle. The more complex the puzzle, the longer it took to solve. Today, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run.

The program was written in VB6, and it was just wasn't mean for CPU-intensive programs like that. If I were to write that program again today, I'd be looking at optimizing the code for speed, starting with the language.

So yes, the question -does- matter. Sometimes.

1 comments

Today, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run.

I bet that you could come up with a better algorithm now, even in VB6 if you had to, to get the run time down. I've seen people take "optimised" C solutions that run in hours and make them run in minutes, just by rewriting the algorithm and rethinking basic assumptions.