Slashdot Mirror


A Better Way To Program

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."

76 of 467 comments (clear)

  1. Great but... by Anonymous Coward · · Score: 5, Interesting

    Seems like it mostly only applies to GUI programming or programming with results expressed through a GUI. What about, say, kernel programming?

    1. Re:Great but... by viperidaenz · · Score: 5, Funny

      Visualise them kernel then. They didn't have any problems in The Matrix.

    2. Re:Great but... by spyked · · Score: 5, Insightful

      That sounds simple but it isn't. While you could theoretically do this from a virtual machine, the difference between visualising” it and testing it on real hardware is significant especially when it comes to device drivers, which are known to be the most common source of bugs in kernels.

      Plus verifying a kernel or a compiler is a pretty hard problem, it's a miracle if you manage to do it in decent time, let alone manage to visualise it in any way.

    3. Re:Great but... by blahplusplus · · Score: 4, Informative

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

    4. Re:Great but... by Junta · · Score: 5, Insightful

      In the video he covers that as well. Well, at least he conceptually says its covered, I disagree...

      Lets start with his abstract example. His binary search on the surface looks straightforward and he wanted to portray it as magically finding bugs as he got a float in one instance and an infinite loop in another. However the infinite loop example was found because he *knew* what he was doing as he intentionally miswrote it to start with and intentionally changed the inputs in accordance with this knowledge. There are a few more possibilities that you have to *know* to try out. For example, he didn't try a value that was lower than the lowest (would have panned out), he didn't try a value omitted from the list but still higher than the lowest and lower than the highest (which also would have been fine) and he didn't try an unordered list (which is incorrect usage, but accounting for incorrect usage is a fact of life). He didn't try varying dataset sizes (in this algorithm doesn't matter, but he has to *know* that) and different types of data. You still have the fact that 'B' is smaller than 'a' and all sorts of 'non-intuitive' things inherent in the situation.

      Now consider that binary search is a freshman level programming problem and therefore is pretty low in terms of the complexity a developer is going to deal with. Much of software development will deal with far more complicated scenarios than this, and the facility doesn't *really* cover even the binary search complexity.

      I know I may sound more negative than is appropriate, but his enthusiasm and some people's buy-in can be risky. I've seen poor developers suckered in by various 'silver bullets' and produce lower quality code because they think that unit test or other mechanisms passed and they can reast easy. Using these tools is good, but always should be accompanied with some wariness to avoid overconfidence.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    5. Re:Great but... by ghostdoc · · Score: 3, Insightful

      So your point, basically, is that programming is all about knowing what could go wrong with your code?

      Not a bad definition actually...it would certainly explain why coding productivity increases in step with experience; you've made those mistakes already and now know to avoid them.

      --
      Business/App ideas are like arseholes: everyone's got one, they're mostly shit, but very rarely they contain a diamond
    6. Re:Great but... by sjames · · Score: 5, Funny

      What about, say, kernel programming?

      If you enter a syntax error, you get a video of Orville Redenbacher ripping you a new one.

    7. Re:Great but... by jythie · · Score: 3, Insightful

      That tends to be the problem with a lot of these 'rethink programming' ideas. They tend to come from people who are thinking in very specific domains and believe that their domain is the only one that matters or that its lessons apply everywhere. It gets very frustrating, esp if your domain is one that is not one of the 'hot' fields that everyone is paying attention to.

    8. Re:Great but... by msobkow · · Score: 2

      Smalltalk and Erlang both have this neat feature where you can not only load and unload new code on the fly, you can change implementations in mid-execution just like you can with the Eclipse Java debugger at a breakpoint, or with the C# debugger under Microsoft's IDE platform.

      So what exactly is he talking about that's "new"?

      We haven't had to rely on static build-test-debug-fix-repeat cycles for day-to-day programming in at least 5-6 years!

      --
      I do not fail; I succeed at finding out what does not work.
    9. Re:Great but... by BasilBrush · · Score: 4, Insightful

      However the infinite loop example was found because he *knew* what he was doing as he intentionally miswrote it to start with and intentionally changed the inputs in accordance with this knowledge.

      It's was a demo. Demos by their nature tend to be both simplistic contrived.

      He was putting across a principle in the first half of his talk and a way of life in the second. Both very valid.

      From your comments it's clear that you're more of a craftsman than a visionary. There's room in the world for both.

    10. Re:Great but... by BasilBrush · · Score: 3, Insightful

      You need to watch the video. The horizons of his thinking couldn't be wider.

    11. Re:Great but... by jythie · · Score: 4, Insightful

      TBH - at an hour of talking, no. A summary or argument with diagrams would be worth looking at, but a video? I am actually getting tired of this fad of posting videos to make a case. Very inefficient and can usually be summed up in something that only takes 10 minutes to read. I get the feeling the people who do things pieces just like hearing their own voice....

    12. Re:Great but... by hpoul · · Score: 2

      for me this looked like something we learned even before we wrote our first program in school at a computer.. debugging on paper..
      although we had one column for each variable while the demo shows one row for each variable (in the same row as the variable is changed in the code).. so i don't think this is really that revolutionary but it would be quite cool, and maybe not that hard to implement.. simply an eclipse debug extension which when you have a breakpoint within a method, not only shows you all variables but also how they change, and allows you to change the input parameters of that method.. (would only work during debugging, since otherwise you would have to somehow initialize that class).. it's already possible to change variables in eclipse, so there must only be a way to try different input variables of the code without effecting future calls (maybe cloning the current object or forking the whole process).. too bad there are no savepoints&rollbacks in java to get back to the state when the breakpoint was invoked :)

      --
      Find me at http://herbert.poul.at
    13. Re:Great but... by viperidaenz · · Score: 3, Funny

      All I see now is blonde, brunette, redhead.

    14. Re:Great but... by luis_a_espinal · · Score: 3, Insightful

      It's worth a hour. But if you don't want to watch it fine. Just don't expect your comments to be worth anything if you haven't done your homework.

      He has a point. You don't need a 1hr long video as the sole measure with which to convey a technical point. Summaries, diagrams, and/or a 8-10 page paper are also necessary. Asking people to devote one hour just to know that something is worth it, that is not how you present technical ideas or issues.

    15. Re:Great but... by jones_supa · · Score: 2

      Yes, but while it was a joke, it still can be speculated if something like that could be done.

    16. Re:Great but... by lucm · · Score: 2

      It's amazing how many people are proud to be closed minded. Too bad you missed out. I'm glad I didn't.

      You had a life changing experience watching javascript guy with his cargo pants, I get it and I rejoice for you. That does not mean that people who find him tedious and cheesy are close-minded, it just mean that some people need a little more substance before they applaud.

      --
      lucm, indeed.
    17. Re:Great but... by hughbar · · Score: 2

      This is also the point of Z, for example: http://en.wikipedia.org/wiki/Z_notation amazing how much implicit 'potential wrongness' there is even in a simple bit of code. For me, whilst the demonstrations in the talk have limits [as a previous poster said, better for things that are visual and I can't imagine what the hashes of hashes and random bit of json that I deal with would look like] it's pretty interesting and related to some of the smalltalk attempts at visual programming.

      --
      On y va, qui mal y pense!
    18. Re:Great but... by Mr+Z · · Score: 3, Insightful

      I personally am a fan of "debugging by printf." Kernighan and Pike make a good argument for it in The Practice of Programming. But, that's not limited to debugging, really. It's a great tool for understanding one's own code. Basically, whenever I want to get a greater intuition about how something works, I load it up with print statements at strategic points. I guess you might call it "understanding through printf."

      I'll be honest: I didn't invest an hour of my time watching this video. How really does his technique compare to "understanding through printf"?

    19. Re:Great but... by bitingduck · · Score: 2

      On the other side another field that is sorely in need of this is the medical field. A simple example would be that we have built machines to take blood pressure and heart rate automatically. But why aren't they in homes? We brush our teeth everyday, why can't we take blood pressure? Why can't we get a daily or even real-time heart rate? We carry smart phones. We have wireless networks. Why not advocate daily blood pressure readings tied to a wireless network that would log and analyze your blood pressure and heart rate over time so you could see trends on a daily basis rather than behaving in a reactive manner by going to the doctor when you do start to have severe symptoms.

      It's become trivial to get a few basic medical parameters on demand cheaply. A pulse oximeter (heart rate and blood oxygen saturation) costs from $10-$50 for a home version, a blood sugar testing kit is $20+$1/test strip, and an automatic blood pressure cuff system is about $50. They all work well, they usually have storage, and if you're willing to spend more you can probably get a USB version. Heart rate monitors with a lot of memory have been used by athletes for decades. Fully networked versions of all this that give information to your doctor are not far off-- given that the baby boomers are getting older and it will cost too much to have live people monitor them as much as they want. The military is also developing such things so that someone can sit in a dark room in florida and play FPS using live people halfway around the planet, seeing what they see and what their health status is. If you watch high level bicycle racing, the team directors can often get real time data like heart rate and power output of riders.

    20. Re:Great but... by rioki · · Score: 2

      You should invest an hour of your life, it really is worth it.

      To the discussion at hand, sure it is not an end all, but how often I see people doing the same thing in a debugger, only with mouse over variable / watch windows. His approach is essentially the same as many people do in the debugger, only the feedback look is tighter. Sure you still need to know about the problem and solution domain, to isolate boundary conditions; but it surly changes the way you program.

    21. Re:Great but... by Shotgun · · Score: 2

      It's worth a hour. But if you don't want to watch it fine. Just don't expect your comments to be worth anything if you haven't done your homework.

      I'd like to have my hour back actually.

      He said we need to push testing closer to the developer. His algorithm example was simply an demonstration of doing unit tests in real time. It's a good concept, suitable for developing small algorithms, but breaks down quickly once you hit a million lines of code, or have to work with large datasets.

      --
      Aah, change is good. -- Rafiki
      Yeah, but it ain't easy. -- Simba
  2. Connecting to your creation in Clojure by slasho81 · · Score: 4, Interesting

    Here's an implementation of Bret's ideas in Clojure.

    1. Re:Connecting to your creation in Clojure by justforgetme · · Score: 5, Informative

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

      --
      -- no sig today
    2. Re:Connecting to your creation in Clojure by durrr · · Score: 2

      25 minutes of that video involve video examples.

      The rest, perhaps a transcription would do.

    3. Re:Connecting to your creation in Clojure by jythie · · Score: 2, Insightful

      Agreed. I am getting a bit tired of things moving to video only. Videos are hard to skim or speed-read, you have to absorb things at the pace the speaker feels like moving at, which is usually pretty slow/inefficient.

    4. Re:Connecting to your creation in Clojure by nacturation · · Score: 3, Insightful

      And for those decrying the use of video, you'll definitely want to check out Up and Down the Ladder of Abstraction by the same author: http://worrydream.com/LadderOfAbstraction/

      It's a big wall of text with interactive javascript examples and no video.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  3. They invented the debugger! by Giant+Electronic+Bra · · Score: 4, Insightful

    Yeeehaaa! ;)

    The tough problems aren't about running the code and seeing what happens, they're about setting up very specific situations and testing them easily.

    --
    "Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
    1. Re:They invented the debugger! by vlm · · Score: 4, Insightful

      The tough problems aren't about running the code and seeing what happens, they're about setting up very specific situations and testing them easily.

      Handling non-specific unknown/unpredicted situations gracefully is also tough. Unsanitized user input, crazy failure modes, failure in other code making your state machines go bonkers... The trendy thing to do is just throw your hands up in the air and tell the user to reboot and/or reinstall, but that's not so cool.

      Maybe another way to phrase it is at least one of the specific situations needs to be the input of a random number generator doing crazy stuff.

      Your Arabic to Roman numeral converter accepts a INT? Well it better not crash when fed a negative, or zero, 2**63-1 (or whatever max_int is where you live), and any ole random place in between

      --
      "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
    2. Re:They invented the debugger! by ktappe · · Score: 5, Interesting

      The tough problems aren't about running the code and seeing what happens, they're about setting up very specific situations and testing them easily.

      another way to phrase it is at least one of the specific situations needs to be the input of a random number generator doing crazy stuff.

      Your Arabic to Roman numeral converter accepts a INT? Well it better not crash when fed a negative, or zero, 2**63-1 (or whatever max_int is where you live), and any ole random place in between

      This is still archaic thinking. A much more efficient way would be for the IDE to, when specifying a variable, ask there & then what the boundaries of the variable should be. Then the compiler could error any time it saw a situation where the variable could be (or was) handed a value outside those boundaries. Programmers should not be having to catch weird situations over and over; that's what computers are for. Allowing a variable to be any possible INT/FLOAT/REAL just doesn't make any sense in many situations so I'm quite curious why we're still having to even talk about random number generators for debugging & testing. It feels like we're still working for the computers instead of the other way around.

      --
      "We can categorically state we have not released man-eating badgers into the area." - UK military spokesman, July 2007
    3. Re:They invented the debugger! by Anonymous Coward · · Score: 3, Insightful

      This is still archaic thinking. A much more efficient way would be for the IDE to, when specifying a variable, ask there & then what the boundaries of the variable should be. Then the compiler could error any time it saw a situation where the variable could be (or was) handed a value outside those boundaries. Programmers should not be having to catch weird situations over and over; that's what computers are for. Allowing a variable to be any possible INT/FLOAT/REAL just doesn't make any sense in many situations so I'm quite curious why we're still having to even talk about random number generators for debugging & testing. It feels like we're still working for the computers instead of the other way around.

      A good Ada compiler could do this almost thirty years ago, due to the flexibility of the type system. Of course, Ada '83 looked hopelessly complex compared to the other languages of the time such as K&R C. Put that together with the fact that the major users were bureaucratic mega-corps involved in government aerospace projects and it acquired a horrible reputation as a bloated mess.

      Time moved on. C begat C++ and C++ started adding features without much evidence of overall direction. For example it was never an explicit design goal for C++ templates to be Turing-complete. Features were added one after another, and one day someone pointed out that they had gone so far that templates could now be considered to be a language in themselves. Is it a good idea for a language to contain its own embedded meta-language? Is this something that results in maintainable, understandable code that can be analysed successfully? These questions did not matter because template meta-programming 'just happened' as C++ features agglomerated.

      Nowadays the most recent version of Ada (Ada 2012) is probably one of the more straightforward and better designed languages, but its early reputation is unshakable. That's life I guess.

    4. Re:They invented the debugger! by svick · · Score: 2

      It seems to me you're describing is Design by contract. Specifically, Code Contracts in .Net allow you to do this. The compiler there tries to check as much as it can, but checking every situation is simply not possible. It also produces runtime checks, so that your application crashes immediately when the contract is broken, instead of corrupting data.

  4. Conjecture. by tysonedwards · · Score: 3, Insightful

    Until someone actually creates this new mythical language that is proposed by Bret, than this is all conjecture that a hyper-efficient, overly intuitive programming language that can provide immediate feedback would be hyper-efficient, overly intuitive, and provide immediate feedback.

    Basically, the video referenced by the article is no different than "wouldn't it be nice if we were no longer dependent on foreign oil... that would make so many things so much easier!"

    --
    Thirty four characters live here.
    1. Re:Conjecture. by TheRaven64 · · Score: 4, Funny

      Yes, if only there were existing systems that worked that way. Such as the Lisp environment from 1958 or the Smalltalk environment from 1976. Such revolutionary new ideas about programming! I wonder if he will invent automatic refactoring tools next...

      --
      I am TheRaven on Soylent News
    2. Re:Conjecture. by TheRaven64 · · Score: 2

      Not sure why you'd think Lisp or Smalltalk are write-only. Smalltalk is heavily used in the financial industry specifically because it is easy to quickly make significant changes to legacy code.

      --
      I am TheRaven on Soylent News
    3. Re:Conjecture. by Brummund · · Score: 3, Informative

      "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.)

    4. Re:Conjecture. by SJS · · Score: 5, Insightful

      Smalltalk and Lisp are a good example, and they show (to me) that the problem isn't the language. The hard part about programming isn't the code.

      The hard part about programming is understanding and decomposing the problem. If you're not any good at that, then no matter what language you use, you're going to struggle and produce crap.

      This isn't to say that languages aren't important -- different languages lend themselves to particular problem-spaces by suggesting particular solutions. Picking the right language for the problem is as important as picking the right wrench for the nut.

      But there will never be a DWIM language, because the big problem is getting the programmer's brain wrapped around what needs to be done. Once that's done, what's left is only difficult if the programmer doesn't have the figurative toolset on hand.

      --
      Pick One: http://www-rohan.sdsu.edu/~stremler/sigs/sigs.html (Note - disable Javascript first!)
    5. Re:Conjecture. by TuringTest · · Score: 2

      Sure the difficult part is the problem. But if you have the computer doing the trivial and menial parts, the programmers mind will have more brain resources to expend analyzing the problem and thus it will be easier to solve the difficult part.

      --
      Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
  5. Wait by bytesex · · Score: 4, Insightful

    Someone re-invented scripting languages ?

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
    1. Re:Wait by gl4ss · · Score: 4, Insightful

      well. yes. but sold the idea as having someone(the computer, AI) to magically setup the situation you were thinking of when writing that code too.

      it's very easy to demo the benefits with something that for example just draws something, but such game engines have been done before and isn't really that different from just editing the code in an svg- however as you add something dynamic to it... how is the computer supposed to know, without you instructing it? and using mock-content providers for realtime ui design is nothing new either so wtf?

      --
      world was created 5 seconds before this post as it is.
  6. Fine. by Kickasso · · Score: 2

    Now go program me a nuclear reactor control system with this.

    1. Re:Fine. by Kickasso · · Score: 2

      So nuclear reactors are out. Can you program a firewall this way? What about an airline ticket reservation system? A compiler, maybe? A web browser?

      His design is very good for instant unit testing, which is fine and dandy and I'm all for it.

    2. Re:Fine. by plover · · Score: 2

      Are you saying that trial and error isn't appropriate for a system that cannot fail even one time?

      I think it'd be very appropriate to build reactor control software with tests. Lots of tests. Lots and lots of tests. And you can simulate every device out there, you can simulate what happens when pressure builds or releases unexpectedly, you can simulate what happens when the operator pours his pepsi down the control panel and provides you with non-sensible inputs, etc.

      Matter of fact, I can't see any other way to build safety critical software. Not just testing the hell out of it, but designing it to be testable in the first place.

      --
      John
  7. Re:Not intended for slashdot by plankrwf · · Score: 2

    Just replying to myself, did not plan for the post above (yes, a first post!) to be made anonymous...

  8. Sounds like they have a GUI REPL by istartedi · · Score: 4, Insightful

    Unless somebody wants to give a better executive summary, there's no way I'm weeding through an hour of video. Do they have any idea how many hours there are of "the one video you must see this year" on YouTube?

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:Sounds like they have a GUI REPL by Twinbee · · Score: 4, Insightful

      Okay, let's give this a go, well the first 25 minutes anyway. He's talking about seeing the effects of programming not after compiling and running, but while you're actually *typing*.

      The first example (with the fractal tree) is interesting. He changes a number in the code, and the trunk gets taller, or the number of leaves grow. He then adjusts the variable in the code as if it were a slider, and the picture updates accordingly in realtime.

      Second example is a platform game. He is able to user a slider to go back and forwards throughout time, and change certain parameters such as the gravity, or speed of the enemy turtle. To solve a problem at the end where he wants the character to jump at a very particular height, he employs a 'trail' of the character over time (so you can see all of 'time at once'). Adjusting the variable he can get that perfect jump height more intuitively. The 'character trail' changes in realtime as he adjusts the variable.

      The third example is where he talks through a binary search algorithm. Usually, you're blind as you have to figure out what the computer is doing behind the scenes. But let's say you can see the output as you're typing. The numbers of variables are drawn to the right as you're typing. If there's a loop, then there will be more than one value. In this case, the values are segmented horizontally in the output.

      I've thought of a lot of the things that this guy has said (and even semi-planned to incorporate his third idea into my OpalCalc program shown in my sig), but a couple of things were moderately surprising, and it's nice to see it all in action.

      --
      Why OpalCalc is the best Windows calc
  9. Been There Done That. by Anonymous Coward · · Score: 4, Informative

    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.

  10. Re:An observation... by vlm · · Score: 3, Insightful

    If you need to "run" code, either in your head or on a computer, in order to see what it's going to do, you're probably not really programming and you're definitely not an engineer.

    Would be a better post if you explained the "right way", hopefully its not mysticism.

    Whats wrong with processing this line of perl in your head according to the rules to figure out what it does? (admittedly I have no idea why the heck you'd want to do this, but its the simplest example I can think of using about 3 key perl concepts...)

    s/(.*):(.*)/$2:$1/;

    The other aspect has to do with new code vs maint (even maint of my own code). If I have no idea what I'm doing with my own freshly written code, thats just wrong... but old code always has some element of intense CSI work to figure out what it does before I can modify it..

    --
    "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
  11. Obligatory Dijkstra by 1729 · · Score: 4, Insightful

    "I remember how, with the advent of terminals, interactive debugging was supposed to solve all our programming problems, and how, with the advent of colour screens, "algorithm animation" was supposed to do the same. And what did we get? Commercial software with a disclaimer that explicitly states that you are a fool if you rely on what you just bought."

    From http://www.cs.utexas.edu/~vl/notes/dijkstra.html.

    1. Re:Obligatory Dijkstra by Barbara,+not+Barbie · · Score: 2

      I'd argue that colour screens did give us a big, obvious, and immediate improvement - syntax highlighting. No having to learn some new technique or method - just open your existing code and the editor highlights it accordingly. Off-hand, I can't think of anything else that, by itself, had as much of an impact across all programming languages.

      --
      Let's call it what it is, Anti-Social Media.
    2. Re:Obligatory Dijkstra by A+beautiful+mind · · Score: 2
      I giggled like a schoolchild when I've read the next paragraph from that lecture:

      And now we have the multimedia/communication hype: the best bits are those that just arrived from far away, and if you are not "on line", "on the Net", you just don't count, you are not of this world (which is virtual anyhow...). Apart from a change in vocabulary, it is the same hype, the same snake oil over and over again, and you can do me a favour by not getting excited by all the time you are supposed to save by switching to "home banking".

      Sometimes very smart people can be mostly insightful, but very spectacularly wrong on some points.

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    3. Re:Obligatory Dijkstra by Raenex · · Score: 2

      Sometimes very smart people can be mostly insightful, but very spectacularly wrong on some points.

      Dijkstra turned into a figurative monk in his later years, dedicating himself to austerity and impractical principles. Kinda like Stallman is for "Software Freedom". There's some value in that, but the rest of us need to get work done, perfection being the enemy of the good.

  12. My boss sent me this drivel as well by AdrianKemp · · Score: 4, Funny

    It is the most worthless, dumbass thing I've ever had to sit through.

    It's just another "wouldn't it be great if computers programmed themselves" video by someone too stupid to tie their own shoes.

    I know what the code I'm writing is going to do *before* I start writing it, as I hope for the love of god most programmers do.

    In fact, the biggest plague on programming ever has been this concept that changing what you want fifteen times along the way is perfectly okay and we just need to adapt methods to that idiocy. You don't need any of this crap if you just know what you want ahead of time.

    1. Re:My boss sent me this drivel as well by BasilBrush · · Score: 2

      It's "you morons", not "your morons and", and a sentence starts with a capital letter. What's the matter, didn't you know what the sentence was going to be before you wrote it?

  13. This interactive language already exists. by Anonymous Coward · · Score: 4, Interesting

    It's called Python. I use the interactive interpreter to test snipets of code al the time. This makes me 4 times more productive than Java, for example.

  14. Turbo Pascal by liquidhokie · · Score: 2

    'nuff said

  15. Re:An observation... by bbn · · Score: 2

    Looking at your expression I do not think I "ran" it in my head. Rather i "understood" it the same way I look at an equation.

    Generally I do not find myself simulating the running of code when I look at a program. I only do that when the code is overly complicated and hard to understand. Or if it is a clever algorithm that I do not already understand.

    This is even more true for functional languages. Looking at some Haskell program it is not even always clear how the computer is going to "run" it. You look at it as a set of equations.

  16. Re:An observation... by Anonymous Coward · · Score: 5, Funny

    I'd guess it slips a $1 and $2 bill into a stripper's titties by the looks of it.

  17. This concept has already been in use for some time by danomatika · · Score: 2

    ... in the creative coding community.

    Patchers like Max and Pure Data allow for realtime graphical programming and live coding environments such as Fluxus exist for realtime graphics and sound. Max was originally written by Miller Puckette in the mid 80s for realtime control of DSP for computer music at IRCAM and Pure Data, started in the mid 90's, is his open source take on addressing some of it's design issues. Fluxus originates from around 2000 as is a live 3d engine for performance using a Lisp varient as the on screen scripting language.

    Yet another case of artists/scientists providing a working solution to a particular problem not apparent to other disciplines. Too bad Bret dosen't cite these examples. Perhaps he dosen't know of them?

    Bret's argument that realtime feedback is important to creative flow is spot on. I don't think he's calling for the use of this approach as a panacea. Naturally it won't work in all cases but anything that helps with problem solving is welcome in my book. It's not a replacement for deep understanding but really allows you more creative freedom which, as other posted have noted, is useful in creative graphics/sound programming.

  18. But we already have it! by Cyberax · · Score: 2

    We already have something like it: IDEs for typed languages with strong inspections.

    When I'm writing something my IDE helps me by highlighting possible errors or undesirable effects. That's not the 'visualization' stuff the author's talking in the article, but it's actually useful.

  19. It's all about efficient resource management by TuringTest · · Score: 2

    If you need to "run" code, either in your head or on a computer, in order to see what it's going to do, you're probably not really programming and you're definitely not an engineer.

    Sure, you can do that in your head. They got to the moon with an abacus and some slide rules, so why do we need computers again?

    That you can make it in your head doesn't mean that you should. Human brains are incredibly slow and error-prone at recall and logic, the primary strengths of computers. On the other hand our brains are evolutionary-level good at recognition and pattern matching.

    This should make obvious the conclusions in the video: letting the computer do the recall and logic inferences, and the human the thinking and pattern matching, will produce a much more efficient system, two or three orders of magnitude higher than having the engineer produce all the derivations in his head.

    It's a shame to the profession that so many slashdotters will laugh and dismiss the idea, and a sign of how incredibly conservative are programmers when it comes to the tools of their trade. In special because these ideas were already implemented and tested in academai before our current batch of business tools (C, Unix and IDEs) were developed, and then abandoned only because they were more difficult to teach even if they were more powerful to use. There, I have said it.

    --
    Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
  20. Strict Typing by pavon · · Score: 2

    We have languages that force you to define the allowed range of an integer every time you define it (like ADA), and static analysis tools that find many of these problem. Entering this information into a dialog box wouldn't be any faster than typing it into the source code. The problem is that programmers consider these languages to be too cumbersome, and using such tools on other languages has too many false positive. They would rather have freeform languages like python, which are faster to program and easier to read, but don't catch these types of errors for you, and instead require more discipline in unit testing (which is good to have anyway).

  21. Re:Not intended for slashdot by Barbara,+not+Barbie · · Score: 2, Insightful

    It was in the firehose a few days ago and I down-modded it because (1) the idea was stupid, (2) the article did not give anything but the vaguest hand-waving of explanations, and (3) there is no way someone is going to sit through an hour video if the blogger can't even bother to provide a half-decent summary - which is why I labeled it as binspam ... it's just link bait.

    --
    Let's call it what it is, Anti-Social Media.
  22. The biggest Mistake Today by prefec2 · · Score: 4, Insightful

    Most programmers think, that coding takes the most part of the development. In some cases they would admit that testing is also very time consuming. But the real issue is the understanding of the problem. A lot of programmers design while their code. This results in strange development cycles which also includes trying to understand what the program does. As this can be done with a debugger, an interpreter or a trace analysis tool. The real issue is the problem description. First, understand the problem and its borderline cases. Second, come up with a solution for that problem. And third, try to implement it.

    BTW: Most programs of today do not contain that many surprising new algorithms. They collect data, the validate data to some constraints, they store data, they provide an interface to query the data. In desktop applications like Inkscape or Word the data is stored in in memory models. And there exist serializers and renderers for the content. So the code as such is not hard to understand, as we all know such structures.

    1. Re:The biggest Mistake Today by TuringTest · · Score: 2

      And why would it be a bad practice using a computer to analyze the available data to discover the possible cases that must be covered, and thus understand what the program needs to do? Sure, the final released code should not contain the tests implemented for the first assumptions about data. But understanding the problem is easier if you can run a primary version of the basic program logic on live data.

      --
      Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
    2. Re:The biggest Mistake Today by prefec2 · · Score: 3, Insightful

      No. My argument is: You have to understand the problem and its cases first and then code it. At least that is what we learned from the analysis of different software development methods. Some developers think that the perfect model to fit all cases will emerge when they code. This is true for very small problems, where they can keep the cases all in their head. As an alternative you could come from the cases. Define your input and desired output and all parameters which effect the result. You define your constraints. If you believe in a strict test driven development, you even could design the tests. then you divide the problem and specifies the different sub-problems before you try to implement that in C, Java, Fortran, Cobol etc.

      Your argument is:You start with some input (subset of the real input or maybe a specification of the input) and a desired output. Then you fiddle around and try to come up with a suitable transformation which reads the input and provides the desired output. To "test" if it works you run it with input data. When it does not suit your needs you modify the transformation code. On a sample input basis you cannot know all alternatives of input look like. And if you have just a specification of input code, you have to generate suitable input from that specification.

      My proposition is, if you know what the input is and what the output is and what the cases are, you should be able to come up with a specification for the transformation before you implement it. The specification is then the model for the implementation. That approach is much saver and you can even try to proof if the code is supporting all specified input. I know most people work differently. But it is expensive and results in long coding nights and a lot of extra hours.

    3. Re:The biggest Mistake Today by TuringTest · · Score: 2

      You have to understand the problem and its cases first and then code it. At least that is what we learned from the analysis of different software development methods

      That is the myth of the classical waterfall model. It assumes that you can and already do understand the whole problem in advance. As I said in another thread, that only works if you already have a model for the problem, maybe because it's a classical problem in physics or math. What I say is that you can use software to develop a new model; in that case the first iterations will be necessarily fragile, because you don't know what the possible cases will look like.

      My proposition is, if you know what the input is and what the output is and what the cases are

      Yup, that makes sense when you know the input and the output. I'm interested in the case when you don't know them and have to find them by exploring the real world with which the program interacts, ideally by using the scientific method (trial and error). We are saying nearly the same, just approaching different classes of problems.

      --
      Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
  23. Re:An observation... by vlm · · Score: 2

    I'd guess it slips a $1 and $2 bill ...

    Oh so close. She dances over to you with somebody elses one dollar bill in the left cup and a two dollar bill in the right cup and this magically swaps the $1 into the right cup and the $2 into the left cup without using a third cup, or even a hand. So it is essentially the popular internet meme "1 Girl 2 Cups". Even worse, a sharp eye can see the process involves a colon in the regex... This is going downhill fast...

    Three obvious ? perl concepts and the pitfalls surrounding them are:
    1) You're operating on the default variable $_. If a single variable chugs thru a dozen processing steps you don't have to name it each time. This is a complete statement, not just the right side of an equation.
    2) s/"before"/"after"/ is the simple search and replace operator. Guess how many times it S+Rs? There are options to control this other than the default and noobs always assume the default for s is what they want and it never turns out that way...
    3) If your regex matches something in parenthesis, later on you can access whatever that found using positional variables $1, $2, you get the idea. This is why perl is not amused at the idea of user variable names beginning with digits. Why does perl count regex matches from $1 instead of $0 like you'd expect? Well $0 means something completely different, thats for sure...

    --
    "Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
  24. Reasonable idea, terrible article by Animats · · Score: 3, Informative

    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.

  25. Re:An observation... by TuringTest · · Score: 4, Interesting

    You approach makes lots of sense for writing mathematical of physical code, where you have a perfect model of the world that is the basis of the problem to solve. Your ancient Slashdot ID seems to indicate that this is the kind of that you have experience with; that, or the essential infrastructure for big businesses, which is similarly model-based.

    But when your program is for a specific business flow application, for which there is no model and the logic and corner cases must be elucidated from the client by showing a partially working prototype, the only way to extract all the requisites for the program is to throw in a few lines, show it to the user and ask what it's missing or how the current version is wrong, and then fix it; because the program's behavior has not been fully defined yet when the first version was written, it's d^Hrefined as a reaction of the working code.

    --
    Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
  26. Re:understanding by doing... faster by Alex+Belits · · Score: 5, Insightful

    Congratulations, you are an idiot.

    "Tests", no matter how numerous, cover an infinitely small fraction of possible instances of your code being used (that would be an infinite number of, unless you take into account the maximum lifetime of the Universe). They are supposed to assist a developer finding some faults in his reasoning, nothing more than that.

    --
    Contrary to the popular belief, there indeed is no God.
  27. This isn't new by Murdoch5 · · Score: 2

    I'm wondering whats really new about this video?

    The traditional "good programming" method is actually a horrible programming method, if you can't read and understand your code like reading a book then your not really a "good programmer" and your not really a "talented programmer".

    A compiler is one of the last steps in the process, you should know before you compile if your code will work. Interacting programming just helps people learn better programming. You can write C or Assembler and if you truly are a talented programmed you know well writing your code what will happen. When schools or even work places teach programming they teach it in a structures and very formal way, code like any language is an expression and it should be taught in the same way.

    Would you teach an artist to paint by following numbers? Would you teach an english student to write but following a script? Then why teach programming by teaching strict methods and formal standards?

    Good programming means looking past the code and writing code like you write book or paint a picture, you need to picture whats happening 10 steps ahead of where you are and how to get around problems before they occur, I don't think this video / article is new but I do think it might finally make some of the trolls on this site who cry and moan about structured coding a mute button.

    Interactive programming can be made interactive by the programmer and a "good programmer" can write any language interactively by thinking ahead of where they need to be. Programmer who can't really do have one arm behind there back but not tied! I do know some classic programmers who are jedi's in the art, but most programmers who can't preform interactive programming are programming with a blind fold on and with one hand, it's not pretty.

  28. Re:An observation... by Cow+Jones · · Score: 4, Informative
    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".

    --

    Ah, arrogance and stupidity, all in the same package. How efficient of you. -- Londo Mollari
  29. Fuzz testing by tepples · · Score: 2

    at least one of the specific situations needs to be the input of a random number generator doing crazy stuff.

    You're by far not the only person to reach this conclusion.

  30. Re:That's not really the point by istartedi · · Score: 2

    140 characters may not be enough; but an hour of vid is too much. Can you add anything to TwinBee's post above? I think he answered my question the best. To reiterate, there are a lot of great researchers out there, and a lot of people like yourself who will tell me their ideas deserve my attention. Your whole line of reasoning is "this one is special". Sorry. That's just an assertion.

    Personally, I think Manfred Von Thun who you may not have heard of is really great for having shown us the Joy programming language. That doesn't mean I'm going to tell you "it's your loss" because you don't want to spend the better part of a week reading his papers.

    You could read the Wikipedia article on it very quickly instead.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  31. Re:languages by swillden · · Score: 2

    there was a report a few years ago about an entrepreneur who *refused* to employ computer science majors. he only employed english language majors. the reason was he said that it was easier to communicate with english language majors in order to teach them programming, and they were more effective and also worked better when introduced into teams, than the people who had been taught programming at university.

    I think there's a reason we don't all know this entrepreneur's name and abbreviated life history.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.