Ask HN: Why don't people talk about programming by example?

I've been searching for the future of programming for a while, and just recently discovered "programming by example". Basically, you specify your program by giving examples of inputs and outputs, and the reasoning engine does the rest. It's already implemented in Excel as a feature called "Flash Fill".

Why are people still debating syntax when programming by example is clearly the future? Why don't more people talk about this?

8 points | by miguelrochefort 1963 days ago

5 comments

  • otras 1963 days ago
    > Why are people still debating syntax when programming by example is clearly the future?

    In your opinion, why is it clearly the future?

    From the abstract of a paper about this topic [0]: "Programming by Examples (PBE) has the potential to revolutionize enduser programming by enabling end users, most of whom are non-programmers, to create scripts for automating repetitive tasks. "

    Most of the professional programming I've done has been solving (relatively) unique problems, not automating repetitive tasks. While automating repetitive tasks is a great use-case for programming, I don't think that's enough to call it the future of all programming.

    [0]: https://www.microsoft.com/en-us/research/wp-content/uploads/...

  • rococode 1963 days ago
    I hadn't heard of it before so forgive me if I get something wrong. Two main thoughts:

    1. It sounds like, to implement a robust program (and not just a pattern in Excel), you'd need to provide every different combination of input/output. This is just not feasible for any remotely large project. For example, if you need the program to handle an obscure error in a specific way, then you'd have to provide the series of inputs that causes the error.

    2. If programming by example is characterized by giving inputs and outputs, then isn't it basically just supervised machine learning? In which case, we're still many years away from not needing to write the actual ML code ourselves in a standard programming language.

  • eesmith 1963 days ago
    I think it would be rather hard to have such a system implement something like a sequence alignment algorithm, much less an NP hard problem like subgraph isomorphism, much less a humanly complex problem like tax filing software.
  • sgillen 1962 days ago
    You’re basically describing function or program approximation. This is the central problem that machine learning is trying to solve. A lot of people are talking about this.
  • thepapanoob 1962 days ago
    another huge thing is it will be really hard to get optimized algorithms