06.06.2013 Views

Computer Programming with GNU Smalltalk - Free

Computer Programming with GNU Smalltalk - Free

Computer Programming with GNU Smalltalk - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction to <strong>Programming</strong> World 5<br />

made more close to hardware and converting it to completely understandable form by hardware is much<br />

faster. The converting process from byte-code to machine code is done by programs called virtual<br />

machines. The thing virtual machines do is interpreting the byte-code into machine code when the<br />

program is executed by user.<br />

Why there is this third type of language? Because interpretation is slow compared to executing a<br />

compiled program but has an advantage of being cross-platform. Cross-platform is the name for being<br />

able to run a software on different computer architectures, like different operating systems or different<br />

processors. So you can launch a program written in an interpreted language if there is an interpreter for<br />

it on the computer you are working on. The hardware you have or the operating system you use does<br />

not matter. If you had programmed the software <strong>with</strong> a compiled language you should have done<br />

compilation first for the processor and operating system you have before launching the program. This<br />

has its own advantages like being executed much faster after compilation and disadvantages like<br />

compiling the program every time you make a change in source code and every time you move your<br />

program from one platform to another. Compiling a program into byte-code speeds up this<br />

interpretation process and still has the advantages of an interpreted language.<br />

Although, <strong>GNU</strong> <strong>Smalltalk</strong> functions more like an interpreter, <strong>Smalltalk</strong> is designed as a language which<br />

uses a virtual machine. We can give Java programming language as an example of this type of<br />

languages (and a very successful one, indeed).<br />

Procedural, Functional and Object Oriented <strong>Programming</strong><br />

Another categorization of programming languages are according to their paradigms. A programming<br />

paradigm is how a programming language looks at the problems to be solved. There are mainly 3 types<br />

of programming paradigms: Procedural, functional and object oriented. To keep it simple and not<br />

confuse you <strong>with</strong> words you don't know yet we will only mention about object-oriented programming<br />

which is the heart of <strong>Smalltalk</strong> language.<br />

Object oriented programming looks at the world as an object compound of other objects. According to<br />

this paradigm everything can be considered as an object. For example, a computer, a television, a book<br />

etc. are all objects. Also all of this objects are compound of other objects. For example, a computer is<br />

made by bringing a main board, a graphics card, a hard disk and some other hardware together, which<br />

are all again objects.<br />

Object oriented programming is generally considered as the most close programming paradigm to<br />

human thinking. So, when you write object oriented programs you feel more comfortable and you can<br />

focus into solving the problem instead of worrying about the programming language structure, rules<br />

etc..<br />

There is no rule that a programming language should be based on only one paradigm and built itself on<br />

it. Actually, there is even a name given languages which allow the coder to use more than one paradigm<br />

during programming, multi-paradigm programming languages. <strong>Programming</strong> languages which allow

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!