1. Computing

Discuss in my forum

Jennifer Kyrnin

Poll: Do you use "code folding" in your HTML editor?

By , About.com GuideNovember 26, 2009

Follow me on:

As you probably know, I've been reviewing a lot of HTML editors for the last month. And one feature that many HTML and code editors offer is "code folding". This is where you can highlight a block of HTML code and "fold" it, effectively hiding it from view. It's not gone from the document, it's just hidden from view while you edit the entire document. But I think I've used it twice in my life, and most of the editors I use regularly (Dreamweaver, Komodo Edit, and others) do have it. Do you use code folding or is it one of those features that you ignore?

Comments
November 26, 2009 at 9:10 am
(1) Richard says:

It’s a great way to get a quick overview of a document and it’s also very useful for debugging not only code (e.g. PHP) but also sorting out errant DIVs and the like.

November 27, 2009 at 12:44 am
(2) Chris from AB Web Design, LLC says:

We develop our sites with Microsoft Visual Studio 2008, and this “code folding” feature is actually referred to as “outlining.” But yeah, it’s super useful for keeping the code very clean and modular.

November 27, 2009 at 11:05 am
(3) Dave says:

We use Eclipse with the web and PHP perspectives; both of which use “code folding.”

November 27, 2009 at 3:36 pm
(4) Jennifer Kyrnin says:

@Dave: okay, both your programs have it, but do you use the feature? Nearly every editor I use has code folding, but I don’t use the feature. :-)

November 29, 2009 at 4:36 pm
(5) Sanjay says:

You used it twice only! That’s not bad. I use it often as the code gets longer it helps me a lot to see where did I start in short span without scrolling back and forth.

Sanjay
Designer and Coder
UnicHost Web Hosting Solutions

December 1, 2009 at 6:08 am
(6) Petculescu George says:

If your web page contains lot of menus and large headers and footers, code folding may be useful. I personally don’t use it, if I have to edit something quick, then ”search” function is the solution.

December 1, 2009 at 10:20 am
(7) Dave says:

@Jennifer Kyrnin: yes, I use the feature when dealing with nested blocks of code to be sure I’m working within the correct hierarchical level. (Think PHP do/for loops, etc).

Technically, “good” source files (PHP, HTML, JSP) shouldn’t be so incredibly long in the first place, but code folding is still useful when you want to put a specific area of the source file “under the microscope.”

December 1, 2009 at 7:22 pm
(8) Cable Fan says:

Our vision is pool, the display is limited too. But we can’t “delete” the code indifferent provisory,it’s the tweak to use “code folding”.

December 2, 2009 at 6:03 am
(9) Jeff Dickey says:

Personally, aside from folding header comments, I never use it, and I discourage teams I work with from using it. With the scripting and templating tools we use, it’s my strong opinion that if you’ve got so much code that you’re tempted to use folding to get a higher-level view of your current file, then that’s a code smell – you need to refactor and split things up to where each individual piece is understandable as a unit, with a page/screen or two of meaningful content. There are (extremely rare) exceptions to this, but if you look closely at them, you’ll often find they have other serious issues – and addressing those will yield cleaner code.

December 2, 2009 at 2:49 pm
(10) Jennifer B says:

I inherit a lot of awful HTML when I am redesigning sites and I use the feature in Dreamweaver to figure out the tables. I’ll work from the inside out, folding each td, then, tr, etc. It is a lifesaver when I get tables that are nested 6 and 7 tables deep!

January 21, 2010 at 8:35 pm
(11) Eric says:

It’s very useful on occasions when building sites with lots of DIV’s and held together with CSS. For example on site I’m working on, the base page that spews out the dynamic elements has 14 levels deep of Divs. Think of a wrapper, a header, a middle area with 3 columns, inside those are 4 containers holding other containers, an end of page area, a footer and so on and on. Each of THOSE areas also may call or include snippers of code or html that pull in yet more Divs.

If one breaks or you have one too many by accident as is common when you’re shuffling elements around as you build,… well the whole page breaks.

Folding from the middle of the page (not visually but code wise) outwards by folding in known div containers is extremely helpful and can save hours and hours or troubleshooting.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Top Related Searches html editor poll

©2013 About.com. All rights reserved.