tags:

views:

118

answers:

7

I'd like to introduce my young cousin to a bit of programming. Ideally ruby, as that's what I'm familiar with. However finding a suitable text editor is a real pain. All I need of the editor is the ability to type a few lines of code, press 'Run' and get some results (or not, as the case may be). The simpler the editor the better, I don't need Netbeans, Eclipse etc. What I want to avoid is the necessity of using the terminal to run scripts, TextWrangler, Textmate and IDLE for Python can do this. Unfortunately I need something that will work on Windows, or Ubuntu, otherwise I would have just installed Textmate on his laptop.

Any suggestions would be greatly appreciated.

A: 

I've used SciTE before for that sort of purpose. It reportedly works on Linux as well as Windows, but I haven't tried the Linux version myself.

Anna Lear
A: 

Take a look at FreeRIDE for an IDE-type solution. You can also run code directly from the SciTE editor.

bta
+2  A: 

You can do this in SciTE, which is bundled with the Windows Ruby installer or can be downloaded here. Click Tools > Go or press F5. It's an all-around good (and fast) editor with not a lot of bells and whistles.

This might require some configuration to make sure SciTE knows where your Ruby executable is. I believe the configuration for this is in Options > Open ruby.properties > command.go.*.rb.

Jordan
Thanks to everyone for their suggestions so far. I have a question regarding SciTE. I've just installed it for Ubuntu to do a quick test. The ability to get user input is really important, so that I can do something simple like ask for a name and then return how many characters are in the name, etc. Unfortunately SciTE didn't appear to allow user input by using 'gets.chomp'. Is there something obvious that I'm missing?
alister_c
Oh, good question. I haven't tried this myself, but anecdotal evidence indicates that if you click in the output pane you should be able to enter text: http://www.megasolutions.net/ruby/Input-syntax-29324.aspx Sorry I can't test this as I'm not on a Windows machine right now. Good luck!
Jordan
I've been battling with SciTE, trying to get it to accept standard input with 'gets', (also tried python's 'raw_input') but to no avail. Could be just an issue with SciTE on Ubuntu. Can't test it on Windows till tomorrow. Wishing for an easy life.
alister_c
+2  A: 

On Ubuntu... How about the good old Gedit application? The Tool Launcher Plugin will enable you to run any external task (including the execution of the current open file.

Brian
I'll certainly give this I try, though I was hoping for a 'just works out of the box' experience, as I won't be there to guide him through the necessary steps in person. It would be great to just say download and install this and here's your first program: puts "hello world".
alister_c
+1  A: 

redcareditor has a "run" option under plugins -> execute

it's quick and dirty :)

rogerdpack
A: 

Well, on Windows, you can get E-Text Editor. It's basically a TextMate clone for Windows that runs TextMate commands and snippets.

30 day trial, then a little under $50 for full version.

I have no affiliation with the creators/owners of E-Text Editor

Andy_Vulhop
A: 

Many thanks for all the suggestions, though having tried multitudes of editors, the option I've went with is Geany. http://www.geany.org/

I couldn't get ScITE to work properly with standard input on either Windows or Ubuntu. Ruby is a great language that could also be attractive to absolute beginners, however, the fact that the ruby installer does not include a basic editor that can be used in a self contained manner (to write and run scripts) really hinders its use for beginners.

This struggle to find an editor that could be used for writing and running ruby scripts almost had me resorting to python!

alister_c