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.

2 <strong>Computer</strong> <strong>Programming</strong> <strong>with</strong> <strong>GNU</strong> <strong>Smalltalk</strong><br />

MOVE d'3', W<br />

ADD d'4'<br />

I don't know if you can guess what this code does but it is obvious that it is more readable than a<br />

machine code. So we can say that Assembly language is a higher lever language than machine code. By<br />

the way, if you are curious about what the code above does, it just sums up two numbers.<br />

Now look at the same code above written in a language named <strong>GNU</strong> <strong>Smalltalk</strong> (Hmm, I never heard of<br />

it before):<br />

3 + 4<br />

I won't ask if you have guessed what the code above does because I don't know of any way to describe<br />

it better than the code line above, if you say no. So, the highest level language when we compare<br />

machine code, Assembly and <strong>GNU</strong> <strong>Smalltalk</strong> is <strong>GNU</strong> <strong>Smalltalk</strong>.<br />

Although, the examples we have given to describe the language levels are pretty simple and obvious,<br />

don't expect <strong>GNU</strong> <strong>Smalltalk</strong> as almost the same <strong>with</strong> English. It can get sometimes as confusing as<br />

Assembly, although it has a reputation as being a very high level language compared to other<br />

programming languages commonly used today.<br />

We will finish this topic <strong>with</strong> an important statement, being a higher level language does not mean<br />

being a better language. Assembly is also a very commonly used language today because when a<br />

language is close to hardware, the control of you over hardware becomes stronger. So, for doing very<br />

fundamental hardware programming Assembly is probably a good choice. Also the lower level the<br />

language you use the higher control of you over optimization of the code which results in faster<br />

programs. Of course, using Assembly to code an office suit like Microsoft Office just because of the<br />

advantages of Assembly would be a silly choice because it will result hundreds of times longer, more<br />

complex, unreadable and that's why unmaintainable code when it would be coded in a higher level<br />

language. So, you should consider all the pros and cons before choosing a programming language for<br />

the current project. This also means that you may need to choose different languages for different<br />

projects.

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

Saved successfully!

Ooh no, something went wrong!