News for hackers. Stuff that matters.
Re:Holding a Program in One's Head (2007) by sillysaurus on Saturday December 08, 2012 @05:58AM (#4891350)
I have one: natural language programming.

This exists. It's "Write each step of an algorithm in comments before writing any code, and (only when you're finished writing each step in English in comments) fill in the code each comment represents".

But it's impossible to convince anyone to try that, though, even though it gives all the benefits you are imagining NLP would give.

The mentality "Don't repeat yourself under any circumstances, even if it adds no complexity and increases clarity!" is unfortunately why this is undiscovered. Also, people generally go overboard with the "commenting" part -- the purpose is to be pseudocode in the way Python is executable pseudocode, while retaining the ambiguity that is necessary for natural language to be natural. So it gets a bad reputation, and its power is hidden despite it being powerful.

Re:Holding a Program in One's Head (2007) by tspike on Saturday December 08, 2012 @04:09PM (#4892702)
The closest experience I've had to this is using RSpec and Capybara to do test-driven development.

Here's an actual snippet of a test I wrote before writing the corresponding code for an app that's now in production:

  describe "adding participants" do                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    context "when user has created a new event" do
      before :each do
        visit root_path
        click_link 'Get Started'
        fill_in 'Name', :with => 'Tres'
        fill_in 'E-mail', :with => '[email protected]'
        click_button 'Next'
      end
    
      it "should prompt for more participant info" do
        page.should have_field 'Name'
        page.should have_field 'E-mail'
        page.should have_button 'Add Participant'
      end
    
      it "shouldn't let you enter an invalid e-mail" do
        fill_in 'Name', :with => 'Tres'
        fill_in 'E-mail', :with => '#)(*)($*#)($*'
        click_button 'Add Participant'
        page.should have_content 'invalid'
      end
    end
  end
It's been an absolute joy to work this way. I'd love to see this level of abstraction make its way into the mainstream in other languages and environments.
Re:Holding a Program in One's Head (2007) by JBiserkov on Saturday December 08, 2012 @07:03AM (#4891449)
Some Lispers have been doing something similar for some time. There's even a saying that "Any sufficiently well-documented Lisp program contains an ML program in its comments."
Re:Holding a Program in One's Head (2007) by klibertp on Saturday December 08, 2012 @11:03AM (#4891848)
Literate Programming - another 30 years old "technology". And it's good. As you say, the problem is not the tools, but rather mentality of rediscovering the wheel at best, and staying ignorant to the history of our field at worst.
Re:Holding a Program in One's Head (2007) by btilly on Saturday December 08, 2012 @11:49AM (#4891974)
I have been known to do that. It is great for writing an initial block of code.

It doesn't work so well 6 months later when you're editing that code.