Archive for the 'programming' Category

The Future of D is Functional

The D Programming Language has an impressive list of cool features. That is not always a good thing. A feature should contribute to the philosophy and foundation on which the language was built. If it doesn’t, harmony breaks down and the result is a language that is harder to learn and to use.
Some people think [...]

Virtual or non-virtual by default, do we really have to choose?

When it comes to the question of whether methods should be virtual by default or not, there are two schools of thought. Anders Hejlsberg, lead architect of C#, describes them in an interview from 2003.
The academic school of thought says, “Everything should be virtual, because I might want to override it someday.” The pragmatic school [...]

Virtual by default is better

I’ve taken quite a few paradigm shifting journeys in my life. Some have been quick insights, instant moments of clarity. Others have been slow processes, spanning over several years. One such slow journey for me has been how I look upon virtual methods of object oriented languages.
Java methods are virtual by default. Unless explicitly marked [...]

Loop Abstractions in D

One of the great things with Ruby is the natural way in which you can hide looping constructs behind descriptive names. Like the retryable example that Cheah Chu Yeow gives on his blog.

retryable(:tries => 5, :on => OpenURI::HTTPError) do
open(’http://example.com/flaky_api’)
end

Notice how elegantly the loop logic is abstracted; There’s no need to look at the [...]

Adaptive Database Optimizations?

I love Rails Migrations. Not only do they help making database development a part of an agile development process, they also make my life easier as a developer with shallow knowledge in the field of database programming. But, even with frameworks like these, I think we’re still dealing with databases on a very low level.
Conceptually, [...]

Don’t unit-test GUI

I’m currently rereading parts of the book Test-Driven Development: A Practical Guide, by David Astels. It’s a great book in many ways, well worth reading, but I have objections to one particular section in the book.
The author tries to convince me that developing my user interfaces using a test-driven approach is a good thing to [...]

Does unit-testing deserve its own DSL?

We’ve done a lot with testing frameworks over the years, but does the testing concern deserve its own standalone DSL?
This intriguing question was asked by Michael Feathers in his Mock Objects: Leaping out of the Language post. My spontaneous answer is: Absolutely!
I’m a big fan of xUnit frameworks, but when I imagine an alternative [...]

Abstraction is The Name of The Game

I just read a post by Uncle Bob that discusses the optimal length of a function. He quite correctly claims that the old functions-should-fit-on-a-screen rule lost its validity. He further states that “A well written function might be 4, 5, perhaps 8 lines long; but no longer.”
I’m not saying Uncle Bob is wrong, most well [...]

I’m back!

I’m back from my three week vacation!
I had a great time, but as suspected I wasn’t able to stay away from computers. In the warm evenings, just for fun, I started to implement a ray tracer in the D Programming Language.
I have been looking for a suitable project that would give me a chance to [...]

Tools of The Effective Developer: Fail Fast!

It’s a well known fact that we regularly introduce errors with the code we write. Chances are slim to get it right on the first try. If we do, the risk is great that changing requirements and murdering deadlines will mess things up later on.
It’s also well known that the cost of failure increases with [...]