Go Down

Topic: Be able to set a region in a defined piece of code (Read 4003 times) previous topic - next topic

OpenSource

Hello,

Some time ago I've requested the following feature.

http://code.google.com/p/arduino/issues/detail?id=126

I really like this feature, mainly because it enhances the IDE overview. How do I know I the feature will be added to Arduino 1.0?

/me

mromani

If a sketch code becomes so large it needs "regions" then it's probably better broken into multiple files or better yet one or more libraries.
I don't say that regions wouldn't be handy, but IMHO they'd add complexity for newcomers without bringing in real innovation.

All of this IMHO, of course :-)

PaulS

Well, in Visual Studio, which I use on a regular basis, the ability to collapse blocks of code (if blocks, comment blocks, whole functions, etc.) is a very handy feature. Once a function has been developed, and tested, and known to work, that function can be collapsed, to allow more of the code being developed/tested/debugged to be seen.

I have classes (not for the Arduino) that run 60,000 lines of code. The scroll bar, with nothing collapsed, is so small it is nearly invisible to these old eyes. Collapsing code that has been proven to work makes it much easier to work with.

Just my 2 cents worth.

Osgeld

yea I use the block/code collapse feature in notepad++ (wish gedit had it) all the time, even if your not whipping up 60k lines it just makes things easier cause you can focus on the troubled parts, with out getting mixed up in totally unrelated code as your scrolling
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

mromani

So it seems code regions are useful in very large projects. That's just why they shouldn't be included in the Arduino IDE. For small projects, they're not so useful it seems, and Arduino is not targeted towards experienced developers who need to write thousands of lines of code (which probably wouldn't fit in the uP anyway).
Let's protect the Arduino IDE from that dreadful virus called featuritis. Advanced developers can always switch to a more advanced and featurefull editor, after all.

ahdavidson

Quote
Let's protect the Arduino IDE from that dreadful virus called featuritis. Advanced developers can always switch to a more advanced and featurefull editor, after all.


I second that emotion.
.andy

Osgeld

#6
Jul 31, 2010, 11:13 pm Last Edit: Jul 31, 2010, 11:17 pm by Osgeld Reason: 1
Quote
So it seems code regions are useful in very large projects.


only if you choose to ignore my post where I try to say its very useful in projects of all sizes, next time I will just be blunt instead of assuming the reader would figure that out

I personally am not sure where the line is on noobie stuff, "we" hand them a kinda pricey board that could burst into flames, show them how to mess with mains current, then turn around and say a +/- expansion box in the IDE is too confusing for them
:P

a system like notepad++ uses is automatic with the blocks of code, if you dont want to use them you just dont click on them, the VB type system above you add lines, again if you dont want them you dont use them

I think its a good option
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

mromani

Quote

I personally am not sure where the line is on noobie stuff, "we" hand them a kinda pricey board that could burst into flames, show them how to mess with mains current, then turn around and say a +/- expansion box in the IDE is too confusing for them


After all you may have scored a point :-)

Well I just don't like code folding. Let alone that regions thing which is supposed to be code folding on steroids. And let's keep ms crap out of arduino!

Ah, I feel better now... /me takes a deep breath

;D

ahdavidson

Quote
next time I will just be blunt instead of assuming the reader would figure that out

I understood your point and was not ignoring your post.

But the discussion is not only about whether a feature is useful in small or large projects. There is also value in keeping the complexity of the IDE user interface low. It is one of the great successes of Arduino that extreme novices can use the tool with very little confusion.

Every feature that gets added, regardless of how useful or simple, adds to the cognitive load in learning a new tool. Compare the novice's reaction when confronting for the first time, say, Photoshop vs iPhoto.

I don't know for sure where a code expand/collapse feature would land on the various usability/complexity cognitive axes, but I do know that it is healthy to have a good discussion about it before adding a feature.

Not doing that leads to the way of Microsoft Word and who knows what else...

