As part of my M.Ed. project, I’ll be building a web site. Most sane people would do this using Dreamweaver or some similar product. I, however, am not one of those people - I prefer to create web pages by hand-coding the HTML and CSS files. I suppose if I wanted to be uber-geeky about it, I would write my own text editor (in assembler, if I wanted to be really hard core about it), but I’ll stick with ones that are currently available for the Mac.
My requirements are fairly simple. I need a text editor that I can use to write HTML and CSS files. Any text editor could do this. Heck, I could use vi if I really wanted to geek out. I’d like to have an editor that did some of the coding automagically. I like to hand code, but I don’t mind using some tools that help to automate the typing. I could use the code editor in Dreamweaver - I’ve used it before and its actually very comfortable to use. Using Dreamweaver just to do handcoding is like buying a Ferrari just for driving to the local grocery store - a waste of money and not using the functionality to its fullest. Besides, with Dreamweaver I might decide to use the WYSIWYG mode, and that is the way to the dark side.
I also like to use some open source software, if possible. The free (as in beer) part certainly appeals to me, but so does the speechiness type of freedom. In my experience, a strong user community around an open source project is usually a better source of application support than the support available for commercial software. Also, if I am really stuck on something or I have suggestions to improve the program, I can contact the developer(s) directly. Try that with most commercial software!
I did a little bit of research into this, and thought I should share the results with others. Lest you think I am being overly concerned with this, a good text editor is to a coder what power tools are to a carpenter. We can get good results with mediocre tools but its an easier job to do, and more fun, with good tools. Admittedly, my needs as a coder, not to mention my skills, are minimal but I still like to work with proper tools.
OK - here are my thoughts on the text editors I reviewed. I won’t claim that I’ve done a thorough job of testing each editor, so some of these descriptions are based on limited experience.
TextEdit
Free with Mac OS (equivalent to NotePad in Windows). Nothing fancy for editing tools, just straightforward text editing. Free with all Macs, and apparently the source code is open and distributed with Xcode. TextEdit also has some nice word processing features, but I don’t need those.
Rating: 1/5 (as an editor; for other uses it would rate 3.5/5)
JEdit
Nice editor, many good plugins available including an XML plugin that does automagic tag closing for HTML tags, and makes tag suggestions when creating tags (similar to Dreamweaver code editor). No built in auto XHTML file templating, but a macro was easily written to do the job. Macro recording (or writing, if you aren’t afraid of a little coding). Feels very Emacs-ish. Open source.
Rating: 4/5
- Smultron
Open source, Mac OS only. It has a very Mac-ish look and feel to it, with the toolbar at the top. Multiple windows can be open simultaneously, with a pane showing a list of currently open documents. Keyboard shortcuts to move between open documents. There is a built including XHTML template. Full screen edit mode for distraction free writing/coding. Includes a command line tool - this editor has many command line connections, including ability to run shell commands, or run the file or selected text. It can auto-close tags, and can make text suggestions for partially completed word. This would make a really nice HTML editor. There is a lot of well-thought out functionality in this editor and may end up being my choice.
Rating: 4.5/5
- TextWrangler
Proprietary, but free, from the good folks at Bare Bones Software. This is essentially a limited version of BBEdit. It excels at using regular expressions to transfrom text, but as an HTML editor it isn’t as fully featured for coding HTML as Smultron or JEdit. Has an Emacs-ish feel to it.
Rating: 3/5
BBEdit
The 500 pound gorilla of Macintosh text editors. I remember using BBEdit on my old (OS 8 era) Mac, and it was a joy to use as an HTML editor (I didn’t do much coding back then). I’m not sure if my memories of BBEdit are correct or if my expectations of an HTML editor have increased, but I find that BBEdit, like Text Wrangler, is an adequate HTML editor but not a particularly great one. The functionality in BBEdit is perhaps too much for my meagre needs, and it is verging on becoming bloatware (IMHO). It is also the priciest of the Mac text editors at US $125, which works out to $145 Canadian, quite a bit considering the availability of free editors like JEdit and Smultron, and the availability of lower price editors like TextMate.
Rating: 4/5
TextMate
This is an newer text editor but unlike Smultron, TextMate costs 39 euros, which works out to about $60 Canadian. As an HTML editor, it is as sweet as candy. New (X)HTML documents can be created from a template, which is editable. Keyboard shortcuts are available for almost all standard functions such as moving word by word or to the end of the current line.
An interesting variation on keyboard shortcuts are tab triggers. These are short strings (such as ‘div’ to insert a new div tag) that activate an action when followed by a tab. I typed in ‘div’ followed by a tab, and a pair of div tags were created including a placeholder for an id property; if I want to use it, I tab then type in the id for the div, and if I don’t want it, I hit the delete key then a down arrow and I’m ready to add content inside the div tag. It took me about 30 seconds to create a snippet (piece of text that is used frequently) for a paragraph tag (which suprisingly is not included with the program, or at least I couldn’t find it), then another 10 seconds to assign a tab trigger for it. Sweet!
TextMate was the winner of the Apple Design Award for best developer tool in 2006.
Rating: 5/5
Final thoughts
I’d narrow my choices down to JEdit, Smultron and TextMate. TextEdit has no pretense of being a programmer’s editor, even for something as simple as HTML, and would only be suitable if you liked to type everything out one character at a time. I need something with a little bit more HTML programming finesse. Text Wrangler and BBEdit have great text processing capabilities, but feel a little too emacs-ish for me (not to start a series of comment flaming, but I’m more of a vi guy), and aren’t especially welcoming for someone who just wants to do some productive HTML coding. I like JEdit. It is free software/open source. Its extensibility by plugins is terrific, and there seems to be a strong community (always a good thing for an open source project). I have used it in Linux and Windows environments, and will continue to do so. The Mac-ishness of Smultron and TextMate, as well as their design as coding tools, make them my clear choices. Given my preference to use free (as in both beer and speech) software, Smultron will be my first choice. I may still be lured to TextMate, definitely my favourite of the entire bunch.