Monday, 30 January 2012

CodeRush Feature Of The Day: Quick Navigation

Following my last post on the awesomeness of CodeRush, I’ve been using the quick file navigation facility a lot. Ctrl + Alt + F pings open a quick search dialog which in a stroke of pure genius lets you type in the initials of a file and it will find it by parsing camel/pascal casing of the file names. Marvellous.

I was just given a task to fix a bug and the description pointed to the exact method that was at fault. “Hmmm,” I thought, “CodeRush should be able to let me dig out the exact method in the same way that I can find files.” So I revisited the aforementioned big list and found the entry for quick navigation. The magic keys for this are Ctrl + Shift + Q, annoyingly this means that there is a mismatch with shifts and alts for the different search types which I suppose is the sort of problem that arises when you’re trying to fit a bunch of functionality into a huge app that is already loaded with functionality. That minor gripe aside it works with the same brilliance of the find file window. There are a few more options to fiddle with for this search however. It is able to find individual variables as well as methods and types etc, so for if I were to search for mt looking for MediaType it returns m_editionType and m_telephone as well. The options allow filtering of different kinds of searches so I may need to find a balance for a good default set. In fact, it seems that it may be handy to have a few shortcut keys to bring the window up with different search options configured, but I’m not sure that this would be possible.

In conclusion, it’s a handy facility with a lot of power that should fit nicely into my common usage.

Tuesday, 3 January 2012

Epilogue - Prolog Day 3

Ok, I'm feeling really lazy and I've not done any of this book for ages, so I decided to wap through the last chapter to get it out of the way. Once again I'm left feeling more like it falls short of being something that I'd consider to be a full language due to its incredibly tight focus on the realms of logic, similar to how SQL is a very focussed language for data manipulation. Pretty much the definition of a DSL I suppose. Infact, I think I'd appreciate it a lot more if there was any indication that you could run Prolog to query it from a general purpose language like we do with SQL databases, but if that's possible (without some nasty techniques of shelling out an instance and fiddling with text manipulation on the command line) there was no instruction on how to do it.

The chapter dug deeper into handling complex logic problems with a few game-based puzzles, solving 8 queens (where you need to place 8 queens on a chess board with none in the same row, column or diagonal) and a sudoku solver. The relative simplicity with which a sudoku could be solved, simply by expressing the rules of the game shows how powerful Prolog can be, but with the language's limited scope, interacting with it continues to be clunky, and again I want to see how to harness a Prolog back end from an app written in Ruby or something to get the best of both worlds.

I glanced over the tasks for the day, but I'm ashamed to say that I didn't attempt them. I gave a little thought to what might need to be done, but I can't shake the feeling that Prolog doesn't offer me anything that I can use, so I skipped out on it.

Next up is Scala which seems to be approximately the Java/JVM equivalent of F# in .Net land. I've done a little twiddling with F# and use C#'s functional abilities quite regularly (mmmm, lambdas) so I'm quite looking forward to this one. Fingers crossed I'll get on with all the remaining languages a bit better than these last two. After Scala we have Erlang which I've heard interesting things about, then Clojure which is Uncle Bob's current language of choice which is always a good recommendation, and finishing with Haskell which takes the functional paradigm further.