Sunday 19 January 2014

Byzantium

If you follow this blog you'll probably know that I'm pretty much into Vampire films, so since I knew that Byzantium was in production I've been quite interested on grabbing my hands on it. I've done so this weekend, and well, the film is pretty good.

The plot is quite original. While it touches on common Vampire topics like loneliness, it does it from a slightly different approach, more that the loneliness and pain of seeing everyone you can love age and die, this is the loneliness coming up from being constantly on the run escaping from someone else. This time, our main vampires are 2 beautiful women, a teenager and her young mother (hum, off the top of my head I can't think of any film were female vampires are portrayed as cute ladies) that are not part of the typical semi-aristocratic elite, but they lead a difficult life struggling to make ends meet.

The initial story behind how they turned into vampires develops as the current story does, so it keeps you intrigued until the end. The process that turns you into a vampire is quite new, not being bitten by another one, but traveling to a remote island to die and rebirth (this is quite a spectacular moment, with a water fall suddenly running red as the new immortal blood runs through your veins). Also, our vampires do not bite other humans to get their nutritious blood, but pinch their neck with a sort of extensible nail, and they are not killed with a stake or being burnt by daylight, but decapitated. The setting for the story is quite appropriate, some coastal cloudy town somewhere in the British islands, so it helps in creating the ambience of sorrow where the teen vampire dwells in (by the way, her sad expression reminds me in a way of Sibel Kekilli in When We Leave).

All in all, a quite enjoyable film you should give a try to.

Sunday 12 January 2014

Lake, mural art from Berlin

I think there's no discussion that Berlin is the European capital of Street Art (and probably the world's too). Some of my favourite artists (El Bocho, Alias, C215...) live or have lived there, or at least have done some sort of pilgrimage there (Blu) to leave their mark.

In my last visit to Berlin, while glancing through the very interesting books in Big Brobot (if you happen to be in Berlin-Friedrichshain, don't miss it, it's a lovely shop), I came across the second installment about the work of another Berlin genius, Lake (Lake mural art from Berlin & other cities part 2). I have to sadly admit that I was unaware of this great artist, and only a few of the Berlin works shown in the book seem familiar to me (the ones in the East Side Gallery mainly, and I think some of the pieces that so much I've enjoyed in The Fifty Faces are his). His style is quite distinctive, particularly his "horizontal works", complex and appealing. Aesthetically impeccable, most of his creations contain some kind of (left) political message, either in the drawing itself, or steaming from the fact that it has been made in run-down impoverished areas, trying to create beauty there where ugliness is the day to day reality.

The weak point of this book is the lack of information about the location of the works (it just indicates the city), so I'll have to do quite a bit of research through the net to try to pinpoint the exact locations of his Berlin works so I can pay a visit in my next trip there.

This mural below is really powerful, and would deserve a better location (let's say Kreuzberg or Friedrhicshain), as it's real location (Schöneweide) has gained some notoriety in the last years for being the place of choice for many neo-nazi subhumans to settle down (there's even a pub/kneipe ran by one those pigs).

I feel sort of ashamed by such a short post, so I'll expand it by mentioning that you can visit the , the Street Art section in this blog by a "Berlin wanderer" to get a nice introduction to the Berlin scene, and that you should treat yourself visiting the beautiful work by this other Berlin genius, Alias (aesthetics + message, the way it should always be).

Saturday 4 January 2014

Scala traits

I mentioned in a recent post how some .Net developers are embracing F# as a more modern language than C#. This prompted me to check some of its features and in the end this took me take a glimpse to a couple of F# vs Scalar discussion. As I I lack of a "functional programming mindset" many elements in those discussions are alien to me, but the thing is that Scala sports a really interesting feature, traits/mixins.

Well, Traits/Mixins seem like an eternal source of conflict: what's the difference, are they just the same? I wrote about it some time ago and I think the conclusion I had drawn at that time after reading several materials on the topic is still right. Anyway, in Scala they're 2 parts of the same thing, we define traits, and then adding a trait to a class or instance is called mixin class composition. There are excellent examples like this all over the net, so I won't repeat code here. The idea is that traits can have both methods and properties (data fields), and can be mixed in into new classes or new instances, enabling some taste of Multiple Inheritance.

If we compare this to what is offered by Java 8 and Default Interface Implementation we can see that Scala traits are much more powerful. The Java 8 counterpart only allows inheriting behaviour (methods), while Scala allows inheriting both behaviour and state (notice that given than Scala Traits can have state, they have constructors. Furthermore, we can mixin traits not just into a new class, but directly into a new instance (I guess the compiler will do some magic under the covers to create new classes for such instances).

One thing that to my knowledge is missing is the ability to add a trait to an already existing instance (so we can't expand existing objects as we do in JavaScript, Groovy (ExpandoMetaClass) or even C# (with dynamic)).

So Scala traits are a really powerful feature that I would very much welcome in C#, but I've read some statements that confuse me a bit. Some people talk about how you can use traits for AOP. At first instance this article seemed really interesting. You use a trait to override a method to which you want to add the crosscutting concern. But after a second thought, the thing is that this leads to tons of code repetition. For each method you want to override you'll have to add one method to the trait with the extra code and the call to super, and you'll have to do this for each class. So, maybe it's that I'm missing something, but otherwise this approach seems terribly weak when compared to the normal AOP techniques using Dynamic Proxies and interception.

A concept sometimes mentioned when talking about Mixins and Traits is Monkey Patching. I think the difference lies on the fact that while Mixins/Traits are used when creating new classes (or instances), Monkey Patching is applied to existing classes or instances. In Scala I think you have access to some sort of Monkey Patching by means of implicit.

Finally, I'd like to recommend this excellent series comparing features in 3 of the more valued alternative JVM languages: Groovy, Scala and Clojure. By the way, I absolutely agree with this phrase by Martin Fowler mentioned there:

The legacy of Java will be the platform, not the language.