<p>For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a "compile and run" only language?</p>

<p>Added clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languages that are used for full blown apps, but also have a way to run small snippets of code in a console.</p>

[{'answer_id': 32557, 'author': 'EBGreen', 'author_id': 1358, 'author_profile': 'https://Stackoverflow.com/users/1358', 'pm_score': 1, 'selected': False, 'text': '<p>I think it depends on the console. The usefulness of a CMD console on windows pails in comparison to a Powershell console.</p>\n'}, {'answer_id': 32588, 'author': 'Pat', 'author_id': 36, 'author_profile': 'https://Stackoverflow.com/users/36', 'pm_score': 0, 'selected': False, 'text': "<p>I've added a shortcut to my Control-Shift-C key combination to bring up my Visual Studio 2008 Console. This alone has saved me countless seconds when needing to register a dll or do any other command. I imagine if you leverage this with another command tool and you may have some massive productivity increases.</p>\n"}, {'answer_id': 32599, 'author': 'Ben Collins', 'author_id': 3279, 'author_profile': 'https://Stackoverflow.com/users/3279', 'pm_score': 0, 'selected': False, 'text': "<p>Are you kidding?</p>\n\n<p>In my Linux environment, the console is my lifeblood.  I'm proficient in bash scripting, so to me a console is very much like sitting in a REPL for Python or Lisp.  You can quite literally do anything.</p>\n\n<p>I actually write tools used by my team in bash, and the console is the perfect place to do that development.  I really only need an editor as a backing store for things as I figure them out.</p>\n"}, {'answer_id': 32686, 'author': 'Joseph Pecoraro', 'author_id': 792, 'author_profile': 'https://Stackoverflow.com/users/792', 'pm_score': 3, 'selected': True, 'text': '<blockquote>\n  <p>I am thinking more along the lines of Ruby, ...</p>\n</blockquote>\n\n<p>Well for Ruby the <code>irb</code> interactive prompt is a great tool for "practicing" something simple.  Here are the things I\'ll mention about the irb to give you an idea of effective use:</p>\n\n<ul>\n<li><p><em>Automation</em>.  You are allowed a <code>.irbrc</code> file that will be automatically executed when launching irb.  That means you can load your favorite libraries or do <em>whatever</em> you want in full Ruby automatically.  To see what I mean check out some of the ones at <a href="https://web.archive.org/web/20110824004021/http://dotfiles.org:80/.irbrc" rel="nofollow noreferrer">dotfiles.org</a>.</p></li>\n<li><p><em>Autocompletion</em>.  That even makes writing code easier.  Can\'t remember that string method to remove newlines?  <code>"".ch&lt;tab&gt;</code> produces chop and chomp.  <em>NOTE: you have to enable autocompletion for irb yourself</em></p></li>\n<li><p><em>Divide and Conquer</em>.  irb makes the small things really easy.  If you\'re writing a function to manipulate strings, the ability to test the code interactively right in the prompt saves a lot of time!  For instance you can just open up irb and start running functions on an example string and have working and tested code already ready for your library/program.  </p></li>\n<li><p><em>Learning, Experimenting, and Hacking</em>.  Something like this would take a very long time to test in C/C++, even Java.  If you tried testing them all at once you might seg-fault and have to start over.</p>\n\n<p>Here I\'m just learning how the <code>String#[]</code> function works.</p>\n\n<pre><code>joe[~]$ irb\n&gt;&gt; "12341:asdf"[/\\d+/]\n# =&gt; "12341"  \n&gt;&gt; "12341:asdf"[/\\d*/]\n# =&gt; "12341"  \n&gt;&gt; "12341:asdf"[0..5]\n# =&gt; "12341:"  \n&gt;&gt; "12341:asdf"[0...5]\n# =&gt; "12341"  \n&gt;&gt; "12341:asdf"[0, \':\']\nTypeError: can\'t convert String into Integer\n  from (irb):5:in `[]\'\n  from (irb):5\n&gt;&gt; "12341:asdf"[0, 5]\n# =&gt; "12341"  \n</code></pre></li>\n<li><p><em>Testing and Benchmarking</em>.  Now they are nice and easy to perform.  <a href="http://ozmm.org/posts/time_in_irb.html" rel="nofollow noreferrer">Here</a> is someone\'s idea to emulate the Unix <code>time</code> function for quick benchmarking.  Just add it to your <code>.irbrc</code> file and its always there!</p></li>\n<li><p><em>Debugging</em> - I haven\'t used this much myself but there is always the ability to debug code <a href="https://web.archive.org/web/20080912141043/http://www.rubycentral.com:80/pickaxe/trouble.html" rel="nofollow noreferrer">like this</a>.  Or pull out some code and run it in the irb to see what its actually doing.</p></li>\n</ul>\n\n<p>I\'m sure I\'m missing some things but I hit on my favorite points.  You really have zero limitation in shells so you\'re limited only by what you can think of doing.  I almost always have a few shells running.  Bash, Javascript, and Ruby\'s irb to name a few. I use them for a lot of things!</p>\n'}, {'answer_id': 36446, 'author': 'asussex', 'author_id': 3796, 'author_profile': 'https://Stackoverflow.com/users/3796', 'pm_score': 1, 'selected': False, 'text': '<p>You didn\'t say what OS you\'re using but on Linux I been using a tabbed window manager (<a href="http://www.suckless.org/wmii/" rel="nofollow noreferrer">wmii</a>) for a year or so and it has radically changed the way I use applications - consoles or otherwise.</p>\n\n<p>I often have four or more consoles and other apps on a virtual desktop and with wmii I don\'t have to fiddle with resizing windows to line everything up just so. I can trivially rearrange them into vertical columns, stack them up vertically, have them share equal amounts of vertical or horizontal space, and move them between screens.</p>\n\n<p>Say you open two consoles on your desktop. You\'d get this (with apologies for the cronkey artwork):</p>\n\n<pre><code> ----------------\n|                |\n|       1        |\n|                |\n ----------------\n ----------------\n|                |\n|       2        |\n|                |\n ----------------\n</code></pre>\n\n<p>Now I want them side-by-side. I enter SHIFT-ALT-L in window 2 to move it rightwards and create two columns:</p>\n\n<pre><code> -------  -------\n|       ||       |\n|       ||       |\n|   1   ||   2   |\n|       ||       |\n|       ||       |\n -------  -------\n</code></pre>\n\n<p>Now I could open another console and get</p>\n\n<pre><code> -------  -------\n|       ||   2   |\n|       ||       |\n|       | -------\n|   1   | -------\n|       ||   3   |\n|       ||       |\n -------  -------\n</code></pre>\n\n<p>Then I want to temporarily view console 3 full-height, so I hit ALT-s in it and get:</p>\n\n<pre><code> -------  -------\n|       | -------\n|       ||       |\n|   1   ||   3   |\n|       ||       |\n|       ||       |\n -------  -------\n</code></pre>\n\n<p>Consoles 2 and 3 are stacked up now.</p>\n\n<p>I could also give windows tags. For example, in console 2 I could say ALT-SHIFT-twww+dev and that console would be visible in the \'www\' and \'dev\' virtual desktops. (The desktops are created if they don\'t already exist.) Even better, the console can be in a different visual configuration (e.g., stacked and full-screen) on each of those desktops.</p>\n\n<p>Anyway, I can\'t do tabbed window managers justice here. I don\'t know if it\'s relevant to your environment but if you get the chance to try this way of working you probably won\'t look back.</p>\n'}]
['https://Stackoverflow.com/questions/32537', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2001/']