New folder for third party code?

1 view
Skip to first unread message

Xue Yong Zhi

unread,
May 26, 2007, 10:51:36 PM5/26/07
to xruby...@googlegroups.com
We have lots of ruby scripts copied from c ruby in our SVN ('benchmark',
'test', 'sample', 'lib\ruby'), and will add more in the future. I am
thinking about adding a new folder called 'ruby' to host those third party
code:

|->src (our source code)
|->doc (our doc)
|...
|->ruby (code from c ruby)
|->lib
|->benchmark
|->sample
|->test
|...

What do you think? Thank you.

_________________________________________________________________
Catch suspicious messages before you open them謡ith Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507

femto gary

unread,
May 27, 2007, 3:23:20 AM5/27/07
to xruby...@googlegroups.com
actually I would prefer divide by funtionality rather
by source code type. People would recoginize(and find)
things by concept, rather just by source file type. say,
I want to find something related to benchmark, and I see
a folder called 'benchmark', and I think, "great, this is the folder
'benchmark', and I can find all benchmark related stuff under here",
so if there is any Java benchmark file, I would assume it resides
in that folder too, rather than some java/benchmark folder,
that would cause least surprise.

On 5/27/07, Xue Yong Zhi <zhixu...@hotmail.com> wrote:
>
> We have lots of ruby scripts copied from c ruby in our SVN ('benchmark',
> 'test', 'sample', 'lib\ruby'), and will add more in the future. I am
> thinking about adding a new folder called 'ruby' to host those third party
> code:
>
> |->src (our source code)
> |->doc (our doc)
> |...
> |->ruby (code from c ruby)
> |->lib
> |->benchmark
> |->sample
> |->test
> |...
>
> What do you think? Thank you.
>
> _________________________________________________________________

> Catch suspicious messages before you open them--with Windows Live Hotmail.
> http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507
>
>
> >
>


--
Best Regards
XRuby http://xruby.com
femto http://hi.baidu.com/femto

femto gary

unread,
May 27, 2007, 3:29:20 AM5/27/07
to xruby...@googlegroups.com
And also for java test file, I believe it is best practice to use a seperated
test dir, just like in JRuby or springside's case, this practice is widely
accepted and is very well in practice. So I don't think the words from
'working effectively with legacy code' is quite valid, we don't need to follow
his opinion blindly.From my experience working on parser, I write some
testcase of Rubyv3ParserTest, Rubyv3LexerTest, Rubyv3TreeParserTest,
when I modify something, I always find it difficult to identity and
find out these files in source tree,
because these files are just mixed up with the source code and not
aligned continuously,every time I modify something, it's quite
irritating I look at the source code tree and try to find out all
these 3 files and run them and let them passed, it is just irritating.
What's other guys' experience? What do all of you think?

Michael Chen

unread,
May 27, 2007, 4:45:11 AM5/27/07
to xruby...@googlegroups.com
No doubt, separate the java source and test source is a good practise.

And I agree Yongzhi's idea about re-organize the ruby scripts.


--
Michael Chen
--------------------------------
Blog: http://michael.nona.name
MSN: jzch...@hotmail.com

Xue Yong Zhi

unread,
May 27, 2007, 10:25:27 AM5/27/07
to xruby...@googlegroups.com
It is a widely used practice but I personally do not think it is a good
practice, as it makes navigation in the project painful.

I feel quite the opposite as femto feels. I need to switch back and forth
between implementation and test all the time, and it is very painful to have
to go to another folder to find what I want, especially without an IDE.

You can still run all the unit tests in a folder even if the implementation
and test are mixed in the folder. I can not see a disadvantage here.

Of course if anyone has valid non-aesthetic reasons to seperate
implementation I would like to consider.

_________________________________________________________________
More photos, more messages, more storage--get 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

femto

unread,
May 27, 2007, 9:33:01 PM5/27/07
to xruby-devel
it's not based on aesthetic consideration, it's based on my real
experience about it,
it's quite painful to find out those test files inside the source
tree.
besides, Xue.Yong Zhi , you don't use an IDE? I don't think
navigation should be a
problem for non-IDE user, anyway, you can just open up a dir for test
and open those
files using other editors.
and two more points for seperating src dir and test dir. First, just
like JRuby's case,
sometimes we want to add some file just for test purpose, like
AlphaSingleton/BetaSingletion
in JRuby's case, so it's better just put it in test dir there.
Second, for searching purpose, often I need to find out some thing
in the src dir or test dir,
firing up a search box in IDE and type in something to search under
the whole project, the
mixing of src and test is just inconvenient, yes, it's true I can (in
theory) filter out *Test.java
file in the file pattern, but it is just inconvient..

