Monday, July 4, 2011

Just a thought on what it means to write good code.

The structure of the program needs to be such that it is easy to accomodate future requests.

The vocabulary of the code needs to reflect the vocabulary of the use cases. When somebody says, please implement feature X, there should be a way to "localize" that feature in the code. The closer the vocabulary of the use case to the code, the smaller the portion of the code that needs to change in order to accomodate the new use case.

2 comments:

  1. Exactly. Which is why DSls are such a great idea. And DSLs are very easy to do in Lispy languages. Therefore .... ;-)

    ReplyDelete
  2. Yes, domain specific languages are great. In this post, what I mostly had in mind is building DSLs in C++ by tailoring my class structures to fit the domain. Of course, while I believe C++ is just as good at producing the end result, the journey is quite painful.

    ReplyDelete