"Lasciate ogne speranza, voi ch'intrate"
"Abandon all hope, ye who enter here"
-  Dante Alighieri
.andy

sciguy

I am not leaning towards this idea either.
Sure, it would be useful, but I've found in some of my projects the cluttered cluster of functions that are not currently collapsible may have been beneficial; they drove me to organize things in classes and libraries, which IMO organize things even better.

I also like the simplicity of the IDE, leaning me further from the regions idea.  I sort of like having only 2 areas of text (code section and message box thing for errors and stuff), 3 scroll bars, a row of tabs, and 6 or 7 buttons in the window.
I agree that arduino MUST NOT become like Microsoft word...*shudder*
:D
Soundcloud page: http://soundcloud.com/beefinator-2
Youtube channel: http://www.youtube.com/user/beefinator14
Old soundcloud page (ran out o

Osgeld

#10
Aug 01, 2010, 08:21 pm Last Edit: Aug 01, 2010, 08:21 pm by Osgeld Reason: 1
being one of the more clunky broken "IDE's" I use its almost right up there with wordpad, least wordpad saves on exit...

anyway I will agree that isnt the most important thing, but for version 1 overall there doesnt seem to be that many great ideas making it in, and a lot of bugs in the IDE automatically get shoved off onto processing and deemed "unfixable" so what is acceptable? (keeping in mind people have used a computer before arduino and things like options are abundant)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

ahdavidson

I disagree that the IDE is broken and clunky. I find its clarity and simplicity to be one of its strengths.

Edit the code, upload it to the board, it runs. That is very easily explained and easily grasped by novices.
.andy

Osgeld

#12
Aug 01, 2010, 10:22 pm Last Edit: Aug 01, 2010, 10:25 pm by Osgeld Reason: 1
hold shift bump delete watch half a page vanish, doesn't save on exit(lost entire nights worth of effort over that one), sometimes doesn't save when manually saved, has issues with library locations, its HUGE (seriously 230mb for a text editor? over half of that is java), and you cant even change the font size

yup, not clunky at all  ;)

but that is what one gets trying to shoehorn something into a framework that is not designed for it, its like trying to write a IDE out of love2d or pygame or processing (oh wait)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

sciguy

Quote
hold shift bump delete watch half a page vanish,  ctrl-z? doesn't save on exit(lost entire nights worth of effort over that one) when I exit, it asks if I want to save, maybe I don't know what you mean by "exit" , sometimes doesn't save when manually saved, I've never had problems with that has issues with library locations, Again, never been an issue for me its HUGE (seriously 230mb for a text editor? uhh, it's a bit more than just a text editor, you have a whole programming language included over half of that is java), and you cant even change the font size yes you can, look in the preference file


I also disagree that it is clunky.
Soundcloud page: http://soundcloud.com/beefinator-2
Youtube channel: http://www.youtube.com/user/beefinator14
Old soundcloud page (ran out o

Osgeld

#14
Aug 02, 2010, 03:15 am Last Edit: Aug 02, 2010, 03:19 am by Osgeld Reason: 1
Quote
ctrl-z?

so users that cant be expected to handle a + box next to their code is now a keyboard shortcut expert, its broken behaviour with what anyone expects out of text entry

Quote
when I exit, it asks if I want to save, maybe I don't know what you mean by "exit"


my bad they fixed that in 18, it did nothing for the longest time

Quote
I've never had problems with that


I cant make it repeat reliably, but if you save a sketch outside of the default location it will pop up quite quickly

Quote
Again, never been an issue for me


try putting a lib in your sketchbook folder

Quote
uhh, it's a bit more than just a text editor, you have a whole programming language included


that's kind of the problem, the linux download is 7mb! yes you have to add dependencies like java and avrgcc, but

A) who doesnt have java already
B) the entire package of avrgcc is like 30mb

Quote
yes you can, look in the preference file


and again a simple minded user's head would explode if extra options were added, but if they really need to, they can hunt down and edit preferences.txt
::)


whatever, I don't want to argue about it till the end of time

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up