Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming News

A Better Way To Program 467

mikejuk writes "This video will change the way you think about programming. The argument is clear and impressive — it suggest that we really are building programs with one hand tied behind our backs. Programmers can only understand their code by pretending to be computers and running it in their heads. As this video shows, this is increadibly inefficient and, as we generally have a computer in front of us, why not use it to help us understand the code? The key is probably interactivity. Don't wait for a compile to complete to see what effect your code has on things — if you can see it in real time then programming becomes much easier."
This discussion has been archived. No new comments can be posted.

A Better Way To Program

Comments Filter:
  • by Anonymous Coward on Sunday March 11, 2012 @04:14PM (#39319541)

    I've been doing this for years with Python's interactive prompt. I write code and test it on a line by line basis as I'm programming when working with unfamiliar libraries. The code that works is then put into a permanent file for reuse as a script or compiled to an executable for distribution to my end users.

  • Re:Conjecture. (Score:4, Informative)

    by Brummund ( 447393 ) on Sunday March 11, 2012 @04:35PM (#39319655)

    "Whoever does not understand LISP, is doomed to reinvent it".

    (As a practical example, I used OpenGL in Lisp 10 years ago, and it was great to modify the code while the system was running.)

  • by justforgetme ( 1814588 ) on Sunday March 11, 2012 @04:35PM (#39319657) Homepage

    And here is the vimeo video [vimeo.com] for those who want to tear their eyes out when
    visiting i-programmer and their 180px content column.

  • Re:Great but... (Score:5, Informative)

    by blahplusplus ( 757119 ) on Sunday March 11, 2012 @04:55PM (#39319771)

    You didn't see the point when he showed how you could find bugs in algorithms as you typed them.

  • by Animats ( 122034 ) on Sunday March 11, 2012 @05:43PM (#39320099) Homepage

    The article completely misses the point. The talk starts out awful, but after about five minutes of blithering, he gets to the point. He's set up an environment where he's running a little Javascript program that draws a picture of a tree with flowers, with mountains in the background. As he edits the code, the picture changes. There's a nice user interface which allows selecting a number in the code and then changing it with a slider. This immediately affects the picture. There's an autocomplete feature which, when code typing has reached a limited number of possible choices, offers options like drawCircle, drawRect, etc. Mousing over the selections changes the picture.

    It makes sense if you're drawing pictures with programs. Something like this should be in editors for Renderman shaders and Maya programs, and maybe for some game engines. It also makes sense for HTML editors, and there are HTML editors which do that. Beyond that, it may not be too useful.

  • Re:An observation... (Score:5, Informative)

    by Cow Jones ( 615566 ) on Sunday March 11, 2012 @07:53PM (#39321055)
    Around the last ':' character.
    * is a greedy "match as many as you can", and the first .* trumps the second.

    So the result of -- $_ = "foo:bar:baz:qux"; s/(.*):(.*)/$2:$1/; -- would be "qux:foo:bar:baz".

There are two ways to write error-free programs; only the third one works.

Working...