i am rohn

thoughtfully linking code

Code Editing and Scope Opacity

I was fortunate to have been able to spend a day learning from Douglas Crockford at the FrontEnd Masters class. During his session he sidetracked a little and talked about his desire for JavaScript Scope Context Coloring in editors instead of the syntax coloring that we have now. I can certainly see benefits for it, but I also like syntax coloring and I’m not ready to give that up.

Daniel Lamb recently posted his demo of Crockford’s idea. Paul Irish gave Daniel some exposure in a Google Plus post and that started some conversations flowing.

I wouldn’t want to switch to Scope Context Coloring exclusively and give up syntax highlighting. I’ve been thinking of a toggle between the two but even that seemed cumbersome when something like code coloring should be automatic and without developer involvement. And then David Li had the most brilliant idea of using opacity instead of color for scope. Syntax Coloring coupled with Scope Context Opacity gives us both, without choosing which at which time, and also helps by keeping the current scope more in our attention focus. It reminds me of iA’s Writer which remove all the visual clutter to help you focus on the current thought.

As far as I know this doesn’t exist yet, at least not for Sublime Text 2. A perfect excuse to dust off some Python coding chops!

Comments