Go Down

Topic: Boilerplate setup/loop definition stubs (Read 2330 times) previous topic - next topic

roypardi

Feb 24, 2010, 01:27 pm Last Edit: Feb 24, 2010, 05:00 pm by roypardi Reason: 1
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.

Otacon2k

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...

cr0sh

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...
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Radames

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

estranged

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.

roypardi

#5
Mar 03, 2010, 01:02 am Last Edit: Mar 03, 2010, 01:02 am by roypardi Reason: 1
Quote
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.

gbulmer

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-)

retrolefty

Quote
File->Examples->stubs->BareMinimum ?


Never noticed that option, thanks for the tip.  8-)

Lefty

estranged

Quote
Quote
File->Examples->stubs->BareMinimum ?


Never noticed that option, thanks for the tip.  8-)

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: [Select]

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


pwillard

#9
Mar 31, 2010, 06:27 pm Last Edit: Apr 01, 2010, 04:21 am by pwillard Reason: 1
I'm really liking this idea.

Needs Some marketing: -->
Quote
Here's a great feature that's buried and few people knew about.

Senso

Quote
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?

gbulmer

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-)

Go Up