News for hackers. Stuff that matters.
Re:Reasons To Give The Vim Text Editor A Chance by japherwocky on Sunday May 15, 2011 @10:49PM (#2551447)
Someday, you'll get to work in a language that has a good REPL, and you'll never want to go back to printing. :)
Re:Reasons To Give The Vim Text Editor A Chance by phaylon on Monday May 16, 2011 @11:07AM (#2552739)
I'm sorry, but this is condescending and simply false, even with the smiley face. I use output for inspection in Perl, Scheme, Javascript, and for (what are in my world) good reasons. The print statement usually doesn't influence the running program in any way. That means no matter who wrote the interpreter/compiler, the debugger, or whatnot, the printing won't have much influence on the program. But I've heard "Why is this bug only showing up in the debugger?" more than once in my time.
Re:Reasons To Give The Vim Text Editor A Chance by jrockway on Monday May 16, 2011 @12:36AM (#2551658)
Someday, you'll want to run your code more than once, and you'll write tests instead of typing them into the REPL.
Re:Reasons To Give The Vim Text Editor A Chance by eropple on Monday May 16, 2011 @10:06AM (#2552528)
Print statements aren't meaningful tests, though. Hence the eight hojillion xUnit ports for pretty much every major language.
Re:Reasons To Give The Vim Text Editor A Chance by jrockway on Tuesday May 17, 2011 @02:04AM (#2555472)
OK, so say you have some test that creates a foobar object and invokes the method baz, which does some stuff that you care about. The test fails. What do you do? Do you pick apart the implementation of baz in the REPL, or do you add some print statements inside baz?

The second option is easier. You obviously remove them once your understanding (and tweaking) of the code leads to a passing test.

Re:Reasons To Give The Vim Text Editor A Chance by japherwocky on Tuesday May 17, 2011 @01:00PM (#2556966)
you set a trace point inside baz, investigate with the REPL, and fix your code.
Re:Reasons To Give The Vim Text Editor A Chance by japherwocky on Monday May 16, 2011 @04:19PM (#2553997)
wait.. what? are you scanning stdout with your tests?