Java Programming for Artists

 

Svetlana Ignatjeva, Dr Phys.

Department of Computer Sciences, Daugavpils University, Daugavpils, Latvia

e-mail: veta@dau.lv

 

 

Abstract

 

Many artists can see the advantages of high-level computer languages for realization of an artistic idea but can't find the way in. Some people think that whatever it takes to make a good artist makes it impossible to be a programmer. Nevertheless artists successfully use technical tools and skills, if they see in them a resource of self-expression. The approach to learning computer languages (on an example of Java programming), which one designed specially for the artists is offered.

 

Introduction

 

There are two very different kinds of programming activity: programming as software engineering and programming as an art. Standard curriculum of programming does a good job of preparing students for the first kind. Probably, for this reason there is an opinion, that good artists cannot be good programmers. Both of these approaches are extremes. Programming can be seen both as art and craft at the same time. It's craft in its use of well known tools and techniques - patterns. But it's art in the precision and elegance of fitting these to the problem domain, the generative power of the resulting solution. If to count programming by art, it is obvious, that creative people have all advantages to mastering by this kind of activity.

Some example university courses geared towards teaching artists to program are given in Table 1. The instruction in these courses range from Java to Flash.

 

Table 1. University  course of programming for artists.

 

Course Title

Instructors

 

University

 

Programming for Artists and Animators

Rhys Price Jones

 

Rochester Institute of Technology

 

Introduction to Computer Graphics and Java Programming for Artists

George Aroush

 

School of the Museum of Fine Arts

 Boston

 

 

Computer Programming

 

Martin Dickey

University of Washington

Programming concepts and applications
for artists and designers

 

Peter Gerstmann

Advanced Computing Center for the Arts and Design, ACCAD

Ohio State University

 

Multimedia Programming for Art and Design

T. Calvert

Faculty of Applied Sciences at Simon Fraser University Vancouver, Canada

 


1.    Designing of learning process

 

An effective way to communicate and document processes and information requirements is through the use the Integrated DEFinition (IDEF) technique [1].

The IDEF0 method is used to specify function models, which are "what do I do" models. These are descriptive models that show the high-level activities of a process. As shown in Figure 1, the model indicates major activities and the input, control, output, and mechanisms associated with each major activity.

 

Fumetto 1: OutputsFumetto 1: InputsFumetto 1: ControlsFumetto 1: Mechanisms

 

Figure 1. High-level IDEF0 context diagram.

 

Inputs-Outputs. Inputs are transformed into Output. Suggesting to artists to learn bases of programming we do not want to transform good artists into bad programmers. We want to give them the proper tools, environment, and flexibility to encourage creativity. Good programming, simple and useful, transports the user, moves the user, opens up possibilities that the user hadn't thought of before. For learning of a suggested material it is not required special knowledge in the field of programming. Students should have skills of dialogue with a computer at a level of the computer user.

Controls. Controls constrain and direct activities. Standards, plans, templates and checklists are all forms of control. We can be limited to terms and curricula. Desire of students to learn to program and desire of teachers to help to them in it direct educational process.

Mechanisms. Mechanisms are the resources and tools that are required to complete the process. This includes people with particular skills, machines and other tools.

Teacher of programming should see itself as a master craftsman who has apprentices and journeymen coming from all over to view his code so that they may learn the art of programming. He should be artist of programming and love the art.

The choice of programming language is not the central issue in designing an educational process. The hardest part about learning to program, in any programming language, is not the learning of the language itself, rather, it is learning how to approach the art of problem solving with a computer. It would be possible to teach this course in any high-level programming language. We use Java. Developed by Sun Microsystems, Java is a programming language that is specifically designed for writing programs that can be safely downloaded to your computer through the Internet and immediately run without fear of viruses or other harm to your computer or files. Using small Java programs (called "Applets"). Web pages can include functions such as animations, calculators, and other fancy tricks. Java is a simple, robust, object-oriented, platform-independent multi-threaded, dynamic general-purpose programming environment. It is best for creating applets and applications for the Internet, intranets and any other complex, distributed network.

 

 

Figure 2. The level 1 IDEF0 diagram.

 

Figure 2  represents decomposition of process of training. Training to programming includes learning of necessary knowledge, training by technical skills and application of these skills for self-expression. Practice and theory is the best combination when you are learning programming.

One cannot learn to program just by reading a book. It is a skill that must be developed by practice. Nevertheless, the best practitioners study the works of others and incorporate their observations into their own practice. After learning the rudiments of program writing, students should be exposed to examples of complex, yet well-designed program artifacts so that they can learn about the designing good software.

