Java without local variables

Source code serves two purposes: it represents knowledge and it provides an interface to this knowledge - an interface used by both programmers and compilers.

Because programmers and compilers process source code differently, programmers need to read and write numerous details that are not required for human comprehension. Cognitive linguistics describes language comprehension using structures and procedures surprisingly similar to the ones used by Java and Java compilers. Theories from cognitive linguistics can therefore be used to model how programmers understand source code and to advance Java programming environments.

I demonstrate the prototype of an editor plug-in for Eclipse that separates the interface and the knowledge-representation aspects of source code. By omitting information that is irrelevant for individual programmers, the editor shortens the code, without making it harder to understand. Whenever possible, the editor uses information already present in the source code to refer to objects - using anaphors instead of local variables. An anaphor refers to previously mentioned information without requiring the declaration of an identifier. E.g. the value of "new SessionContext();" can be referred to using the anaphor "sessionContext" that does not require repetitions like in the local variable declaration "SessionContext sessionContext = new SessionContext();". Because only the presentation in the editor is shortened, the knowledge representation remains unchanged and the compiler can process normal Java code. The editor presents the code to an individual programmer. When a new file of source code is opened, the code the programmer read and wrote previously can be used to choose how to present the code to the programmer in an optimal way.

Länge: kurz; Slides: BED-Con-SL-en.pdf

Sponsoren

Small Improvements
techdev Solutions
idealo
Thoughtworks
codecentric
Bosch Software Innovations
ROHDE & SCHWARZ
innoQ
pro!vision
whatever mobile
dmc
akquinet
MeteoGroup
Deveo
Axel Springer

Partner

Java User Group Berlin Brandenburg Logo
iJUG

Medien Partner

O'Reilly
dpunkt.verlag
rheinwerk