Ruby and IDE

G

Guillaume Marcais

See, that's the problem. When you *can* use Emacs or vi decently, the need
for an IDE doesn't really seem to be there.

I am a little bit in the same boat. I regularly try Ruby editors/IDE.
But so far, they have not provided enough of an increase in features and
productivity that they justified to switch (and get used to a new
environment, work flow, key bindings, etc.). No religious thinking here,
the day I see a clear advantage in using an IDE for Ruby, I'll switch.
But for now Emacs does it for me.

That said, I sincerely hope great IDEs will emerge for Ruby.

Guillaume.
 
A

Alex the_mindstorm Popescu

-----Original Message-----
From: Austin Ziegler [mailto:[email protected]]
How many of your 2000 classes are *useful* classes that do
real work? How many of your 2000 classes are necessary because
of the nightmare that is Java enterprise application
programming? (When I looked at "Code Generation in Action", I
was amazed at how many classes had to be generated for a
single table/view combination.)

Are we questioning here the value of the project? Hmmm... I think this will not solve anything. But
if you want to go this way let's compaire:
No of. classes: (except generated code): aprox.2000
Total SLOC: aprox. 600k
Time of development: 5 years
Team: 10-12 people
Investment: aprox. 1.5 mil.$

Do we still compare? I think there no point in such a comparison. There is also no point in
comparing Java (language at choice) and Ruby capabilities. I was talking (in fact asking) about
editors/ides.
Then you are interpreting this incorrectly, at least for Ruby.
You can use any editor to work with Ruby.

Yes I know this. I am not talking about writing code in notepad ;-). Surely you can do that. But
efficiency is something very important.
There is some
support for Ruby in the major cross-language IDEs, but Ruby is
a notoriously difficult language to provide full IDE capabilities for.

This is the point I have agreed from the beginning. Still I believe that with the right effort,
something can be done.
Mmmm. I don't necessarily agree. An IDE can help, certainly,
with things that are difficult to remember often. An IDE can
also provide an environment for bad code. In the Java world,
an IDE is almost certainly necessary to deal with the idiocies
behind the library design. In the MS world, an IDE is almost
certainly necessary to deal with the massive API set (and some
of the idiocies behind the library design).

In Ruby, I think that an IDE is much less necessary and
useful. Code completion is very unlikely to be possible on a
Ruby IDE, at least inasmuch as developers have come to expect
with IDEs for statically typed languages.

Can you point me to a Python IDE or three? I'd like to look at
them to see if they come close to what VisualStudio can do, even, for
C++.

I am not doing development with Python, but a branch of my co. is using Komodo (ActiveState if I
remember well) and they are happy with it. Take a look.


[Christian Neukirchen]
Well, you obviously forgot that Java forces you to use one file per class (or did they change that stupid requirement recently?).
I couldn't deal with 2000 files in Emacs either, but 35 files and the same LOC would be no problem
(esp. as you focus on a handful at once >only). :)

sorry I don't get you. I can obviously write down a 50k source, but is this the solution? No it is
not. Every language has its own stuff. I was not asking about doing Java dev with Ruby. Still I can
assume there are projects that are bigger than 50 sources.

[Ben Giddings]

I agree with many of the things you are saying. You could still use emacs for other stuff editing,
and still have a powerful Ruby env. Not everybody is switching languages all the time during
development. I was looking from this perspective.

[Thursday]
I am developing in Java (where I have a lot of choices), C++ (Visual Studio), a little Perl (vim,
but I know ActiveState has powerfull support here). I cannot enumerate any other languages and their
prefered envs, as I think this is mainly a personal stuff.


Let me explain my thoughts again:
1/ I am not questioning the power of a language vs its tool support. I think I can find good
points/bad points everywhere. Any ratio comparison will not help. There will be always very large
projects.
2/ I am not questioning the correctness of a project design.
3/ I agree dynamic typed languages are hard to support features from static typed languages. Pls
read John Wells' answer. There is value in there ;-).
4/ I see the power in vim (and believe the guys talking about Emacs power). I am only saying that I
feel something more can be done.