Students can learn to program by looking at good programs- not just at what they do, but the source code too. One of the less publicized benefits of the open-source movement is that it has made it easier to learn to program

 

2.    Java as a Teaching Language

 

Java is well on the way to becoming the predominant instructional programming language. The reasons for Java's success as an instructional language are basically the same reasons Java became a successful object-oriented programming language in the "real world." Java is relatively easy to use; it gracefully handles some of the tedious programming chores other languages impose on programmers; and many of its users even considered it fun to code in.

Java programming provides an objects-first approach to programming, the intensive use of object-oriented graphics, the use of event-driven programming from the beginning.  There are several reasons that graphics provide a good setting for introducing object-oriented programming. First, graphics are good examples of objects. Second, the graphics classes provide excellent visual feedback for novice programmers. Third, graphics provide motivating examples. With graphics, very simple programs can become much more interesting to students. Moreover, once animations are introduced, it is easy to provide interesting examples. The event-driven programs allow a user to interact with them through mouse movements, buttons, scroll bars, and so on. The combination of graphics and event-driven programming supports objects-first approach.  There are very good books devoted to Java programming which can be used in training process [1-8].

From the beginning, students should learn how to write programs that involve simple graphics- rectangles, ovals, and lines, for example, and programs that create graphical animations. Students and instructors enjoy writing programs that involve interesting, albeit simple, graphics. In addition to being fun, graphics are very concrete. When a program involves drawing and manipulating graphical objects in a window, you can actually see what the program is doing. This is helpful for the beginning programmer.

First, graphics are good examples of objects. Graphics classes provide good examples of objects because they have state (their location and dimensions) and a useful collection of methods. Figure3 shows a fragment of a code and visual result of one of such examples. This simple example can be used for teaching such important concepts of object-oriented programming as an abstract class, inheritance, polymorphism.

 

 

Class Fragment{ int x,y,a,n,k;

Fragment(int x,int y,int a,int n,int k){                       this.x=x;this.y=y;this.a=a;this.n=n;this.k=k;}

public void draw(Graphics g) {       }

public void movexy(int x, int y){                               this.x=x;this.y=y;}}

Class Fragment1 extends Fragment{

Fragment1(int x,int y,int a,int n, int k){

super(x,y,a,n,k);}

public void draw(Graphics g){                                            int xd,yd;double fi,r,xr,yr; fi=0;

while(fi<k*Math.PI){  r=a*fi;

xr=r*Math.cos(fi);yr=r*Math.sin(fi);

xd=(int)Math.round(x+xr);

yd=(int)Math.round(y-yr);

g.fillOval(xd,yd,3,3);                                     fi=fi+Math.PI/n;}}}

 

Figure 3. Cycloid as a object of a class "Fragment".

 

Students can use the graphics library throughout the course.Classes of graphic objects created at the beginning are used further for studying data structures, algorithms, for animation and painting.

 

  

 

Figure 4. Cycloid as parameter of function and as an element of a bidimentional array.

 

 

 

Figure 5. Variations on a theme  of a cycloid.

 

3.    Conclusions

 

1.     Programming is an art. Formulating solutions to complex projects requires lots of creativity. Beautiful code and design lasts like great pieces of art. The biggest advantage of learning programming is that it offers new opportunities for making art.

2.     The standard approaches to learning computer languages may have to be different for the artist.

3.     Java a good choice for a first-year teaching language. The object-oriented approach to programming is the most appropriate to be teaching to artists.


 

4.    References

 

[1]       Marca, SADT: Structured Analyses and Design Technique. M.1988.

[2]       Bruce Eckel, Thinking in Java, Prentice Hall PTR, 1998

[3]       David Flanagan, Java Examples in a Nutshell, O'Reilly, 1997.

[4]       Glenn W. Rowe, An Introduction to Data Structures and Algorithms in Java, Prentice Hall Europe, 1998.

[5]       Thomas A. Standish, Data Structures in Java, Addison-Wesley, 1998.

[6]       Donald E. Knuth. Fundamental Algorithms, volume 1 of The Art of Computer Programming. addison-Wesley, Reading, MA, second edition, 1973.

[7]       Kim B. Bruce, Andrea Pohoreckyj Danyluk,Thomas P. Murtagh, Java: An Eventful Approach, Prentice Hall Upper Saddle River, New Jersey 07458

[8]       Paul J. Deitel, and Harvey M. Deitel, Java How to Program, Prentice Hall Computer Books, ISBN  0-13-034151-7

[9]       Patrick Naughton, Java Handbook, McGraw Hill, ISBN  0-07-882199-1.

[10]  James W.Cooper, James William Cooper, Java Design Patterns, ISBN 0-20148-539-7