Package directory structure naming convention

475 views
Skip to first unread message

George Moschovitis

unread,
Mar 16, 2013, 2:02:13 PM3/16/13
to mi...@dartlang.org
I am wondering what the Dart team (or other Darters) think about the following conventions for package directory structure:

A) Java(?) style (singular)

lib/src/name.dart
lib/src/name/
lib/src/name/name_a.dart
lib/src/name/name_b.dart

B) Ruby(?) style (plural)

lib/src/name.dart
lib/src/names/
lib/src/names/name_a.dart
lib/src/names/name_b.dart

or 

lib/src/names/
lib/src/names/name.dart
lib/src/names/name_a.dart
lib/src/names/name_b.dart

It would be great to have some kind of directory structure consistency in pub packages.

-g.

Ladislav Thon

unread,
Mar 16, 2013, 2:24:30 PM3/16/13
to mi...@dartlang.org
I think that the current convention prefers singulars. That's why lib and not libs, test and not tests etc.

LT

Andrei Mouravski

unread,
Mar 16, 2013, 7:35:54 PM3/16/13
to General Dart Discussion
I think that the current convention prefers singulars. That's why lib and not libs, test and not tests etc.
I don't know the original rationale, but singulars are definitely what pub uses. I think it might come from unix directory names (usr/ vs usrs/, mnt/ vs mnts/, etc.) 

George Moschovitis

unread,
Mar 17, 2013, 12:40:25 AM3/17/13
to mi...@dartlang.org
Singulars sound fine to me. Please note, that I am referring to names used deeper in the directory hierarchy though, not the top level lib,test,etc. directories.

-g.

Ladislav Thon

unread,
Mar 17, 2013, 8:30:34 AM3/17/13
to General Dart Discussion


> Singulars sound fine to me. Please note, that I am referring to names used deeper in the directory hierarchy though, not the top level lib,test,etc. directories.

Sure, but you probably want the deeper level consistent with the top level, no? :-)

LT

George Moschovitis

unread,
Mar 17, 2013, 8:31:38 AM3/17/13
to mi...@dartlang.org

> Singulars sound fine to me. Please note, that I am referring to names used deeper in the directory hierarchy though, not the top level lib,test,etc. directories.

Sure, but you probably want the deeper level consistent with the top level, no? :-)


most certainly ;-)

-g. 

Bob Nystrom

unread,
Mar 18, 2013, 3:49:14 PM3/18/13
to General Dart Discussion

On Sat, Mar 16, 2013 at 4:35 PM, Andrei Mouravski <amour...@google.com> wrote:
I don't know the original rationale, but singulars are definitely what pub uses. I think it might come from unix directory names (usr/ vs usrs/, mnt/ vs mnts/, etc.) 

A couple of motivations:

1. We started with "lib" which we felt was naturally singular following other languages.
2. Other Unix dirs are singular.
3. It's shorter.

Within lib, we don't currently have any strong conventions for directory names, but I generally lean towards singular.

Cheers!

- bob
Reply all
Reply to author
Forward
0 new messages