On May 27, 10:25 pm, "Xue Yong Zhi" <zhixuey...@hotmail.com> wrote:
> It is a widely used practice but I personally do not think it is a good
> practice, as it makes navigation in the project painful.
>
> I feel quite the opposite as femto feels. I need to switch back and forth
> between implementation and test all the time, and it is very painful to have
> to go to another folder to find what I want, especially without an IDE.
>
> You can still run all the unit tests in a folder even if the implementation
> and test are mixed in the folder. I can not see a disadvantage here.
>
> Of course if anyone has valid non-aesthetic reasons to seperate
> implementation I would like to consider.
>
>
>
>
>
> >From: "Michael Chen" <mechil...@gmail.com>
> >Reply-To: xruby...@googlegroups.com
> >To: xruby...@googlegroups.com
> >Subject: [xruby-devel] Re: New folder for third party code?
> >Date: Sun, 27 May 2007 16:45:11 +0800
>
> >No doubt, separate the java source and test source is a good practise.
>
> >And I agree Yongzhi's idea about re-organize the ruby scripts.
>

> >On 5/27/07, femto gary <femto...@gmail.com> wrote:
>
> > > And also for java test file, I believe it is best practice to use a
> >seperated
> > > test dir, just like in JRuby or springside's case, this practice is
> >widely
> > > accepted and is very well in practice. So I don't think the words from
> > > 'working effectively with legacy code' is quite valid, we don't need to
> >follow
> > > his opinion blindly.From my experience working on parser, I write some
> > > testcase of Rubyv3ParserTest, Rubyv3LexerTest, Rubyv3TreeParserTest,
> > > when I modify something, I always find it difficult to identity and
> > > find out these files in source tree,
> > > because these files are just mixed up with the source code and not
> > > aligned continuously,every time I modify something, it's quite
> > > irritating I look at the source code tree and try to find out all
> > > these 3 files and run them and let them passed, it is just irritating.
> > > What's other guys' experience? What do all of you think?
>

> > > On 5/27/07, femto gary <femto...@gmail.com> wrote:
> > > > actually I would prefer divide by funtionality rather
> > > > by source code type. People would recoginize(and find)
> > > > things by concept, rather just by source file type. say,
> > > > I want to find something related to benchmark, and I see
> > > > a folder called 'benchmark', and I think, "great, this is the folder
> > > > 'benchmark', and I can find all benchmark related stuff under here",
> > > > so if there is any Java benchmark file, I would assume it resides
> > > > in that folder too, rather than some java/benchmark folder,
> > > > that would cause least surprise.
>

> > > > On 5/27/07, Xue Yong Zhi <zhixuey...@hotmail.com> wrote:
>
> > > > > We have lots of ruby scripts copied from c ruby in our SVN
> >('benchmark',
> > > > > 'test', 'sample', 'lib\ruby'), and will add more in the future. I am
> > > > > thinking about adding a new folder called 'ruby' to host those third
> >party
> > > > > code:
>
> > > > > |->src (our source code)
> > > > > |->doc (our doc)
> > > > > |...
> > > > > |->ruby (code from c ruby)
> > > > > |->lib
> > > > > |->benchmark
> > > > > |->sample
> > > > > |->test
> > > > > |...
>
> > > > > What do you think? Thank you.
>
> > > > > _________________________________________________________________
> > > > > Catch suspicious messages before you open them--with Windows Live
> >Hotmail.
>

> >http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_m...
>
> > > > --
> > > > Best Regards
> > > > XRubyhttp://xruby.com
> > > > femtohttp://hi.baidu.com/femto
>
> > > --
> > > Best Regards
> > > XRubyhttp://xruby.com
> > > femtohttp://hi.baidu.com/femto


>
> >--
> >Michael Chen
> >--------------------------------
> >Blog:http://michael.nona.name

> >MSN: jzche...@hotmail.com
>
> _________________________________________________________________
> More photos, more messages, more storage--get 2GB with Windows Live Hotmail.http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_m...- Hide quoted text -
>
> - Show quoted text -

Xue Yong Zhi

unread,
May 28, 2007, 12:38:45 AM5/28/07
to xruby...@googlegroups.com

> besides, Xue.Yong Zhi , you don't use an IDE? I don't think

I use a mixed environments, including command line, eclipse, source insight
etc, and sometimes just browse the SVN in a web browser.

>problem for non-IDE user, anyway, you can just open up a dir for test and
>open those
>files using other editors.
> and two more points for seperating src dir and test dir.

I have used this in a work environment, dislike it because it wastes time as
I need to switch between windows frequently.

>First, just
>like JRuby's case,
>sometimes we want to add some file just for test purpose, like
>AlphaSingleton/BetaSingletion
>in JRuby's case, so it's better just put it in test dir there.

I see no reason why not just put those code in src dir.

> Second, for searching purpose, often I need to find out some thing
>in the src dir or test dir,
>firing up a search box in IDE and type in something to search under
>the whole project, the
>mixing of src and test is just inconvenient, yes, it's true I can (in
>theory) filter out *Test.java
>file in the file pattern, but it is just inconvient..
>

As for me, I think it is a advantage to get results from production code and
test code at the same time.

