Pages: [1]   Go Down
Author Topic: Boilerplate setup/loop definition stubs  (Read 2142 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 296
Got Karma?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 24, 2010, 11:00:46 am by roypardi » Logged

Berlin
Offline Offline
Full Member
***
Karma: 0
Posts: 181
Arduino rocks your socks off
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5600
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Sao Paulo - Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 268
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

U of A, Tucson, AZ
Offline Offline
Full Member
***
Karma: 0
Posts: 164
Hello World
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 296
Got Karma?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 
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.
« Last Edit: March 02, 2010, 07:02:36 pm by roypardi » Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17303
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Lefty
Logged

U of A, Tucson, AZ
Offline Offline
Full Member
***
Karma: 0
Posts: 164
Hello World
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
File
  |
New ->  Empty File ^N
        ----------
        Basic File
        HelloWorld
        AnalogReadWrite
        (rest of files from Stubs folder)
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1659
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm really liking this idea.

Needs Some marketing: -->
Quote
Here's a great feature that's buried and few people knew about.
« Last Edit: March 31, 2010, 09:21:26 pm by pwillard » Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: