News for hackers. Stuff that matters.
Re:Ask HN: Evolution writes very poor code. So why is biol... by 10ren on Saturday May 30, 2009 @04:20PM (#634064)
Evolution writes very poor code. So why is biology research rewarding?

Because biologists aren't looking at the code, but the product.

For example, I really liked NN 4.7. It was responsive and consistent. But the codebase was so poor, that they rewrote it - and nuked themselves. Joel on Software wrote an essay about how as a codebase evolves to cope with more and more special cases, it gets more complex and ugly. But that's because it needs to be (according to Joel).

In other words, no one cares about your code. They care about what it does. If it does something really cool and amazing, people will want to know how you did it. What it "does" can go beyond performance and features - what code does can include realizing a new user-interaction approach, or a new algorithm, or a new way to model something. Imagine the jury-rigged prototype of the first telephone, light-bulb, aeroplane - the slickness of the implementation just doesn't matter. The invention matters.

If, one day, we work out how DNA codes for a brain, we may be able to code it better. But what we lack is any idea of how to do it at all. Poor code that works is infinitely better and more cool than no idea.

This is why biologists might be interested in the poor code: How the hell did he do that?

Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @08:00PM (#634215)
I doubt biologists will find anything particularly insightful about how the brain thinks in my lifetime.

In fact, it may be that it is impossible to determine how the brain thinks from our physical reality.

Re:Ask HN: Evolution writes very poor code. So why is biol... by 10ren on Sunday May 31, 2009 @05:45AM (#634581)
You're saying that the brain's operation may be supernatural.
Re:Ask HN: Evolution writes very poor code. So why is biol... by papaf on Saturday May 30, 2009 @06:00PM (#634136)
I don't think the code metaphore is a good one. Its more like reverse engineering self duplicating and self healing nanotech hardware i.e. hardware so complex it can't be artificially designed with current understanding.

The situation is made more complex by the fact that this hardware is interacting with different types of other hardware such as viruses and bacteria.

Re:Ask HN: Evolution writes very poor code. So why is biol... by markerdmann on Saturday May 30, 2009 @02:56PM (#633991)
If you're looking at all of the code that evolution has ever written, then yes, I suppose you could say that most of it is very poor. The fraction of code that survives and propagates, however, is awe-inspiringly beautiful.

If you're looking for some insight into what makes it so beautiful, The Selfish Gene is an excellent place to start.

Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @02:59PM (#633993)
What evidence do you have that the code that survives and propagates is elegant (i.e., at the DNA sequence level)?

In genetic programming, the products of evolution on a computer are completely incomprehensible.

What makes natural evolution any different?

Re:Ask HN: Evolution writes very poor code. So why is biol... by markerdmann on Saturday May 30, 2009 @11:01PM (#634366)
If someone who is not a programmer looks at your code and pronounces it utterly incomprehensible, does that make it inelegant?

What exactly would "evidence" of something as subjective as "elegance" look like?

Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @03:22PM (#634008)
BTW, code growth seems important in some cases for evolution on a computer: http://www2.cs.uidaho.edu/~tsoule/cs472fall05/AlifePeaks2.pd...
Re:Ask HN: Evolution writes very poor code. So why is biol... by saurabh on Saturday May 30, 2009 @04:32PM (#634072)
I think evolution writes "good enough" code, if I can put it that way.
Re:Ask HN: Evolution writes very poor code. So why is biol... by schorndorfer on Saturday May 30, 2009 @03:27PM (#634016)
Just a guess, bu biology research is probably rewarding to some at least in part because there are so many important consequences to our lives for understanding how it works. Curing disease seems pretty rewarding, doesn't it?
Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @03:29PM (#634018)
I wouldn't find it rewarding. As I said, it's like trying to understand and debug code written by very poor programmers.

I would rather use genetic algorithms for my own purposes rather than trying to understand the messy artifacts of nature.

But yes, the fear of death will give such research a lot of funding.

Re:Ask HN: Evolution writes very poor code. So why is biol... by wglb on Saturday May 30, 2009 @06:23PM (#634154)
Wait--who says it is poor code, and by what criteria? And what we think of as parsimonious as a quality is not a useful metric for DNA.
Re:Ask HN: Evolution writes very poor code. So why is biol... by philh on Saturday May 30, 2009 @04:14PM (#634060)
I think it's probably more like trying to understand machine code written by very short-sighted programmer, on an arcitecture that you're unfamiliar with, for which no documentation exists, and which you don't have access to for testing purposes.

I think that's an interesting problem, regardless of the quality of the code.

Re:Ask HN: Evolution writes very poor code. So why is biol... by adamcrowe on Saturday May 30, 2009 @03:47PM (#634036)
"If you are a hammer, everything looks like a nail."

Bert Hubert - DNA seen through the eyes of a coder http://ds9a.nl/amazing-dna/index.html

Re:Ask HN: Evolution writes very poor code. So why is biol... by aswanson on Saturday May 30, 2009 @06:19PM (#634151)
Because we have diseases to cure, lives that we want to enhance and curiosities to satisfy.

Insofar as the code metaphor goes, I don't think you can comment on the quality unless you completely understand what it is doing and how robust it is. For example, the code that architected your neocortex is significantly smaller than the source for Open Office. I find that impressive.

Until you are capable of producing something better, you can't make those statements.

Re:Ask HN: Evolution writes very poor code. So why is biol... by jaskew on Saturday May 30, 2009 @11:24PM (#634387)
Evolution does not write code.

'Code' created by a long series of chaotic events manages to survive or not survive.

The research is rewarding because it is challenging. Both the discover of the raw data and the interpretation of said data is dumbfoundingly complex, to the point where any tiny amount of comprehension is the result of more work than you can possibly imagine.

In short, it's hard, and success is uncommon and amazing.

Re:Ask HN: Evolution writes very poor code. So why is biol... by paulgb on Saturday May 30, 2009 @03:38PM (#634030)
Evolution may write poor code, but it can accomplish some really cool stuff with it. The human brain, for example. If a programmer had managed to recreate the human brain in code, even if he did it in spaghetti-coded COBOL, people would want to have a look.

Also, evolution isn't always elegant, but it often is. Think of the symmetry and self-similarity found so often in nature.

Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @03:41PM (#634032)
The very poor code I'm referring to is in the genotype (i.e., the DNA sequence). You can get an elegant phenotype (i.e., the resulting creature) from a very messy genotype.
Re:Ask HN: Evolution writes very poor code. So why is biol... by bored on Saturday May 30, 2009 @04:05PM (#634049)
If you see things that way, then yes, DNA code is not very elegant or parsimonious. There are plenty of sequences that don't do anything (as far as we know).
Re:Ask HN: Evolution writes very poor code. So why is biol... by russell on Saturday May 30, 2009 @03:20PM (#634007)
Good grief! Take your favorite OSS project, or even Windows. What do you think it would look like after 4 billion years of cut and paste.
Re:Ask HN: Evolution writes very poor code. So why is biol... by amichail on Saturday May 30, 2009 @03:24PM (#634010)
Evolution is not directed by an intelligence. And moreover there is evidence that useless code in an evolutionary process can sometimes give you better results by protecting functional code against harmful mutations/crossovers.
Re:Ask HN: Evolution writes very poor code. So why is biol... by Confusion on Saturday May 30, 2009 @05:06PM (#634091)
Evolution writes excellent code, because it is understood perfectly by its intended audience.