_________________________________________________________________
More photos, more messages, more storage揚et 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507

femto

unread,
May 28, 2007, 5:17:01 AM5/28/07
to xruby-devel
Hi, have you tried adding an external tool to IDE,
explorer /select,$FilePath$ , then each time when you
select this file in IDE, you invoke this external tool,
you can open this file in explorer.
Mixing src with test has as much as, if not more , problem as
seperating
src dir with test dir. Anyway, I found it irritating each time to find
out all those
3 test files in src tree( I also need to switch back and forth a
little while because
I need to use antlrworks, and open an ultraeditor). Especially when
I'm working on
laptop, this is more irritating because the screen is small, I must
scroll back and forth
for finding files. I believe it's more common to seperate src and test
dir and more of us are familiar
with this, mixing them is just weird. (I agree some project uses this
pattern, but it looks more weird).
Don't know how sourceinsight handles src/test tree.

> More photos, more messages, more storage-get 2GB with Windows Live Hotmail.http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_m...

Xue Yong Zhi

unread,
May 28, 2007, 5:44:48 PM5/28/07
to xruby...@googlegroups.com

>
>Hi, have you tried adding an external tool to IDE,
>explorer /select,$FilePath$ , then each time when you
>select this file in IDE, you invoke this external tool,
>you can open this file in explorer.
> Mixing src with test has as much as, if not more , problem as
>seperating
>src dir with test dir. Anyway, I found it irritating each time to find
>out all those
>3 test files in src tree( I also need to switch back and forth a
>little while because
>I need to use antlrworks, and open an ultraeditor). Especially when
>I'm working on
>laptop, this is more irritating because the screen is small, I must
>scroll back and forth
>for finding files. I believe it's more common to seperate src and test
>dir and more of us are familiar
>with this, mixing them is just weird. (I agree some project uses this
>pattern, but it looks more weird).
> Don't know how sourceinsight handles src/test tree.
>

I also used several computers and one has a small screen. If it is hard to
find the test files among other files, maybe we should change our naming
convention to Test***.java ('Test' as prefix). It is probably the best
approach as it combines the advantage of having production code and test
close to each other, and test files stand out because of the prefix.

Most people have not thought about this issue before making the decision to
separate src and test, and some are even surprised that they can be store
them in the same folder. I have used to separate the two for a long time,
but later find out it will save me lots of time by just having them in the
same folder -- I have been promoting this as a better way to organize code
since then. As Agile methodology becomes more adopted those days, unit tests
are not just for 'testing' in the traditionally way, it is used as of
'documentation' or 'samples'. As developer spend more time on the tests, I
think most of them would appreciate that the test code is one click away
from the production code.

_________________________________________________________________

femto

unread,
May 28, 2007, 10:06:56 PM5/28/07
to xruby-devel
Test*** is a bad idea, it makes you even harder to find those test
files,
you just can't distinguish them from the code tree at a glance, all is
Test... and all looks similar, if the src java name is long, it makes
it
even worse, because there will be a long list of resembling Test***
in the code tree.
yes, unit testing can servce as 'documentation' and 'samples', but
we
don't mix 'documentation' and 'samples' with src, do we?

> More photos, more messages, more storage-get 2GB with Windows Live Hotmail.http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_m...- Hide quoted text -

femto

unread,
May 28, 2007, 10:18:48 PM5/28/07
to xruby-devel
and one click away, for Idea, it wouldn't be problem,
you can easily switch between src and test.Don't know
how Eclipse handle that. But I know, for Eclipse, when it
handles Tapestry project, it also provides convient jump
between html files, page specification and page java file.
We should utilize the capability of IDE provides us, just like
Hungary naming convention, it justs go outdated and died.

> > More photos, more messages, more storage-get 2GB with Windows Live Hotmail.http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_m...Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

Xue Yong Zhi

unread,
May 29, 2007, 1:59:07 PM5/29/07
to xruby...@googlegroups.com
>Test*** is a bad idea, it makes you even harder to find those test
>files,

Use **_Test.java(underscore) or whatever you feel comfortable to make test
file names stand out. I have no problem to spot the test files using the
current approach and no idea what works best for you.

> yes, unit testing can servce as 'documentation' and 'samples', but
>we
>don't mix 'documentation' and 'samples' with src, do we?
>

javadoc/rdoc is just part of the source code. I would rather have unit tests
in the same file with implemtation, but unfortunately no tools support this.

_________________________________________________________________
Catch suspicious messages before you open them謡ith Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507

Xue Yong Zhi

unread,
May 29, 2007, 3:20:54 PM5/29/07
to xruby...@googlegroups.com

I got complains from other member that this thread has become too long. For
anyone who is interested in this topic (file layout) or has suggestions
please email/IM me directly.

Thank you.

_________________________________________________________________
Like the way Microsoft Office Outlook works? You’ll love Windows Live
Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_outlook_0507

Reply all
Reply to author
Forward
0 new messages