SketchUp / sketchup-ruby-api-tutorials

SketchUp Ruby API Tutorials and Examples
MIT License
214 stars 145 forks source link

General cleanup #23

Open Eneroth3 opened 3 years ago

Eneroth3 commented 3 years ago

This is a quite old repo and there seems to be a lot of things we could look over in a general clean up. Here are a few points.

Eneroth3 commented 3 years ago

load_tutorials.rb loads the examples, not the tutorials.

thomthom commented 3 years ago

Consider merging tutorials and examples so we don't repeat ourselves and have two code bases to maintain.

The original intent was that tutorials would be fewer but with much more comments that makes little assumptions on prior knowledge.

There would be more examples than tutorials, acting as a way to present patterns and solutions for more experienced developers that just need a reference to look at.

Clarify what would map to an actual extension project. For instance, write a comment in the loader script telling it is a utility and not a part of the actual extensions. Getting this overview can be very difficult for new coders.

What do you mean by this? Can you show what you are referring to?

Consider wrapping the source for each extension in a src folder. I think rubocop-sketchup assumes such a folder, and it's a good practice to separate your source from "project meta" files like readme.

rubocop-sketchup can be configured to look in any folder. I think this this repo is a good one to demonstrate a complete project setup - since this contains many examples. For a project example I think it's better to have one dedicated for that. The current VSCode example shows a basic project setup: https://github.com/SketchUp/sketchup-extension-vscode-project

Clarify "tut" and "ex" prefix in file names. Prefer fully spelled out "tutorial" and "example".

True, "ex" could imply "extension" as much as "example".

Consider changing 99 to some other number for examples.

The 99 was to make them appear towards the end of the list when the files are sorted by name (which they usually use)

load_tutorials.rb loads the examples, not the tutorials.

This was intentionally since there's more examples than tutorials.

Eneroth3 commented 3 years ago

Consider merging tutorials and examples so we don't repeat ourselves and have two code bases to maintain.

The original intent was that tutorials would be fewer but with much more comments that makes little assumptions on prior knowledge.

There would be more examples than tutorials, acting as a way to present patterns and solutions for more experienced developers that just need a reference to look at.

Hmm. That makes sense. I should consider changing my PR to only add examples, including the comments I already had.

Clarify what would map to an actual extension project. For instance, write a comment in the loader script telling it is a utility and not a part of the actual extensions. Getting this overview can be very difficult for new coders.

What do you mean by this? Can you show what you are referring to?

Being used to the file structure of extensions, I can easily see that each folder in tutorials/ or examples/ represent an individual extension, but if you aren't already familiar with extensions this isn't obvious. You may stare at the loading script and wonder where that would go in a real life extension.

load_tutorials.rb loads the examples, not the tutorials.

This was intentionally since there's more examples than tutorials.

Then we should probably rename it load_examples.rb. This small things can really get in the way of understanding if you are already a bit confused of what you are looking at.

thomthom commented 3 years ago

Then we should probably rename it load_examples.rb. This small things can really get in the way of understanding if you are already a bit confused of what you are looking at.

That makes sense.

DanRathbun commented 2 years ago

I have come to believe that this repo, although well intentioned, has "put too many eggs in one basket" making it unwieldy.

The numbering is also problematic. If the time comes to renumber tutorials, the whole repo must change even if there is no real code changes the lessons.

It is also confusing having 1 issue tracker for multiple extensions.


I would propose that y'all open another account named "SketchUpTutor" or "TrimbleTutor" and have each lesson tutorial extension in a separate repository. Each one's README could have a link to the next lesson repo. And somewhere (GitHub Page) a master curriculum link list to all the tutorials in a series.

This dedicated account could have both Ruby and C tutorials for SketchUp as well as LayOut.

Just come up with some kind of repo prefix naming convention similar to what your doing now. Ie, "sketchup-ruby-", "sketchup-c-", "layout-ruby-", "layout-c-", etc., ...

?