Development Tip: Change Your Coding Font

Just posting a quick tip about a topic that most people would probably not consider: changing your font in your IDE. I highly recommend Consolas on Windows, and the very similar Inconsolata on the Mac, which are by far the best fonts I've found for coding. It sounds a bit crazy, but a little thing like this can make a big difference in your productivity, especially when you're literally staring at it all day! Check it out compared to Courier New, a common default font:

Consolas / Inconsolata:




Now Courier New:




To me, the difference in sharpness and clarity is quite significant! Give it a try and see what you think.


Comments Comments (27) | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 14631 Views

For Users of Eclipse, SVN, and Trac: Mylyn Utterly Rocks

I've been using Eclipse as my IDE for a while now. It's just far too sweet to have my CF IDE and Flex IDE together, plus XML, CSS, HTML, ANT, and all the rest. I've also been a Subversion zealot for a long time. Quite frankly, if you're not using Subversion, for everything related to your development, then you're nuts. And a glutton for punishment. This means all of your code (yes, even those stupid little tests where you try something out), but also all of your documents, database schemas, SQL queries, ANT build files, etc.

But this entry isn't a plea to your logical side to use Eclipse or SVN. I'm assuming you already are. No, this entry is about integrating Trac task management into Eclipse through the Mylyn plugin.

Put simply, Mylyn kicks ass. It links to your Trac repository via web interface or, better, XML-RPC. If you don't have Trac, consider using a service like CVSDude which includes SVN and Trac, or setting up a fully configured virtual server using Jumpbox.

Once you get things set up, Mylyn allows you to handle all aspects of task management from right inside Eclipse. It ends up looking like this:



As you can see, it gives you a full list of Trac tasks. You can sort or categorize these any way you want to. It lets you do a "focus on the workweek" mode, which limits what you see to only tasks due this week. You can create, modify, or close tasks right from Mylyn, no need to work with the crappy Trac web interface. This alone is really great, but it gets better.

Mylyn lets you attach a "context" to any task. This means it will keep track of what files you are working on that relate to the current task. So if you come back to a task later and activate it, Eclipse loads the attached context and shows only the files and resources that have to do with that task! This is great since it makes it much easier to work on a task without seeing a bunch of unrelated files. Of course you can choose to show everything in your workspace again if you need to add more files to the context. This is really a great idea.

Finally, if you have the proper connection set up between Subversion and Trac (which CVSDude and Jumpbox do), you can close Trac tickets directly in your commit comments! So if you commit with a comment like "Fixes #188", ticket 188 will automatically close and have a comment added that references the Subversion revision that closed it!

All of this really creates a full-circle version control and task management capability, all from within the IDE. More details are available at the Mylyn page, or you can read a more thorough article at IBM. I'd urge anyone to have a look at this very cool plugin and enjoy the immediate workflow benefits. And to anyone already using Mylyn, feel free to share your experience or any tips you have.

Comments Comments (7) | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 13239 Views

ColdFusion IDE Survey

Ray already blogged with a link to it, but this is so important that I think it needs to be aggregated to everything we can get our hands on. Damon Cooper has put up a survey asking about what features you use and what you want to see added to a ColdFusion IDE. Please fill this out and let them know what you want, and hopefully we'll see a great IDE just for ColdFusion that rivals FlexBuilder.

del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 4737 Views

Using ANT and ColdFusion to Emulate Rails Generators

One of the nice things about Rails is how it can automatically spit out common code for you. For example, if you need a new Model or Controller, Rails can spit one out for you, ready to be customized, with one line of code.

I've thought for a while that similar capabilities could be obtained using Apache ANT, which comes built in to Eclipse or can be downloaded separately and run from the command prompt. Last night I had a few minutes so I decided to try it for fun. And it seems to work pretty well!

For example, in a Model-Glue app, I could execute an ANT task called create_controller.xml. What this would do is prompt me for the name of the controller. Say I enter "StoreController". Then it copies the Controller from the Model-Glue application template folder into my application's controller folder and names it StoreController.cfc. Then it embeds new XML into the Model-Glue config XML file like:

<controller name="StoreController" type="deli.controller.Controller">
	<message-listener message="OnRequestStart" function="OnRequestStart" />
	<message-listener message="OnQueueComplete" function="OnQueueComplete" />
	<message-listener message="OnRequestEnd" function="OnRequestEnd" />
</controller>
		

into the controllers block. It does this by doing some replace commands on the Model-Glue XML, as well as replacing the controller name and the application name. It does the same sort of replace within the CFC to embed the proper name and path.

I also did this with a create_event.xml file. This prompts me for the name of the event, and a view file name, and then creates the XML for the event, copies a view template into my views folder, and name it to match the view file name I specified.

If you've used the Model-Glue application template to create a new application, you know it already does some copying of files and some replacing. It wouldn't be hard to imagine it also copying and creating a set of build XML files to perform common tasks like this. These build XML files would all be set up specific to the newly generated app, with the proper paths and application name already embedded within them. And obviously the same sort of thing could be done with any framework (ColdBox, Fusebox, Mach-II, etc.)

These two examples were quite simple to create. And while they don't save a huge amount of time, it does save some time. I don't have to worry about creating new view or controller stub files, or creating the base XML in the config file. The build XML will do this for me in about one second. I could imagine making these do much more complex things if necessary, since ANT has a very large set of tasks that it can perform, including RegEx processing and replacement.

I was curious to see if anyone had thought about something like this before, and if this sounds like it would be useful.

Comments Comments (7) | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 7289 Views

Even More CFEclipse Snippets

Inspired by Dan Wilson's post on CFEclipse snippets, I thought I'd post some as well. I have a lot of similar snippets to the ones Dan showed in his post, but I also have some shorter but equally useful snippets that I wanted to share. I hope folks find them useful, they sure eliminate a lot of typing for me!

Trigger Text: qloop

<cfloop query="$${queryName}">
</cfloop>
		

Trigger Text: aloop

<cfloop from="1" to="#ArrayLen($${arrayName})#" index="$${indexName}">
</cfloop>
		

Trigger Text: sloop

<cfloop collection="#$${structName}#" item="$${itemName}">
</cfloop>
		

Trigger Text: lloop

<cfloop list="#$${listName}#" index="$${indexName}" delimiters=",">
</cfloop>
		

Trigger Text: lset

<cfset local.$${varName} = $${varValue} />
		

Trigger Text: vi

variables.instance.$${varName}
		

Trigger Text: try

<cftry>

	<cfcatch type="any">
	
	</cfcatch>
</cftry>
		

Comments Comments (8) | del.ico.us del.icio.us | Digg It! Digg It! | Linking Blogs Linking Blogs | 8233 Views

More Entries