Skip to content
Jim Priest edited this page Apr 15, 2014 · 16 revisions

cf.Objective 2014

##Digging Into The Developer Toolbox ###Work Smarter, Not Harder

“An apprentice carpenter may want only a hammer and saw, but a master craftsman employs many precision tools. Computer programming likewise requires sophisticated tools to cope with the complexity of real applications, and only practice with these tools will build skill in their use.” – Robert L. Kruse, Data Structures and Program Design

Don't want to read all this gibberish? Skip to the links and resources.

WHY AUTOMATE

Not What But Who

Tools are important. But you are really trying to develop good working habits that maximize your time and reduce your effort. It’s not what we are trying to automate, but who.

Main Entry: au•to•mate
Pronunciation: \ˈȯ-tə-ˌmāt\
Function: verb
To convert to largely automatic operation

Three R’s

Repetition

We’ve all gone through the struggle of learning a new tool whether it is a new operating system or IDE. Learning new tools and techniques takes time.

Resolution

It also takes patience. While you may want to give up you need to give yourself time to adjust to new techniques. You are re-training yourself to work smarter.

Re-evaluate

No tool is perfect. With the internet there is a vast flood of software available. Constantly be on the lookout for new tools. See my resources section at the end of the handout for places to look.

Time Savings

Your time is precious. Always consider how you can do repetitive tasks in less time. If you do it more than once consider automating the task.

TYPE MORE (mouse less)

While the mouse is a useful tool in some circumstances the majority of our time as coders is spent typing in code. The less we need to stop typing and move a mouse the more we can accomplish. Almost every application includes keyboard shortcuts. Take time to learn them.

AutoHotkey is a free, open-source utility for Windows. AutoHotkey unleashes the full potential of your keyboard (and mouse). With it you can:

  • Automate almost anything by sending keystrokes and mouse clicks.
  • Create hotkeys. Virtually any key, button, or combination can become a hotkey.
  • Expand abbreviations. For example, typing “btw” can automatically produce “by the way”.

AutoHotkey can automate the tedious things you type over and over every day.

Q. But my IDE already has something similar… why not use snippets in ColdFusion Builder/CFEclipse? A. Snippets are only available in your IDE. What happens when you are editing some code in Notepad? Sending an email with some code samples? Writing code documentation in Word? With AutoHotkey you can use the same ‘snippets’ everywhere – not just in your IDE.

See code examples

Emmet (formerly Zen Coding)

Emmet is difficult to describe – from their website: “the core of this plugin is a powerful abbreviation engine which allows you to expand expressions…into HTML code”. Emmet is available as a plugin for many editors including Sublime, Eclipse and IntelliJ. Emmet has a somewhat steep learning curve but can save a tremendous amount of typing:

You Type

div#page>div.logo+ul#navigation>li*5>a

You Get

<div id="page">
 <div class="logo"></div>
  <ul id="navigation">
   <li><a href=""></a></li>
   <li><a href=""></a></li>
   <li><a href=""></a></li>
   <li><a href=""></a></li>
   <li><a href=""></a></li>
 </ul>
</div>

While you could replicate some of this functionality with AutoHotKey, Emmet is dynamic, giving you control as you type. Imagine what would happen if you combined them!

Browser URL Shortcuts

Enter a word in the address bar and hit CTRL+ENTER and automatically add the http:// and .com bits. Type ALT+ENTER and add .org.

Firefox Bookmark Keywords

When you create a bookmark in Firefox pay attention to the keyword field. This allows you to assign easily type keywords to your often used bookmarks.

Stop Filling in Forms

Stop filling in the same information into the same form fields day after day. How many times do you enter the same information into forms like blog comments and order forms? There are several popular browser plugins/extensions that enable you to easily fill out forms with a click or keystroke.

Clipboard Manager

How many times a day do you cut-and-paste text, snippets of code, email? Start using a clipboard manager and get more control. Copied something yesterday? Reuse it from the clipboard memory! Easily accessible via a keyboard shortcut the clipboard manager can remember what you copied so you don’t have to. Most allow searching, support images and have lots of options.

GET ORGANIZED

Launchers

Is your desktop littered with icons for programs and documents? Do you have to hunt to find programs to launch? Clear out that clutter and let the computer do the work. Launchers can scan your entire computer for programs, documents and more. And with a simple keystroke you can easily find what you are looking for in seconds.

Virtual Desktops

Hopefully you have two monitors but wouldn't it be nice to have 4? Or 6? Virtual Desktops can do just that. Have a desktop dedicated to email. Another to your browser and yet another to your IDE. Easily switch between them with a keyboard shortcut.

WORK SMARTER

Don’t forget the tools you use every day. I recently cleaned up a huge spam mess on a Trac install by mashing up some ColdFusion, Ant and Selenium. You know these tools – just think outside-the-box for other uses.

DOS / Shell / Git Bash

Do you restart ColdFusion by clicking through 5 menus to get to the Services panel? Write a simple batch file to do it, and launch it with a AutoHotkey shortcut or through your launcher. With one batch file I can restart ALL my web related services at once.

See code examples

Ant / Grunt / Gulp

I love Ant and if you have not tried it yet you should. I maintain a wiki of Ant resources and links..

Ant is certainly still useful but checkout new tools like Grunt, Bower and Yeoman which allow you to easily configure a site with a simple command and automate chores like linting your code or minifying your CSS.

ColdFusion (insert every other programming language here)

Facing an odd problem? Don’t forget your favorite programming language!

Remember all the things that ColdFusion makes easy:

  • File and image manipulation
  • Generating PDFs
  • Zipping files
  • Email
  • Scheduling

Don’t forget your favorite language when facing a difficult challenge!

Cron / Windows 7 Scheduler

Do you fill out a timesheet every day? I do. But I don’t click though 5 menus to open it. I setup an automated cron job that starts the application every weekday at 4:00PM. I also use it to kick off batch scripts that restart my ColdFusion services and update my code from Git every morning before I get to the office.

Avoid Windows Task Scheduler if you can. It's complicated and I find it unreliable. YMMV.

Cron is a simple text file and available on Windows, Mac and Linux!

See code examples

Quick Tip: Check out your computer BIOS to see if you can schedule when your computer powers on/off. You can also script this behavior.

Selenium

Selenium is a great testing tool but you can also use it to easily record any time consuming repetitive task you do in your browser. Think outside-the-box!

##Resources / Links

##Legal Stuff This project contains notes, code examples and other resources for my 2014 cf.Objective presentation.

Everything is 'as is'. If you run this code and it formats your computer... not my fault.

All my presentations are licensed under a Creative Commons Share-Alike, Attribution license, meaning that you are are free to reuse the material as long as you have as least the same license and that you note where the material originates.