Linked by Thom Holwerda on Thu 6th Sep 2012 18:07 UTC, submitted by MOS6510
General Development "Imagine an approach to programming where you write down some description of what your code should do, then before running your code you run some automatic tool to see if the code matches the description. That's Test-driven development, you say! Actually, this is what you are doing when you use static types in most languages too. Types are a description of the code's inputs and outputs, and the check ensures that inputs and outputs match up and are used consistently. Modern type systems - such as in Haskell or above - are very flexible, and allow these descriptions to be quite detailed; plus they are not too obtrusive in use and often very helpful."
Thread beginning with comment 534406
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: It's interesting...
by zima on Sun 9th Sep 2012 06:45 UTC in reply to "RE: It's interesting..."
zima
Member since:
2005-07-06

I can write the relationships and constraints of the answer I want, but then it's up to the language to find a way to reach the answer. [...]
It requires a radical shift in thinking, which is probably why it's not been popular. Several generations down the line though I hope we'll see more languages adopting the Haskell approach programming, emphasising the "what" instead of the "how".

Asking as a mostly layman: could that be the closest thing we have to the mythical / fantasy / cargo cult scifi standard of "Computer! Do [one thing] and [some different thing]!" commands? ;p

Reply Parent Score: 3

RE[3]: It's interesting...
by Alfman on Sun 9th Sep 2012 18:12 in reply to "RE[2]: It's interesting..."
Alfman Member since:
2011-01-28

Haha, well part of the problem is that while computers are good at running commands, those commands have to be preprogrammed and are very literal.

I'd argue an unprogrammed human is equally incapable of executing commands, but the human has the capacity to learn dynamically from the environment. As we execute commands, the steps become ingrained. It's like a new job in something new, even if you are smart you are going to look like a baboon until the programming sets in.

The show "Undercover Boss" is hilarious because you see how incompetent company CEOs are starting out from the bottom of their company.

http://www.youtube.com/watch?v=8BAqimE2Dxg


If we want to give commands more naturally to computers, we'll probably have to expect alot of failures in the field and allow the computers to learn from their own mistakes just like a human would.

Reply Parent Score: 2