Sunday, April 17, 2016

My first TDD Kata - String Calculator in C#

I heard about TDD a few years ago but I only appreciated its value after reading some of Robert Martin's blog posts in the past few weeks (and also after having experienced writing post-development unit tests at work).

So today I decided to start doing katas for TDD...

This is my first TDD Kata:

There are some things in the specs that I did not include in the implementation. I will just do them next time (really?!).

I found the "specs" for this kata in "Learning Test Driven Development with TDD Katas" by Gaurav Kumar Arora. (But the original author of this kata is Roy Osherove)

This is written in C#.

I used Visual Studio 2015 Community Edition to create a .NET Core project for this kata.

I first planned to use just the Visual Studio Code text editor for this but I was having an error with restoring xUnit. The error was "The dependency xunit.abstractions 2.0.0 does not support framework dnxcore".

I hope this error will be fixed soon.

Let's all learn TDD!!! Happy coding!

Saturday, April 2, 2016

Godlike programming should be our goal!

My blog description has a very bold statement: "Godlike programming should be our goal!"

Does that mean that I already know what godlike programming is?

No! Not really. :)

Does that mean the I know someone who already know what godlike programming is?

Still No. :)

Because God did not give us a book on godlike programming (just like he did not give us a book on understanding cat behavior) we will never know what godlike programming is until God himself returns to show us what it is.

But for now, while waiting for God to show us what godlike programming is (if knowing godlike programming is even significant in our future state), we should try to follow those who seek godlike programming in the present -- like Robert Martin (Uncle Bob), Kent Beck ...and those giants before them, those after them, and those who are simultaneously living with them :) .

We might not agree with everything they teach and believe in but we must at least try to read what they have written and follow their steps and make improvements to their ideas when we have a better idea (I might never have one but you might) and constructively criticize bad ideas.

...And by "seeking godlike programming" I mean "seeking perfection when creating software" -- maximizing the benefits to people while minimizing the bad effects to people (which includes us programmers of course).

...But how do we (ultimately) know which things are beneficial to people/us and the ones that are bad for the people/us? ... That will be your assignment :) ...and remember that we must have a reason for what we believe.

Happy coding!!!

UPDATE (July 31, 2016):
I now remember, through my first blog post, the persons who said "Programming is easy" and "Programming Well is hard": they were David Malan and his co-lecturer (or maybe a TA?) in his lectures for either CS50 or Computer Science E-1 (I can't remember anymore which of the two).

I tried to locate the exact video but I can't locate it. My guess is that it is in a video from Computer Science E-1 Spring 2010 (maybe in Lecture 9: Programming) or CS50 Fall 2010.