IDE Suggestion... any takers? - Collasapable Code Segments

sixeyes:
Here's a link

http://msdn.microsoft.com/en-us/library/b6xkz944(v=vs.80).aspx

but it doesn't help you understand what it does.

In .NET you can sprinkle #region / #endregion throughout your classes. You may ask why would I want to do this. The answer is it helps with removing clutter. When you open a class without regions you just have a bunch of functions. With regions you can group functions together into logical groups and best of all, collapse whole regions down to a single line. In .NET you can nest regions within regions so you can categorise further.

As an example I would wrap all functions connected with construction (constructors, setup code etc) in one region. Getters / setters in another. Remaining public methods and private methods each go in their own region. So if I was working on some internal feature of the class I'd collapse all regions except the one holding all my private functions.

You probably have to be more of a programmer than a hobbyist to really want this. TBH I'd suggest the OP try using Visual Studio and the excellent VisualMicro plugin (http://www.visualmicro.com) which allows you to use Visual Studio (and therefore code folding) and is compatible with the Arduino IDE so you can swap back at will, or share your work with others.

Iain

The "standard" way I've seen this done in the C/C++ world (as well as languages with a similar style, like PHP) - is that your "regions" as you call them, are defined at the level of the functional block (that is, the collapse/expand is placed wherever a function block starting with the left-hand brace "{" occurs). This allows you to expand/collapse everything at will (functions, if-then-else constructs, switch-case, do-loop, structures, class definitions, etc). No need for a specialized "marker" element for most things, but one could be added if absolutely needed and it wouldn't detract.

I agree that such a thing would be nice in the IDE - but this goes the route of so many other changes proposed to the IDE: It makes it more complex, more geared to users who have already encountered such "more professional" options in other IDEs. This means the IDE that is standard for the Arduino becomes just a bit more less accessible for the user audience the Arduino is mainly aimed at: Non-professional programmers, non-programmers, artists, and students/educators.

I say that if you want these extra features for more professional development, you take a look into using an external editor (gedit, kate - sorry, *nix here), a better IDE (geany, codeblocks, etc) or any number of the plugins or such for the Eclipse IDE.