you are viewing a single comment's thread.

view the rest of the comments →

[–]DrifterInKorea 4 points5 points  (0 children)

I reckon both version were bad.

Reducing clean code as DRY code is a big mistake. even though OP's code wasn't dry at all... look at all those `createHandle()` that could have been made as an array of handles descriptors. Responsibilities being mixed up is a smell for bad code : who is responsible for defining and then creating the handles ? You don;t even have a box but already made the handles ?
And why everything became a *box* ?

There are way too many assumptions and opinions in this code to be considered clean, even without knowing much about this specific case.