[rkward-devel] idea: code readability

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Oct 18 16:00:57 UTC 2011


Hi,

On Tuesday 18 October 2011, meik michalke wrote:
> i was thinking about this for some time now: i believe that especially for
> people new to R, the code presented below plugin dialogs is often "too much
> information". that is, the whole printout() section is usually highly
> RKWard specific, so to learn how things are done "in R" it might even be
> confusing for beginners. i recognized this repeatedly when i was
> introducing students to R via RKWard; it was easy to say they could look
> at the code to learn how to do things in their own scripts, but a little
> tiresome to explain to them which parts of the code are irrelevant and why
> (they are just not satisfied to hear "... oh, and ignore everything below
> that comment").
> 
> it's probably tough to implement, but could we somehow have a switch to
> make the prining section in the code window disappear, or folded in, or at
> least change the syntax highlighting significantly?

limiting what gets shown, should not be too hard, technically (at least for 
the "make it disappear" variant). See rkstanardcomponentgui.cpp function 
updateCodeNow(). The sections actually get pasted together right there. Things 
to consider, though:

1) For some plugins, the printout() section _is_ the essence of the code. 
Notably most plots. For other plugins, it is not always easy to decide, what 
is or isn't the "relevant" code. E.g. coercing data into a suitable format.

2) ATM, users can select all, copy, and paste the code to the R console (or a 
script), to achieve exactly the same result as pressing "Submit". If some 
parts of the code are hidden, this would not longer work. So we should 
probably offer an alternative, here. (This applies to the "make it disappear" 
variant, only, of course).

3) I'm not sure what the GUI switch to toggle this should look like. 
Suggestions?

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20111018/ee2d6903/attachment.sig>


More information about the Rkward-devel mailing list