But what is the cost of a byte of code?
O_o
Are you next going to speak of "LoC"?
Also, think about the symbol to character ratio - which is a good metric for maintainability.
The answer of "what is more maintainable" depends on faculty for and experience with a language, the idiomatic expressions of a given idea, and the conformance and consistency of code with respect to those standards.
And on the topic of new developers, if your test coverage is good, and you have natural language tests, then new developers can skim over your tests and easily understand the key features of your project.
If they don't understand an expression of "acceptance testing" within a harness, they can't hope to understand any of my other code.
Lastly, think about the verbosity of natural language test as a tool, not a burden.
I absolutely refuse to accept verbose code as anything other than a burden.
I absolutely refuse to accept terse code as anything other than a burden.
Natual language testing enforces you to write a sentence per feature, which requires a lot a lot a lot of clarity and understanding, in my opinion this is very powerful.
Your only valid response to my query is "The tool exists to allow non-programmers to express required traits.". That is a fine goal as far as it goes, but the tool can't force you to use it everywhere you should. Dedication to quality comes from people; if the developers are devoted enough to create the kind of harness you reference, it literally doesn't matter what tools are used.
So, all things considered, natural language is going to be the way to go if you want to do testing.
As with everything else in the programming community, some people are going to love the idea while some loath the idea.
The verbosity that comes with it is really not that much of a deal.
Code need not be verbose or terse. You made a point to say that the TCL version would require more code; that is an irrelevant metric. The question is "What code is necessary to meaningful express an idea without being superfluous or monotonous?".
Code:
int i;
if(/**/)
{
i = /**/;
}
else
{
i = /**/;
}
The expression of the idea looks perfectly natural in C, but maybe the idea is more complex than the elided code implies.
Code:
int i = GetValue(/**/);
The expression of the idea looks perfectly natural in C, but maybe the idea is simpler than the function call implies.
Code:
i = if whatever?
getSomething()
else
getSomethingElse()
end
The expression of the idea looks perfectly natural in Ruby, but maybe the ideas expressed aren't as distinct as the code implies.
Code:
i = some_value || some_other_value
The expression of the idea looks perfectly natural in Ruby, but maybe the values referenced aren't as simple as the code implies.
Code:
MyClass s;
if(/**/)
{
s = /**/;
}
else
{
s = /**/;
}
The expression of the idea looks perfectly natural in C++, but maybe the classes aren't cheap to mutate.
Code:
SmartPointer<MyClass> s;
if(/**/)
{
s = new MyClass(/**/);
}
else
{
s = new MyClass(/**/);
}
The expression of the idea looks perfectly natural in C++, but maybe the class uses a "pimpl".
Given the right circumstances, I can see the "natural language" expression being perfectly natural. However, I've looked at "Cucumber" over Javascript. (I am far more familiar with Javascript.) I see only combinations of Javascript with "natural language"; I see everything "said" about each component of "acceptance testing" being stated in multiple forms; I see only tedious code.
You are correct in claiming that people who don't C++ will not understand my C++ harness, but I only have to "say" things one time, and I get to say them with C++. You say the "natural language" version "is going to be the way to go"? Let me tell you, most of my C++ harness allows one to write "firewalls" preventing the code from ever being compiled if "acceptance testing" fails.
Your question made me wonder - do you have a computer science background? If not, how long have you been programming?
o_O
I've been programming for about three months...
Soma