<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>code-folding &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/code-folding/</link>
	<description>Feed of posts on WordPress.com tagged "code-folding"</description>
	<pubDate>Thu, 31 Dec 2009 23:22:15 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[#region: Awesome or Horrible?]]></title>
<link>http://blog.wolffmyren.com/2008/12/21/region-awesome-or-horrible/</link>
<pubDate>Sun, 21 Dec 2008 08:05:49 +0000</pubDate>
<dc:creator>willwm</dc:creator>
<guid>http://blog.wolffmyren.com/2008/12/21/region-awesome-or-horrible/</guid>
<description><![CDATA[While coding in Java recently, I decided to do a little research to see if Java supported the #regio]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>While coding in Java recently, I decided to do a little research to see if Java supported the #region directive (or something similar) and found a ton of articles knocking its usage as poor programming style.</p>
<p>Personally, I love the #region directive in C#, as it allows me to keep my code more organized (and yes, I am aware of the exisiting code-folding functionality in Visual Studio). In the files I work with, I&#8217;ve become pretty meticulous about organizing the code blocks into regions, partially because I like the organization, and partly because I was previously under the impression that it was good form to keep source files organized in this way. I use the following regions myself, generally:</p>
<ul>
<li>Private/Protected Members</li>
<li>Public Accessors</li>
<li>Constructors</li>
<li>Public Methods</li>
<li>Protected Methods</li>
<li>Private Methods</li>
<li>(Anything class specific)</li>
</ul>
<p>I agree with the sentiment in the articles I&#8217;ve read that it is *not* good practice to sweep bad code under the rug by hiding it from the developer in a folded #region, but I think that organizing relatively good code into regions like the ones I&#8217;ve mentioned above makes it a lot easier to get directly to the code I want to work on.</p>
<p>What do you think? I&#8217;m curious to see justifications for/against this directive, and as always, thanks for reading!</p>
<p>Additional links:</p>
<ul>
<li><a href="http://artofsystems.blogspot.com/2005/09/region-directive-in-c-chocolate.html">The &#8216;#region&#8217; Directive in C# : Chocolate Covered Rat Turds Not Actually a Good Idea</a></li>
<li><a class="title-link" href="http://www.codinghorror.com/blog/archives/001147.html">The Problem With Code Folding</a></li>
<li><a href="http://stackoverflow.com/questions/169276/is-the-region-directive-really-useful-in-net">Is the #region directive really useful in .NET?</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Code-Folding en NetBeans]]></title>
<link>http://lefunes.wordpress.com/2008/07/01/code-folding-en-netbeans/</link>
<pubDate>Tue, 01 Jul 2008 19:16:24 +0000</pubDate>
<dc:creator>Le Funes</dc:creator>
<guid>http://lefunes.wordpress.com/2008/07/01/code-folding-en-netbeans/</guid>
<description><![CDATA[Si buscamos que NetBeans oculte nuestro código al igual que realiza con el código autogenerado debem]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://lefunes.files.wordpress.com/2008/07/code_folding.png"><img class="aligncenter size-full wp-image-155" src="http://lefunes.wordpress.com/files/2008/07/code_folding.png" alt="Code-Folding en NetBeans" width="242" height="197" /></a></p>
<p>Si buscamos que NetBeans oculte nuestro código al igual que realiza con el código autogenerado debemos agregar solamente dos comentarios, que incluyen un tag de apertura y uno de cierre (al estilo XML) al inicio y fin respectivamente de la porción de código a ocultar:</p>
<p><strong>comentario inicio:</strong> <span style="color:#008000;"><strong><span>//&#60;editor-fold defaultstate=&#8221;collapsed&#8221; desc=&#8221;Alguna Descripción&#8221;&#62;</span></strong></span></p>
<p><strong>comentario fin:</strong> <span style="color:#008000;"><strong><span>//&#60;/editor</span></strong><strong><span>-fold</span></strong><strong><span>&#62;</span></strong></span></p>
<p>en donde incluimos:</p>
<ul>
<li><strong><span style="color:#99cc00;">desc </span></strong>= Descripción que se mostrará al ocultar el texto</li>
<li><strong><span style="color:#99cc00;">defaultstate </span></strong>= si es igual a &#8220;collpsed&#8221;, cuando NetBeans abra el archivo esta sección se encontrará cerrada por defecto</li>
</ul>
<p>por ejemplo si tenemos el siguiente código al que queremos realizarle code folding:</p>
<pre class="brush: java;">
public static void main(final String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

        @Override
        public void run() {
            Test011_ConfExterno t = new Test011_ConfExterno();
            t.setLocationRelativeTo(null);
            t.setVisible(true);
        }
    });
}
</pre>
<p>Simplemente agregamos los comentarios y listo:</p>
<pre class="brush: xml;">
// &lt;editorfold defaultstate=&quot;collapsed&quot; desc=&quot;Metodo Main&quot;&gt;
public static void main(final String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

        @Override
        public void run() {
            Test011_ConfExterno t = new Test011_ConfExterno();
            t.setLocationRelativeTo(null);
            t.setVisible(true);
        }
    });
}
// &lt;/editorfold&gt;
</pre>
<p><a href="http://lefunes.files.wordpress.com/2008/07/code_folding2.png"><img class="aligncenter size-full wp-image-156" src="http://lefunes.wordpress.com/files/2008/07/code_folding2.png" alt="Code-Folding en NetBeans" width="544" height="355" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Geany]]></title>
<link>http://kenny1987.wordpress.com/2007/12/06/geany/</link>
<pubDate>Thu, 06 Dec 2007 20:18:54 +0000</pubDate>
<dc:creator>kenny1987</dc:creator>
<guid>http://kenny1987.wordpress.com/2007/12/06/geany/</guid>
<description><![CDATA[Im Studium werden wir uns dieses Semester mit Microcontrollerprogrammierung und Programmentwicklung ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Im Studium werden wir uns dieses Semester mit Microcontrollerprogrammierung und Programmentwicklung unter Unix beschäftigen. Für beides ist <a href="http://de.wikipedia.org/wiki/C_%28Programmiersprache%29">C</a> wichtig. Also war die Frage nach einer IDE und entsprechendem Compiler zu klären.</p>
<p>Die Frage nach dem Compiler ist schnell geklärt. Da ich zu Hause Linux nutze  wird gcc benutzt. Was mir allerdings noch fehlte war eine kleine aber feine IDE. Für meine Java und PHP-Projekte benutze ich sonste Eclipse. Für C wäre das aber wohl etwas over the top.</p>
<p>Letzendlich habe ich eine IDE namens <a href="http://geany.uvena.de/">Geany</a> gefunden (passenderweise mit ner <a href="http://www.zauberhaftewelt.de/Produkte/Sammlerfiguren/Dschinni/dschinni.jpg">Wunderlampe</a> als Logo). Sie hat mir auf Anhieb gefallen, die Features die auffallen und (mir) gefallen sind besonders:</p>
<ul>
<li>Syntax Highlighting</li>
<li>Code Completition</li>
<li>Code folding</li>
<li>Man kann mit Projekten arbeiten, muss aber nicht</li>
<li>Man hat die Compilermessages auf einen  Blick da</li>
<li>Ein Terminal ist in die Programmoberfläche (ohne extra fenster) eingebunden, undzwar mit nem ordentlichen Farbschema</li>
</ul>
<p>Falls ihr sagt, hey das kann doch meine IDE schon lange und sie kann auch noch bügeln und kochen &#8211; dann immer rein mit euren Meinungen in die Kommentare.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[My Eclipse code-folding plugin]]></title>
<link>http://themindstorms.wordpress.com/2006/11/16/my-eclipse-code-folding-plugin/</link>
<pubDate>Thu, 16 Nov 2006 12:51:00 +0000</pubDate>
<dc:creator>Alex Popescu (aka the_mindstorm)</dc:creator>
<guid>http://themindstorms.wordpress.com/2006/11/16/my-eclipse-code-folding-plugin/</guid>
<description><![CDATA[I will probably have to start with some apologies for letting you guys wait so long for the plugin I]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I will probably have to start with some apologies for letting you guys wait so long for the plugin I have announced in a <a href="http://themindstorms.blogspot.com/2006/10/eclipse-code-folding-plugin-coffee.html">couple of previous</a> <a href="http://themindstorms.blogspot.com/2006/09/eclipse-api-and-code-folding.html">posts</a>, but (as you probably already know the excuse) I&#8217;ve been very busy lately. <br />
However in order to keep things short: <a href="http://coffee-bytes.googlecode.com/svn/branches/fixes_04_09_27/distro/com.cb.eclipse.folding1.0.6.200611020605S%20.zip">here is the download link</a>.  It is not a real release, but the version I&#8217;ve been tweaking for a while and I am currently using. There are still problems with it, but most of the time it works (or at least using another programmer excuse: it works for me [smile/]). Please give it a try and let me know.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Eclipse code-folding plugin: Coffee-Bytes]]></title>
<link>http://themindstorms.wordpress.com/2006/10/11/eclipse-code-folding-plugin-coffee-bytes/</link>
<pubDate>Wed, 11 Oct 2006 19:35:00 +0000</pubDate>
<dc:creator>Alex Popescu (aka the_mindstorm)</dc:creator>
<guid>http://themindstorms.wordpress.com/2006/10/11/eclipse-code-folding-plugin-coffee-bytes/</guid>
<description><![CDATA[In a previous post I was talking about some small changes I have applied to one of the first OSS pro]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In a <a href="http://themindstorms.blogspot.com/2006/09/eclipse-api-and-code-folding.html">previous post</a> I was talking about some small changes I have applied to one of the first OSS projects I was a core developer and committer: <a href="http://www.coffee-bytes.com/servlet/PlatformSupport">Coffee-Bytes</a>. After that post, I have received quite a few messages expressing their interest in this plugin and the changes I have done to make it work with Eclipse 3.2.</p>
<p>Lately I have been very busy (speaking at <a href="http://www.javazone.no/web/show.do?page=92&#38;articleid=4598">JavaZone</a> and <a href="http://www.jaoo.dk/speakers/">JAOO</a>) and I haven&#8217;t been able to do much about it. Still, on this project we were two developers, so before doing anything I will have to discuss these details and see what are the options. However, I promise I will keep everybody interested posted.</p>
<div style="font-size:0.8em;">
<span style="color:red;">category</span>: <a href="http://www.infoq.com/Eclipse/" rel="tag">Eclipse</a>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Eclipse API and Code Folding]]></title>
<link>http://themindstorms.wordpress.com/2006/09/10/eclipse-api-and-code-folding/</link>
<pubDate>Sun, 10 Sep 2006 01:30:00 +0000</pubDate>
<dc:creator>Alex Popescu (aka the_mindstorm)</dc:creator>
<guid>http://themindstorms.wordpress.com/2006/09/10/eclipse-api-and-code-folding/</guid>
<description><![CDATA[One of the my first open source projects I have worked on was Coffee-Bytes code folding plugin. It h]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>One of the my first open source projects I have worked on was <a href="http://www.coffee-bytes.com/servlet/PlatformSupport">Coffee-Bytes</a> code folding plugin. It happened a long time ago and at some point the development has been discontinued.</p>
<p>However, tonight, working on some very long sources I have remembered it and I said I should give it a new try. Unfortunately, once I enabled it no editors could been displayed. Checking the <code>.log</code> file I have found the reason: the folding code was broken with a <code>NoSuchMethod</code> exception.</p>
<p>I have found in my archives the last version of the plugin and I thought I should check the API. To my surprise the API was still available (or at least reachable), but what made me post this entry is a feature added in Eclise 3.1: <a href="http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.pde.doc.user/guide/restrictions.htm">Access Restrictions</a>, according to which when you create a plugin you can restrict others plugin access to its code. While I find the idea quite good (as it makes the API more clear), I have found out that almost everything related to java source code editors is restricted, and I am wondering why? I thought some other plugins would benefit from a clear API (for example <a href="http://www.eclipse.org/ajdt/">AJDT</a>), and now finding this makes me wonder about the reasons (I am quite sure there are good reasons).</p>
<p>However, getting back to the points of this entry, you can read more about Access restrictions: <a href="http://wbeaton.blogspot.com/2006/01/discouraged-access.html">here</a>.</p>
<p>Following the last advise specified at the above link:</p>
<blockquote><p>But what if you really, really, really, really need to use the class? In that case, you can use it, but you need to be aware of what it means (four really&#8217;s usually does it for me).</p></blockquote>
<p>I have done some small changes to readapt the code and now I have again <a href="http://www.coffee-bytes.com/servlet/PlatformSupport">Coffee-Bytes</a> code folding working on Eclipse 3.2. Just look at the picture to see how reach it is compaired with the default code folding offered by Eclipse:</p>
<p><a href="http://photos1.blogger.com/blogger/8130/518/1600/Eclipse-Code-Folding1.png"><img style="display:block;text-align:center;cursor:pointer;margin:0 auto 10px;" src="http://photos1.blogger.com/blogger/8130/518/320/Eclipse-Code-Folding1.png" alt="Reach Eclipse Code Folding" border="0" /></a></p>
<p>It offers you folding for:</p>
<ul>
<li>top level types</li>
<li>normal methods</li>
<li>constructors</li>
<li>getters and setters</li>
<li>main methods</li>
<li>inner types</li>
<li>static initializers</li>
<li>import statements</li>
<li>source headers</li>
<li>comment blocks</li>
<li>javadocs</li>
</ul>
<p>and even <u>User defined code folding</u>:</p>
<p><a href="http://photos1.blogger.com/blogger/8130/518/1600/Eclipse-Code-Folding2.png"><img style="display:block;text-align:center;cursor:pointer;margin:0 auto 10px;" src="http://photos1.blogger.com/blogger/8130/518/320/Eclipse-Code-Folding2.png" alt="User defined code folding" border="0" /></a></p>
<div style="font-size:0.8em;">
<span style="color:red;">category</span>: <a href="http://www.infoq.com/Eclipse/" rel="tag">Eclipse</a>
</div>
</div>]]></content:encoded>
</item>

</channel>
</rss>
