Textexpander snippets for Apex

Last Updated on Saturday, 14 August 2010 07:19 Written by Steve Saturday, 14 August 2010 07:19

I just upgraded my work computer to Snow Leopard and one of the benefits I was most excited about was being able to update Textexpander, the incredibly handy snippet tool. You create short codes and when you type them they are replaced with pre-recorded text. They’re much better at describing what it does. It’s really handy for email signatures, canned content for technical support–really anything you ever type more than once.

With the new features Textexpander got really interesting for use in coding on the Force.com platform. The Force.com IDE doesn’t have code completion like the in-line code editor does, and it’s something I look forward to Salesforce.com providing. But in the meantime Textexpander is a great solution for helping you with code you write over and over again.

Textexpander now allows you to put variables in your snippets and allows you to fill those variables as you are expanding the snippet. So, for example, when you’re declaring a List of Accounts, you don’t have to type List twice, and Account twice. It’s really slick.

I’ve created a Snippet Group for common Apex syntax. To use the file, install Textexpander. Right click on the link to the Snippet Group and save to your computer. It’s an XML file, but you need to maintain the .textexpander extension on it. Then open up Textexpander and ‘Add Group from File.’ The group will show up in Textexpander.

Right now this Snippet Group includes:

  • declaration of lists, sets, and maps
  • declaration of an sObject
  • for loops, both kinds
  • if statements
  • select statements
  • test methods
  • try catch block
  • system.assert statements
  • describe result for an sObject
  • describe result for a field

It’s just a start, but if you take it and like it, add to it. Let me know and we’ll expand this Snippet Group to be comprehensive. Clearly there should be a VisualForce Sinppet Group as well. If you create one, please let me know!

Learn More

Transition is when you really appreciate keeping track of things

Last Updated on Friday, 6 August 2010 09:15 Written by Steve Friday, 6 August 2010 09:14

I recently started a new job here at the Foundation and it’s a bit like other internal transitions I’ve made in my career. There are innumerable transition tasks–meetings for getting up to speed, relationship hand-offs, getting dropped into new projects and processes, new team-members, etc. It can be overwhelming, mostly because the old duties don’t go away with the start of the new job. So there’s everything you were struggling to stay on top of before, plus all this new stuff to stay on top of, plus there is a large brain burden for trying to make sense of all the new stuff, not just keep track of the tasks. Oh, and you have to hire your replacement.

I’ve always thought that the biggest benefit of a good getting things done (GTD) system is the mental relaxation that comes from knowing you’re not forgetting things. My brain is one that cycles on things even when I don’t want it to, so I’ve really loved not having to spin on ‘am I forgetting something I’m supposed to do?’ In this transition there are a ton of new timelines and tasks I can’t lose track of. Budgets need to be done, priorities set, meetings to attend. But the best part is there is a new level of organizational strategic thinking–I get to design the strategy for my department and lead the process for our Theory of Change. And my GTD system is really helping me save the brain space for that processing. Now whether I come up with any good ideas is a different story, but it’s great to feel like I’m not spending all my cycles on a mental to do list and starving the part that could be cycling on the really fun, intellectually challenging work.

My GTD list is in Omnifocus. I haven’t fundamentally changed my GTD process, but I find I have tweaked it a bit in the transition:

  1. I’ve upped the frequency of my reviews. I look at everything more often because so much of it is new. I’ve gone from one weekly review to multiple-times-a-day mini-reviews.
  2. I created a new perspective called “Blocked”. This shows me things I’m waiting on other people for where the due date has passed. On short deadlines I need a place to look and see quickly who hasn’t gotten me what I need to move forward. This helps me with gentle nudging…
  3. I have created waiting contexts for new people I’m relying on. I mostly relied on a general ‘Waiting for someone’ context, but I now find it helpful to call out key people who are supplying me with things I need.
  4. I’m using due dates more than I have in the past. I’m finding that with all the new stuff it helps to put a hard date on it even if it’s not actually due that day. Perhaps I’ll stop doing this once the short-term stuff settles down, but for now it helps.

But I think the most important thing is that I entered this transition period with an established and working GTD system. I worked hard over the past year to get things to where they are. I was able to tweak my processes, rather than trying to learn a new system at the same time I was dealing with all the other new things. So my advice is this–the best time to get your GTD system working for you is now, not when you really need it most. You never know when transition will happen, so be ready for it!

Learn More
Copyright © 2009 Afterburner - Free GPL Template. All Rights Reserved.
WordPress is Free Software released under the GNU/GPL License.