January 19, 2012

Semantics and programming

After using the Play framework for a while, and reading several good articles, I started using some of the concepts that have been around the cloud for some time.

One of them took my attention, the one claiming:
"Never use strings in Java"

Initially I found this really stupid, how can you program without strings?

But after applying the concept for some months, it has showed me how wrong I was. Once you start coding with Objects, you are giving your operations a semantic meaning. This means that you can say by checking an operation identifier what it really does.

It also simplifies the API definition, because the object talk by themselves. You will not be able to pass a null string as a parameter, instead you will create a class wrapping it, then the wrapper class is in charge of checking if the data you are using is valid.

As I'm still digging into it, more posts will be written about the topic. Just as a suggestion, please take a look at it.