SketchUp / sketchup-stl

A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
http://extensions.sketchup.com/content/sketchup-stl
MIT License
247 stars 68 forks source link

Wrap code in consistent modules to guard against conflicts with other extensions #9

Closed jimfoltz closed 11 years ago

jimfoltz commented 11 years ago

The importer uses the initials of the original author as a module name wrapper to guard against conflicts with other extensions. Wrapping code in namespaces is good practice.

Now that the code has been adopted by SketchUp and open-sourced, the module name should be changed to reflect this. I suggest using Trimble as a top-level module name for this and all SketchUp extensions created during this era. This particular extension should also be wrapped in its own module also. The name STL seems appropiate.

The exporter does not use any top-level module namespace, but should also be wrapped in the same module hierarchy as the importer, i.e.

module Trimble
    module STL
        # extension code here.
    end
end
scottlininger commented 11 years ago

Agreed. This seems like a simple pattern we can follow in all of our open source projects.

thomthom commented 11 years ago

I'd say it's a pattern to follow in the closed source extensions SketchUp ship as well. Redusing the amount of top level classes and modules and leading example for everybody else.

That way it's more preditcable to where SketchUp's own code is placed, and the API itself is the only one to be placed in the top level namespace.

briangbrown commented 11 years ago

Though does it make sense to do something more general and separate from Trimble as the module name. Maybe SketchupOS or something. OpenSketchup. OSSketchup?

tylermiller commented 11 years ago

I agree with Brian on this one. Let's use SketchUpExt, or something like that as the top-level module.

-Tyler

On Sat, Oct 20, 2012 at 1:20 PM, briangbrown notifications@github.comwrote:

Though does it make sense to do something more general and separate from Trimble as the module name. Maybe SketchupOS or something. OpenSketchup. OSSketchup?

— Reply to this email directly or view it on GitHubhttps://github.com/SketchUp/sketchup-stl/issues/9#issuecomment-9635020.

scottlininger commented 11 years ago

Shorter is better in my book. We'll be typing it a lot, after all.

How do people feel about an abbreviation? SUE? SUOS? SX? Too cute? Too vague?

I guess SketchUpExt isn't awful... I could be convinced.

thomthom commented 11 years ago

I think SketchUpExt - or somethibng slightly verbose like that is better - leaving no doubt on what it is.

Since it's the top level namespace - would you really be typing it that much, it's just the wrapper. Not something you reference often, is it?

jimfoltz commented 11 years ago

Shorter is better in my book. We'll be typing it a lot, after all.

I don't think a longer name would be too much of a burden. Even SketchUpExt may not be expressive enough. My editor has a nice omni-complete feature so the most I'd need to type the name is once.

I'm sort of leaning towards something that expresses ideas about openness, community, and collaboration to set it apart from the existing Sketchup and SketchupExtension names.

How about SketchUpCommunityExtensions

scottlininger commented 11 years ago

I kinda like the "community" idea. These are community projects.

Do we need the "SketchUp" part? What about CommunityExtensions ?

thomthom commented 11 years ago

CommunityExtensions sounds good to me. SketchUp prefix can be reserved to SketchUp's own extensions (which I think they should be organized on some fashion.)

jimfoltz commented 11 years ago

CommunityExtensions

I like it.

And SketchupCommunity looks nice too. Best of both worlds?

briangbrown commented 11 years ago

+1 for CommunityExtensions

jimfoltz commented 11 years ago

Let's make decision.

scottlininger commented 11 years ago

I hereby decree: CommunityExtensions !

Long live CommunityExtensions !

thomthom commented 11 years ago

This can be closed now.