[squeak-dev] Getting rid of coloured code
Chris Muller
asqueaker at gmail.com
Mon Feb 25 02:39:00 UTC 2013
Hi Ted! I've attached my style-table method (gz'd to avoid e-mail
mangling the line-endings). It's one method on the class-side of
SHTextStylerST80. After filing it in you can activate it with:
SHTextStylerST80 styleTable: SHTextStylerST80 blackOnWhiteStyleTable
The rationale are:
reserved words :: bold and black. "Solidity" to indicate an
immutable part of the syntax.
Class names, symbols and structure (blocks, parens, etc) :: Black
but not bold because the names can vary at least during "development".
:)
instVars :: Gold because they are the "resources" a class has
available to send messages to.
message selectors :: Dark Green because they invoke behaviors.
comments :: Light-Gray to be non-instrusive, but still easily read.
literal constants :: Dark Red to stand out and also to discourage
heavy use of constants in code.
arguments :: Rust because they are rigid, they cannot be assigned.
temp-vars :: Dark Cyan because they're pliable like.. clouds or water..
And, finally,
"bad" code :: magenta because its absolutely hideous, which strongly
encourages me to take appropriate action to bring it down to a normal
color. I typically never save a method with an unimplemented sender,
so having the method name highlighted in majenta in a background
window is a highly-visible reminder. It's brightness can sometimes be
used to advantage to to "highlight" all occurrences of a variable in a
method by temporarily removing one character from its declaration.
I use the "Auto Enclose" preference to avoid majenta when using
structure (parents, brackets, etc.).
Cheers,
Chris
On Sat, Feb 23, 2013 at 7:04 PM, Ted Kaehler <Ted at vpri.org> wrote:
> Chris,
> I'd love to see your do-it to change the Shout colors to ones you
> find satisfying.
> A big problem is when you are in the middle of modifying a method.
> As you type, it does not make sense to Shout, and the next 20 lines turn
> bright red. That is annoying. I feel like saying, "I'm not done yet.
> Don't get on my case!".
> Perhaps if there are more than 2 lines in red after the insertion
> point, just turn the rest of the method black. That would keep things much
> calmer. The lack of any other colors would signal that something is not
> complete.
>
> --Ted.
>
>
>
>
> At 5:36 PM -0600 2/23/13, Chris Muller wrote:
>>
>> Wow, I'm surprised -- the human eye discerns color contrast much more
>> easily than patterns. While I don't care for the standard Shout
>> colors, by changing them to be more intuitive and constrasting,
>> particularly for longer methods, the colors _really_ enhance the
>> readability. For example, I'm able to instantly see references to
>> instVars with just a glance because they're gold (dark yellow); or
>> references to self and super because they're bolded, which quickly
>> tells me whether this is a "utility" method. Further, by making
>> comments a light-gray, they are just barely visible, so they're not
>> cluttering the code, but still easily readable if I decide to focus on
>> them for a clarification. Kind of like simply changing eye-focus
>> "reveals" different aspects of the code -- what a powerful
>> "gesture"!..
>>
>
>
> --
> Ted Kaehler
> "400 years of scientific enlightenment are being undone by TV shows on crop
> circles, ancient astronauts, and haunted buildings."
> http://www.vpri.org/html/team_bios/kaehler.html
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SHTextStylerST80 class-blackOnWhiteStyleTable.st.gz
Type: application/x-gzip
Size: 1330 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130224/c7d0508c/SHTextStylerST80class-blackOnWhiteStyleTable.st.bin
More information about the Squeak-dev
mailing list
|