Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at CFinNC 2009 (Raleigh, North Carolina) with: Simon Free and Todd Sharp and Shannon Hicks and Charlie Arehart and Sean Corfield

My Compromise On ColdFusion Code Snippet Color Coding

By Ben Nadel on
Tags: ColdFusion

That title is a mouth-full!

I have been battling with color-coding my ColdFusion blog entry code snippets. In my blog, all of my code is organized in unordered lists with a div wrapper. I love using lists for code layout because it give me greater control over the layout, the inline "framing" for scroll bars, and the way the code lines wrap. I have seen PRE tag usage all over the place and the code always looks junky to me. It wraps, the tabbing is poop, and the readability is non-existent for anything long.

Now, my DIV / UL combo makes color coding very hard. I have tried to go down that route and it is just a headache. BUT, color coding does add a ton of readability to the code. I have come up with a compromise: inline, I will continue to use the DIV / UL solution. However, at the beginning of every code snippet I am adding a link (at run time) that will allow you to pop the code snippet up into a new window. The code in this new window will use the PRE method with proper color coding.

I would love some feedback on how this solutions works for people. I think it leaves the main blog much more readable but gives the option to make a view of the code much more readable.



Reader Comments

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.