(I don't want to fall into that troll - Ilia stuff here. I am sorry I don't think/feel as you. At
any point you can say that I must stop and I will. I respect everybody and everybody's work).

cheers,
--:alex |.::the_mindstorm::.|
 
L

Lothar Scholz

Hello Alex,


AtP> Are we questioning here the value of the project? Hmmm... I
AtP> think this will not solve anything. But
AtP> if you want to go this way let's compaire:
AtP> No of. classes: (except generated code): aprox.2000
AtP> Total SLOC: aprox. 600k
AtP> Time of development: 5 years
AtP> Team: 10-12 people
AtP> Investment: aprox. 1.5 mil.$

At the moment this is difficult. When i started my IDE i looked for
the largest available open source ruby project to use this as a sample
and try my ideas on this project. But i was not able to find anything larger
then a few dozens of files compressed to a gzip larger then
100 KB. The code densitiy of ruby and rails my be amazing at the first look but
i'm not sure how this would scale.

At the moment i don't think ruby is a good choice for projects of this
scale. My experience which such projects is that a lot of problems
come from changing persons during the development cycle. And thats
where every IDE is a huge improvement over a pure editor.
An IDE (and some methodology, coding conventions that must be
enforced) are very important if someone else must
read the code and extend code someone else has written.

This is just a different viewpoint then mostpeople in this forum have.
Because idoubt that many are working in larger teams on larger projects.
At least i never found team related comments/questions in the postings i read.

And don't think that my argument is that Arachno Ruby is that super
IDE that supports this right now. Thats why the version number is
still 0.5.x.
 
A

Aredridel

BG> Emacs and vi are astounding at editing text. I doubt there's
anything out
BG> there that can do more. They also happen to have some pretty good support
BG> for a whole lot of different languages.

I enjoy vi as part of a whole system.

gdb or ruby -rdebug for debugging. vi for editing. make and rake for
build automation. I assemble this small arsenal of tiny tools, and the
learning curve drastically shallows as I learn, because what works on
the shell works within vi (!!yourcommandhere), and the tools all work
together, because they have to, not out of explicit support for each
other.

Ari
 
L

Lothar Scholz

Hello tsuraan,

t> Not sure what a "project" is in this context, but I think the real
t> problem is that quite a few ruby libraries are rather dynamic: have a
t> look at soap4r and the recently launched classifier library. When you
t> use those, the methods that you're using most don't exist until
t> runtime; especially with soap it would be very difficult to do code
t> completion properly. I'm also a Ruby newby, so I can't say how common
t> runtime method additions are, but from what I've seen they are rather
t> popular, and they make code completion nearly impossible.

You are right for things like SOAP or any other (distributed) technique
that simply dispatch message names. But we can handle the other case
more or less easily. My example is always TK as this builds a lot of
methods at runtime. In this cases you can simply dump the ruby code image
at the end of a script run and melt the information in this dump
with the data already in the repository. Method addition
is popular, method removal is not popular so it should work.

We are using a different type of language but too many people still
think in static terms. A completition popup can't look the same as in
java/C++ and the data gathering phase can't work with static source
code analysis alone. I'm not a mac guru, but follow apple and

"Think different"
 
K

kyu

Aredridel said:
anything out



I enjoy vi as part of a whole system.

gdb or ruby -rdebug for debugging. vi for editing. make and rake for
build automation. I assemble this small arsenal of tiny tools, and the
learning curve drastically shallows as I learn, because what works on
the shell works within vi (!!yourcommandhere), and the tools all work
together, because they have to, not out of explicit support for each
other.

Ari
One feature i find vi/nvi/vim/whatever is lacking is the ability to have
an interactive shell inside a buffer, i can be in
one xemacs session, and C-X2-C-Xo m-x shell and i have a command prompt
sitting right there, which i can even copy and paste from. I've never
found a way to do this in vi, and i find it much more productive to be
able to do everything from one terminal than constantly switching
backwards and forwards between processes. Just my $0.02 :)

Also, emacs can make a great ide with the code browser, which uses
semantic (and so supports ruby) and ruby-mode.el is great. :)

-kyu
 
T

tsuraan

One feature i find vi/nvi/vim/whatever is lacking is the ability to
have an interactive shell inside a buffer, i can be in
one xemacs session, and C-X2-C-Xo m-x shell and i have a command
prompt sitting right there, which i can even copy and paste from. I've
never found a way to do this in vi, and i find it much more productive
to be able to do everything from one terminal than constantly
switching backwards and forwards between processes. Just my $0.02 :)

