2007-09-17

For young programmers only...

My little sister has started to study C++ at University.

She is in her second year but in their tasks with big black letters is required to give human readable names to variables and to module code. It's strange... evidently, Pascal at the first year didn't school what is good and how to make job easy first of all to yourself.

I've installed Eclipse to my sister, told about Unit testing a little. It's convenient - to write 5 or 10 lines of code right away tests are running for the checking. It's almost REPL. Testing is a guarantee of not turning program text into one long main function. And if something wrong happens then a couple of key pressing brings you to the debugger to the required place with required data.
It seemed to me she liked it.


I liked to demonstrate the popularity of the approach and was surprised by a huge list of frameworks for tests creation.

As for purpose for student projects there is a tiny file QuickTest.h.

if one is to judge nothing except of three elementary macros QT_TEST(testName),QT_CHECK_EQUAL(value1, value2), and QT_RUN_TESTS is required

P.S The first students C++ sounds in haskell about as follows:

minUncommonWord :: String -> String -> String
minUncommonWord s1 s2 =
foldl1 (\a b -> if length a < length b then a else b)
[x | x <- words s1, x `notElem` words s2]

No comments:

Post a Comment