Boilerplate setup/loop definition stubs

Hi -

This is trivial but I think useful from a teaching/standardization perspective (and I think I recall seeing it mentioned at various times in the forums).

When a new sketch is created, including the required setup/loop functions by default would be a friendly option for new users. This would not annoy more experienced users in most cases (I would welcome it).

I imagine it is on a 'to do' list somewhere but never got a priority bump with everything else that needed doing.

Yup, I'd really appreciate it. At the moment I have a template sketch called "__template.pde", so it's always up in the sketchbook, but I would like some more (perhaps optional) comfort...

I know I put in my poll response this same thing. The other thing I would like (for advanced users) is a way to see the actual main() stub that calls setup() and loop() in the sketch...

maybe, an advanced mode option inside the up menu, or an option inside preferences where you can choose the mode mostly used, advanced, beginner.

I'll vote for a boilerplate template that gets used when you select "New..." from the start menu. Having it just be an editable file somewhere so people could customize it if they want would be a bonus.

I'll vote for a boilerplate template that gets used when you select "New..." from the start menu. Having it just be an editable file somewhere so people could customize it if they want would be a bonus.

An external text file that gets loaded would be an awesome option. Add your own header format etc.

I'm sorry, I may be misunderstanding, but what is the difference between the proposal and the thing on
File->Examples->stubs->BareMinimum ?

Is it that you'd like the empty sketch to contain this?

GB-)

File->Examples->stubs->BareMinimum ?

Never noticed that option, thanks for the tip. :sunglasses:

Lefty

File->Examples->stubs->BareMinimum ?

Never noticed that option, thanks for the tip. :sunglasses:

Lefty

I think that's a perfect example of what this whole process is about. Here's a great feature that's buried and few people knew about.

Maybe rethink the New menu item into a sub-menu:

File
  |
New ->  Empty File ^N
        ----------
        Basic File
        HelloWorld
        AnalogReadWrite
        (rest of files from Stubs folder)

I'm really liking this idea.

Needs Some marketing: -->

Here's a great feature that's buried and few people knew about.

retrolefty wrote on 12.03.2010 at 07:19:29:
Quote:
File->Examples->stubs->BareMinimum ?

Never noticed that option, thanks for the tip. Cool

Lefty

I think that's a perfect example of what this whole process is about. Here's a great feature that's buried and few people knew about.

Maybe rethink the New menu item into a sub-menu:
Code:

File
|
New -> Empty File ^N

Basic File
HelloWorld
AnalogReadWrite
(rest of files from Stubs folder)

That would make a menu with about 2km(for the usa read miles), that's just plain stupid is that hard to move your mouse 2cm to the right?

I think estranged suggestion for the File->New menu need only be as long as the current File->Stubs menu, i.e. 6 entries, + Empty File and a separator.

Rather than merge the File->Stubs menu with File -> New, how about:

File -> New Empty File
New File from Template -> ... contents of stubs menu ...

A "New File from Template", IMHO, would logically have the property that it has a new name, and be ready to save into the Arduino folder.

This might also reduce a source of frustration for the kids when I work in school.

The Examples are on a read-only network drive, so they kids have to save in their Arduino folder before they can compile. It is okay to explain that the examples are shared. It is even okay that this explanation makes sense while Stubs is in the Examples menu, but it always felt a bit hokey.

IMHO the purpose of the Stubs sketches seemed to be to make a new sketch to start work on. Pulling it out into a different menu, also offers the opportunity to have different semantics: a new sketch, with a new name, ready to save into Arduino folder. This seems 'right'.

I should admit, I don't like the word 'Stubs'. Like many others, I didn't notice it for a while. I suppose, it sounds a bit old techy. My mind skipped over it for weeks, imagining it was a technology category, like EEPROM or Analog, I suppose :-/.

I feel Template has a meaning of 'not the actual thing, but a way to make an actual thing', whereas Stubs doesn't.

HTH
GB-)