That's definitely a weak point of vim. There's a python script that
can put a shell in a vim buffer, but it's very unstable and nearly
useless. I've heard that the next version will have support for that,
but who knows... I mostly just code with multiple consoles and gpm, so
switching to a shell is just alt-f2 or whatever. It's still not nearly
as nice as emacs's integrated stuff though.
 
Y

Yohanes Santoso

kyu said:
One feature i find vi/nvi/vim/whatever is lacking is the ability to
have an interactive shell inside a buffer, i can be in
one xemacs session, and C-X2-C-Xo m-x shell and i have a command

That's scary. Try this instead:

(defvar ys::eshell-wins nil)
(global-set-key "\C-cs" (lambda (win-num)
(interactive "p")
(message "win-num %s" win-num)
(let ((assoc-buffer (cdr (assoc win-num ys::eshell-wins))))
(if (not (buffer-live-p assoc-buffer))
(progn ; the requested buffer not there
(setq assoc-buffer (eshell t))
(setq ys::eshell-wins (assq-delete-all win-num ys::eshell-wins))
(add-to-list 'ys::eshell-wins (cons win-num assoc-buffer))))
(switch-to-buffer assoc-buffer)
(rename-buffer (concat "*eshell-" (int-to-string win-num) "*"))
assoc-buffer)))


To open shell #1: C-1 C-c s or if your environment doesn't transmit
C-<number> (like from a putty session), then use M-1 C-c s or the traditional C-u 1 C-c s

Shell #2: C-2 C-c s or M-2 C-c s or C-u 2 C-c s

and so on.

YS.
 
M

Martin DeMello

kyu said:
One feature i find vi/nvi/vim/whatever is lacking is the ability to have
an interactive shell inside a buffer, i can be in
one xemacs session, and C-X2-C-Xo m-x shell and i have a command prompt
sitting right there, which i can even copy and paste from. I've never
found a way to do this in vi, and i find it much more productive to be
able to do everything from one terminal than constantly switching
backwards and forwards between processes. Just my $0.02 :)

Also, emacs can make a great ide with the code browser, which uses
semantic (and so supports ruby) and ruby-mode.el is great. :)

Hopefully, the next version of vim will add more by way of embeddability
support, so that you can integrate a vim window as the editor component
of a larger app (I'd love to run vim within kate, for instance). A shell
within vim would be ideal, but vim within kate would be a decent
compromise for anyone using X.

martin
 
M

Martin DeMello

Austin Ziegler said:
In a C++ project that I am doing at work, there's a similar ratio.
At any given time, I'm working with between three and fifteen files.
I will use the VisualStudio environment for code completion and a
few project-centric searches (it's a bit smarter than a text search
that I do on Windows, but equally smart to a good find-grep search
that I do on our Unix ports), and for integrated debugging, but
that's about it. I do 95% of my code editing in vim.

FWIW, the workflow I've converged on here at work (~1M lines of visual
c++, though, as you say, seldom working on more than 5-10 files at any
given time) is gvim for editing, glark for searching and visual studio
for symbol lookup (better than ctags for its own projects) and compiling
(it lets you jump to errors).

martin
 
V

vruz

------=_Part_487_21109206.1114758895337
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
=20
=20
Hopefully, the next version of vim will add more by way of embeddability
support, so that you can integrate a vim window as the editor component
of a larger app (I'd love to run vim within kate, for instance). A shell
within vim would be ideal, but vim within kate would be a decent
compromise for anyone using X.
=20
martin
=20
=20
maybe you mean something like:=20
http://www.freehackers.org/kvim/vimpart.html

or perhaps:
http://www.yzis.org

cheers,
vruz

------=_Part_487_21109206.1114758895337--
 
R

Ralf Müller

Obviously, this is incredibly difficult for ruby. However, when I've
used IDEs in the past, this was exactly what I appreciated most. I think
it'd be possible to get some basic autocompletion, skipping some of the
more difficult dynamic elements, and most people would be happy, if not
content.

Maybe you already know, but I'm very happy with this style of vim-autocompletition:

taken from my .vimrc:

" smart mapping for tab completion
function InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>


" Dictionary completions
set dictionary-=/usr/share/dict/words dictionary+=/usr/share/dict/words
set complete-=k complete+=k


regards
ralf
 
R

Richard Dale

Martin said:
Sweet! Thanks for the pointers.
As it's a Kate part you can use it in KDevelop as well as Kate. I haven't
tried it though - I don't know if it has ruby syntax highlighting.

-- Richard
 
J

Jeff Barczewski

Sounds great Rob! jEdit is a wonderful editor, I've been using it for
the past 3 years and I just love it. The Ruby plugin for jEdit is
beautiful. For me this Ruby jEdit plugin and RDT for Eclipse are the
best of what I have seen thus far.
 
T

tony summerfelt

everytime the vim vs emacs thread comes up i like to make these two
points:

and that's ALL you have to do to get a command line in emacs :)
That's scary. Try this instead:

ok, but this is scarier:
(defvar ys::eshell-wins nil)
(global-set-key "\C-cs" (lambda (win-num)
(interactive "p")
(message "win-num %s" win-num)
(let ((assoc-buffer (cdr (assoc win-num ys::eshell-wins))))
(if (not (buffer-live-p assoc-buffer))
(progn ; the requested buffer not there
(setq assoc-buffer (eshell t))
(setq ys::eshell-wins (assq-delete-all win-num ys::eshell-wins))
(add-to-list 'ys::eshell-wins (cons win-num assoc-buffer))))
(switch-to-buffer assoc-buffer)
(rename-buffer (concat "*eshell-" (int-to-string win-num) "*"))
assoc-buffer)))

one advantage is that vim has is that you can extend your editor using
the (or all for that matter) scripting language of your choice,
vimscript, tcl, perl, ruby, python. to extend emacs you use something
like have the lisp code above.

another advantage is that if you're a touch-typist, vim is very
efficient at editing code. i think it's very handy that to delete 5
lines of text you can type: 5dd or do it the long way: Vjjjjjd

compared to emacs: C-spacebar, cursor to your target, C-w

the first key combo assumes your terminal will support it otherwise
you're stuck with: M-x set-mark-command
 
A

Austin Ziegler

From: Austin Ziegler [mailto:[email protected] ]
How many of your 2000 classes are *useful* classes that do real
work? How many of your 2000 classes are necessary because of the
nightmare that is Java enterprise application programming? (When
I looked at "Code Generation in Action", I was amazed at how many
classes had to be generated for a single table/view combination.)
Are we questioning here the value of the project?

No. What I'm questioning is how many of those 2,000 classes are
providing value to your project? Remember -- Java tends to require a
lot of "framework" code. Ruby requires much less. Ruby projects are
significantly smaller than Java projects that do similar things.
There was a comparison, recently, between a Java first-pass
implementation and a Ruby second-pass implementation. The Ruby one
was about a fifth the size, IIRC.

With this, the overwhelming need for an IDE for project management
is *reduced*. Not eliminated, mind you, but significantly reduced.
Yes I know this. I am not talking about writing code in notepad
;-). Surely you can do that. But efficiency is something very
important.

Yes, and as yet, I don't think that many people have found the
heavyweight nature of an IDE to be beneficial to Ruby development.
This may change. When that happens
This is the point I have agreed from the beginning. Still I
believe that with the right effort, something can be done.

I doubt it, personally. Ruby will screw things up for just about any
IDE with the mere existence of #method_missing. On the other hand,
if Ruby had a system image -- like Smalltalk -- then it would be
easier. Not easy, mind you, but easier.
I am not doing development with Python, but a branch of my co. is
using Komodo (ActiveState if I remember well) and they are happy
with it. Take a look.

I remember playing with Komodo and being unimpressed. Maybe it's
been improved. I will look at it again.
[Christian Neukirchen]
Well, you obviously forgot that Java forces you to use one file
per class (or did they change that stupid requirement recently?).
I couldn't deal with 2000 files in Emacs either, but 35 files and
the same LOC would be no problem (esp. as you focus on a handful
at once only). :)
sorry I don't get you. I can obviously write down a 50k source,
but is this the solution? No it is not. Every language has its own
stuff. I was not asking about doing Java dev with Ruby. Still I
can assume there are projects that are bigger than 50 sources.

What he's saying is what I said, in part. In PDF::Writer, recently,
I did the following:

class SimpleTable
class Column
...
end
...
end

To do this in Java -- especially since Column is accessible as
SimpleTable::Column (it's a full blown class, not just a nested
class, if that's even possible in Java -- it's been a long time) --
I think that I'd have to do:

simpletable.java
class SimpleTable { ... }
simpletable/column.java
class SimpleTable.Column { ... }

Forgive me if I got the syntax specifics wrong. Because Column is
something that is specific to SimpleTable (but can be created and
used separately), I can define them in the same source file. It
keeps things conceptually closer together, whereas in Java, I have
to put them in separate files, which makes things *harder* to deal
with.
Let me explain my thoughts again:
1/ I am not questioning the power of a language vs its tool
support. I think I can find good points/bad points everywhere.
Any ratio comparison will not help. There will be always very
large projects.
2/ I am not questioning the correctness of a project design.


I disagree. I can far more easily deal with a logically structured
400-class Ruby project (especially since, as would probably happen,
I would factor out those 400 classes into as many libraries, utility
classes, and modules as possible) than a 2000-class Java project.

Let's play a mental game for a moment. With a database-bound
project, you will typically need several classes per table in Java,
each of which is pretty heavy-weight (some frameworks may *help*
with this, but they don't eliminate it, AFAIK). In Ruby, you will
still need a couple of classes (presentation, ORM, etc.), but the
main code can probably be factored out into modules and utility
classes. Look at ActiveRecord. I don't agree with its chosen
"correct" semantics, but it's an amazing class nonetheless.

If you're able to take the common code and make it dynamically
generable, or dynamically extendable, then you can factor out that
common code into a library *and maintain that library separately*.

That's big. That's bigger than big. And it indicates that both (1)
and (2) in your points *matter* as far as the need for an IDE is
concerned. If your language is powerful enough (1) to make it *easy*
to break the big project into smaller parts, then the project design
changes (2).

I don't use an IDE in Ruby -- even for some big projects that I'm
working on -- because I don't *need* an IDE in Ruby. When I *need*
an IDE in Ruby, then I'll start caring. And that's where I'm really
taking issue with what you're saying: so far, Ruby doesn't *need* an
IDE.
3/ I agree dynamic typed languages are hard to support features
from static typed languages. Pls read John Wells' answer. There
is value in there ;-).

This statement is, IMO, confused. (1) John Wells' answer works only
if you can logically run the application in the IDE. (2) Dynamically
typed languages tend to support far more than statically typed
languages, but are harder for things like IDEs to support.
4/ I see the power in vim (and believe the guys talking about
Emacs power). I am only saying that I feel something more can
be done.

Maybe. I think things are being done. Ruby offers a very different
development paradigm. It's like a conversation I was having with
someone on #ruby-talk the other day. The question was raised about a
module that requires a particular method to work. For example,
Enumerable requires #each.

This person's suggestion was (roughly -- this is my interpretation)
that there should be both Enumerable and IEnumerable.

class SubclassResponsibility < RuntimeError; end

module IEnumerable
def each
raise SubclassResponsibility
end
end

module Enumerable
include IEnumerable
end

This way, when I do:

class Foo
include Enumerable
end

If I try to use #inject I will get a SubclassResponsibility error.
There's a problem, though. If Foo is a delegator class that uses
#method_missing to do delegation, I have to *manually* define #each
so that I don't get SubclassResponsibility (or I have to undef
each). Enumerable shouldn't care that #each is *defined* --
Enumerable should care that it's responded to.

Why do I need an IEnumerable that enforces the idea of sub-class
responsibility? This thing that makes it supposedly "easier" for the
module developer makes it harder for the module user. What's hard to
understand about:

irb(main):006:0> foo.inject(0)
NoMethodError: undefined method `each' for #<Foo:0x2b5eb28>
from (irb):6:in `inject'
from (irb):6

This applies to both why Ruby doesn't -- yet -- *need* an IDE and
why an IDE would be nearly impossible to use, given what's possible
in redefining Ruby.

-austin
 
A

Austin Ziegler

FWIW, the workflow I've converged on here at work (~1M lines of
visual c++, though, as you say, seldom working on more than 5-10
files at any given time) is gvim for editing, glark for searching
and visual studio for symbol lookup (better than ctags for its own
projects) and compiling (it lets you jump to errors).

I'll have to play with glark, especially since it will work on our
other platforms, too. And you're right -- VS is better than ctags
for VS projects.

-austin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top