The Issue at Hand
For those who didn't know, DotLiquid is a straight C# port of Liquid, a library written in Ruby.
The Ruby programming language is significantly different to C#, so even best-effort attempts at like-for-like reconstruction of the library inevitably lead to structural issues in the API's design.
Lost in Translation
The structural issues that come from direct porting include:
- Excessive use of static classes.
- Excessive use of Reflection.
- Lack of Object Oriented design, leading to inflexibility.
- Duplicate code. Tight knit classes force code to be repeated.
- Excessive boxing and unboxing, leading to degraded performance.
That's not to do down DotLiquid though, which is an exceptional direct port of the original library, as for the majority of cases it is more than fast enough and anyone who has written code using the Ruby implementation of Liquid will be able to pick up DotLiquid and use it in the exact same way without hesitation.
In my quest to produce the perfect API, however, my implementation has become so far removed from DotLiquid's interface, implementation and intent that I have decided to start afresh.
Be sure to come back for my next post, where I'll begin the high level design process for the API including how and why I'll be drawing distinct boundaries between its elements.
No comments:
Post a Comment