What is code, coding and similar things.

other articles about coding:

I would start with comparing demos with classic films. Film is a long tape with images and sound. This could be compared with images and music and other data, which are created for demo by graphicians and musicians. Now you need film projector, if you wish to watch the film. And that's the task of computer program (code), to show data at monitor and play music with music card. But there's a difference. The film projector could just show final images from film, while program could process images in many ways, modify them, etc... So you could from few images with help of some mathematical formulas render whole sequence of images. Now I will try to do more formal definition of word "code".

Code is program, sequence of microprocessor instructions. Code is compiled from sources by compiler. Sources are created by programmers (coders) in some text editor. If you didn't understand too much the previous paragraph, then I'll try to tell it in more simple way. Programmer writes some texts, which looks probably like :

--------- random part of source ------------------
pic1 = LoadJpeg("1.jpg");
for ( x = 0; x < pic1->sizex*pic1->sizey; x++ ) {
pic1->picdata[x] = DodgeColor(pic1->picdata[x]); }
--------- don't think, that you could find
                such piece in our demos :) -------

Our last demo WHY needed about 402 kB of sources, what resulted in about 14000 lines of text. (this is 3500 times more, than this previous example)
These texts are compiled into microprocessor's instructions by compilers. Compilers are for example Microsoft Visual C++, Watcom C++, NASM, TASM, Turbo Pascal, GCC, DJGPP, etc...
Microprocessor instructions are in some way the commands, which were written by programmer in sources, but translated into native language of computer. Because this translation is quite time consuming process, demos are usually compiled (translated just once and stored in translated form at disk (*.exe - executable files) ). If program commands are translated from sources to native machine code of microprocessor just before command execution, it is called interpretation, but this is slow and so not supposed to be used with real time applications. Lately appeared Java language. Sources in Java are compiled in so called Java bytecodes. These are instructions too, but not native instructions of Pentium-like processors. And so, if you run some Java application at PC, you run it under some Java bytecodes interpreter (in fact, there are Java JIT (Just In Time) compilers for PC builded in these interpreters, which compiles Java bytecodes into Pentium intructions before application execution). With other words, Java is quite a hybrid, when we speak of application execution at PC, but from programmers point of view it's language, as any other. You write the source and let the Java compiler do its work. So, computer is executing commands entered by programmer.

And what it has to do with demos, graphics, music, etc... ?

All graphics, music, 3D models and texts are just a data. Computer in fact couldn't do with them anything. If you want to process data, you must have program, which reads these data, process them and sends results to proper output device (like monitor and music card). So you couldn't do a demo without program. If you have drawing program, which is able to save your image like *.exe file, and you think, that you got an viewable image without program, don't believe it. This exe file contains small program appended to the image by the drawing program, which shows the image. It's true, that you didn't have to write this program by yourself, but it is there.
On the other hand, you MAY do demo without graphics and music. You may for example draw at screen random colored pictures, or calculate images with strange mathematical formulas.

So if you choose to do demos by yourself, you will need firstly some coder, or to learn to code by yourself. Programming contains a lot of math, if you don't like math, don't think about being a programmer in future. And if you still want to be a programmer, keep in mind, that it is nearly like a drug, and it consumes so much of your time. It is possible, that you will end up like we did - sitting ahead of monitor 12 - 16 hours per day - people, who looks crazy to others. This insanity is called PROGRAMER and could be healed hardly, if could be. So, if you STILL want to be a programmer, start to search for some information about architecture and functionality of computers, what is a computer memory, how the data are stored in computer (as numbers is the simple answer, but sometimes it's worth to know, how are these numbers formatted) and than you will be supposed to choose some programming language, in which you will start to learn to code. From my personal experience I would suggest you to start with something like "LOGO". There are just few commands and it's pretty simple language. When you will understand, what are functions, parameters, variables, input and outputs, what is a "problem analysis", and you will know, how to use some standard programming techniques like recursion, loops, and so on... Than you could switch to some more powerful language like C++ or Java.

C++ is standard. C++ compilers do exist for nearly every microprocessor. Java should become a very powerful tool in future, because applications in Java should be runable at different computers without special versions of application for each computer. But I don't believe in Java too much today. It needs some time to become more standardized and to get better JavaVM implementations to make Java applications really runable "everywhere".

You could also meet with word "Assembler". Assembler = text equivalents for native microprocessor's instructions. So it differs for every type of microprocessor. There is different assembler for Pentium, different for PowerPC, other for SGI, Alpha, Sun, etc... Even subtypes of Intel 80x86 processors (386,486,Pentium,...) don't have the same instruction set. The original 8086 instruction set was expanded with each new Intel processor, that's the matter, why you couldn't run application using special Pentium instructions at 486-like processor. So, to learn assembler is usually a waste of time, if you don't know exactly, WHAT and HOW to learn. On the other hand a skilled assembler programmer could do faster and more efficient (speaking in terms of execution time) code, than the compiler of some high-language like C++ will produce. But compilers are getting better and better, and the difference in speed between assembler and C++ programs is getting smaller. While at year 1990 a program in assembler was about 1.5 to 20 times faster, than it's C++ equivalent, today compilers are able to produce code at an average assembler programmer level. And only the best assembler experts with lot of wisdom about processor and optimization are able to get in special cases about 2 times faster code, but usually the difference is just 5 - 10% in speed. This is not critical. (today you may gain a great speed boost by using better algorithm, not by rewriting application in assembler)

Anyway, I personally prefer assembler, than any other language, because I find it more simple and more clear, but this opinion is VERY rare, so you should check by yourself, what you like.

I hope, that now you understand at least a bit more, who's programmer, and what it does mean, that he is programming.

Ped / 7Gods demo group