v28 – Code Hashtags

v28 – Code Hashtags

One of my presentations at wxDevcon was “Uncle Pete Loves v28”, in that presentation we spent an hour exploring some of the new features and improvements in v28. Over the coming weeks, I will be sharing much of that information via blog post.

One of the new features in v28 is Code Hashtags and I confess when I first read about them I was like so what? But after some experimenting with them, I am quite pleased. They are a prime example of one of those features that I would call a must have by any means, but it is features like this that justifies the “Ten times faster” marketing of PCSOFT.

In simple terms Code Hashtags are simply a way for you to use a hashtag in a comment to allow you to reference that specific code. As I said I was impressed when I first read that, after all I have been doing things like // TODO for a very long time so I could find code that I need to revisit.

But the implemetation and thought that PCSOFT has put into this unassuming feature takes it to the next level. Judging by the response at wxDevCon I think it is going to be a popular feature, although in fairness that may just be because we all want to put // #Andy on our code now 🙂

So lets start with some examples and then we will look at the implementation. The prime example I use is when working on something new sometimes I have to code around another feature that isn’t ready yet, so I know I have to revisit the code when the feature is done. I often put in a comment // TODO, and then some additional comments explaining what needs to be done, and before release a quick search for TODO lets me know I have resolved all of the outstanding issues

Another example might be when working in a team, and one of the other team members needs to do something to the code, this is where the populartiy in the // #Andy hashtag come from, it it sounds like the crew in Chicago will be making quite a bit of use of it 🙂 This doesn’t replace a project management system by any means but even if you are using a project management system, it will is handy to be able to just right to the code in question verse having to figure out where it is.

Another example is with spefic customization code. Sometimes in multitenant software, we end up doing some special tweaks/customization to the code for a specific client (// #ACMEToolWorks). You can use a code hashtag to mark that code and now easily find all the customization code for specific client.

On to the implemenation side of things, the work PCSOFT did implementing the hashtags is fantastic.

Let’s start with intellisense. Once you start using code hashtags, intellisense is aware of them, which means it will suggest them, so you don’t have to keep some kind of cheatsheet of what hashtag you are using, or worry about not finding a hashtag because you made a typo! Just type // # and intellisense gives you a list of the hashtags currently used in the project, including the infamous #Andy 🙂

Already a great feature, PCSOFT could have stopped there, but they continued on! They also gave us a complete new pane we can add to the IDE for the management of code hashtags.

This presents the hash tags in a tree format, and lets use easily navigat to a specic hashtag.

Notice there are 4 Todo entries. In bold it shows me what element they are in. Double clicking will take me directly to that hashtag in the code, and notice there are also buttons for stepping through the hashtags and a search function.

But notice that text to the right of the procedure name. This is something I just discovered and didn’t get to share with the wxDevcon attendees. When you make a hashtag entry any text after the tag becomes a description so not along with the hashtag you can include a brief description so you kno why that hashtag is there.

For example my comment line for that first entry looks like this:

// #Todo Show/Hide Revisions option

And now I can quickly glance at the Code Hashtag pane and see what all still needs to be done and enough of a hint about each entry to help me know which one I should attack next, or change the tag to #Andy 🙂

There are a bunch of great new feature in v28 we will be exploring in the coming months. Only 927 more to go 😉

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s