dinsdag 11 november 2008

Scala Discoveries Part I - Hello World

This is the first in a series of posts on the Scala programming language. These posts are primarily aimed to force myself to an understanding of the concepts of the language and to get myself up to speed. Therefore this series will reflect my own knowledge of the subject. It is assumed that the reader is familiar with Java.

We will start of with some basic concepts. Scala is a language which tries to combine the benefits of Object-Oriented programming and functional programming. To see what the impact of this statement is, I need to explain these terms a bit further.

Functional programming is a programming paradigm which tries to achieve results purely through functions. This means that there is no maintainance of state. State changes are only represented as functions that transform the state. This is in contrast with imperative programming, where computational results are achieved by state changes. Object-oriented programming is an example of this. Here the state of the application is captured in its objects.

Scala wants to capture the advantage of both paradigms. We will see examples of this when we go along. In fact, on one side Scala is a complete Object-Oriented language. Everything is an object, there are no primitive types and also functions are objects. But on the other side, it is perfectly possible to use for example Functional programming styles for algorithms.

Scala is compatible with Java. All Java libraries and frameworks can be used easily in Scala. This is a big advantage if you want to reuse your exising software. You can just include the Java libraries and usage of these is completely transparant.

Lets now look to the unavoidable HelloWorld example. I took this one from the tutorial on the Scala site:


object HelloWorld {
def main(args: Array[String]) {
println("Hello World!")
}
}



Most of this looks very familiar to the Java developer. One thing that immediately attracts attention is the object declaration. This is actually the declaration of a Singleton object. Scala does not have static methods. If you want to use something like that, you must declare the methods on a Singleton object. Therefore, although it is not immediately visible, the main method is a static method.
Since HelloWorld is an object, it is declared as class and also as an instance, both with the same name. The instance is created as soon as it is used.

Next time I will discuss more about the use of functions.

maandag 6 oktober 2008

Software and Intellectual Property

There is a well known tradition of protecting the so-called intellectual
property of persons. It is undeniable that this has helped technological
advance enormously.

Let us take the well-known example of the pharmaceutical industry.
Development of one new medicine costs about 1 billion dollars. Nobody
would develop medicines if the discovery was not guarded, so that the
company can earn the money back.
Even worse, for one successful development program, there are many
failed ones. The protection of intellectual property, we are talking
here about patents, is therefore very fruitful in those industries.

However, I want to discuss the question of profitability of intellectual
property management in the software industry. The question therefore
is: "Is it necessary to protect software with a patent?" My short answer
to this question is: "No!". But I will elaborate on the long answer now.

Software is a completely different domain compared with tangible
technologies. For many tasks you want to perform, you can find an
open source project which just does what you want. Trying to protect
any precious algorithms makes no real significance, except probably
for certain specific areas. My opinion is that it will be far more
profitable for companies to deliver services, than to deliver
specialized software. Software can very well be developed in open
source projects, but not all software is easy to use. A services oriented
company would add much value, to help businesses implement a
suitable IT solution based on open source software.

vrijdag 26 september 2008

First Light

Hello all,

With this first post, this blog receives its first light. My plan is to post stuff which I find interesting on software development.
I hope that the stuff I post here will be useful to some people. Of course I appreciate relevant feedback as much as possible.

Well, time for some additional information. I will explain further my purpose with this blog. Since I am active as a Java developer and since I have already gained a lot of insightful knowledge, I thought it would be a good idea to share some knowledge of my own with everyone and so giving something back to the community.

Hugo