a simple { } SCID feature for IntelliJ

I have long advocated for SCIDs,Source Code In Data Base where the
current visual representation of a program is only loosely coupled to
the source code.   

IntelliJ is the IDE closest to my ideal SCID.

Here is one simple SCID idea you could easily implement in IntelliJ.
It  takes syntax colouring a step further.

One design flaw of the Java language is that  { ... } are over-used to
bracket darn near anything, methods, classes, loops, if blocks...
If you get your { } unbalanced you can waste a lot of time trying to
sort it out.  I even wrote a free program to help in intractable
cases. http://mindprod.com/products1.html#BRACEBALANCER

Even when everything is balanced,  the matching is rarely on
screen. I have to scroll up or jump up to see what flavour it is. It
is hard to proof read or understand code when you don't know instantly
what a } terminates.

Here is my idea.  The { } for different purposes should LOOK
different.  They should differ in size and colour.   Outer {} should
be bigger and bolder. 

Then you would know which }}}}} in a nest marks the end of the loop,
the end of the method or just the end of a simple block.

The colour and size differences can be subtle so they don't intrude,
and just help subliminally.

I implement this idea is my JDisplay java -> HTML display program.
see http://mindprod.com/jgloss/products1.html#JDISPLAY

I do a similar thing for and ( ) within expressions.

See my essay on what is possible at
http://mindprod.com/project/scid.html

The begin and end markers could have icons or any other visual clue
you could dream up.
--
Roedy Green Canadian Mind Products
http://mindprod.com
It's difficult to be rigorous about whether a machine really knows,
thinks, etc., because we’re hard put to define these things.
We understand human mental processes only slightly better than
a fish understands swimming.
~ John McCarthy (born: 1927-09-04 died: 2011-10-23 at age: 84).
Inventor of the term AI (Artificial Intelligence),
the short-circuit OR operator (|| in Java),
and LISP (LIst Processing Language) that makes EMACS
(Extensible MACro System) so addictive.

1 comment

On Tue, 01 Nov 2011 06:01:41 -0700, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>Here is my idea.  The { } for different purposes should LOOK
>different.  They should differ in size and colour.   Outer {} should
>be bigger and bolder. 

I think IntelliJ maintains  a syntax tree of the code, which  would
let your  syntax colouriser do things like JDisplay does:

1. bold variable names where they are defined so you can see them at a
glance without having to Ctrl-B.

2. put interface names in italics.

You could also do things like:

1. slightly greater intensity  for instances of final variable names.

2. slightly different colours for static/instance.

3. a narrow rainbow spectrum split up to assign variables to classes
used.  The differences would be almost subliminal.

The idea is to tersely encode as much about the definition as possible
in the instance of a variable or method so you don't have to keep
going back to look at the definitions.

Along the same lines perhaps a right click or right drag over code
should display the definitions in a floating box without losing your
place.






--
Roedy Green Canadian Mind Products
http://mindprod.com
It's difficult to be rigorous about whether a machine really knows,
thinks, etc., because we’re hard put to define these things.
We understand human mental processes only slightly better than
a fish understands swimming.
~ John McCarthy (born: 1927-09-04 died: 2011-10-23 at age: 84).
Inventor of the term AI (Artificial Intelligence),
the short-circuit OR operator (|| in Java),
and LISP (LIst Processing Language) that makes EMACS
(Extensible MACro System) so addictive.

0

Please sign in to leave a comment.