Friday, August 31, 2007

لأ، غلط، مش منطق - متلازمة صعاب المراس

لفت انتباهي إليها غير واحد عندما تذكرت عنوان إحدى محاضرات التنمية البشرية عن "معاملة صعاب المراس" أو "Handling difficult people". فتذكرت انطباعي عن المحاضرة حينها حيث رفضت فكرة تقسيم الناس إلى عاديين و صعاب المراس، فلا يوجد في الواقع ذلك الشخص النموذج الذي تروج له كتب تطوير الذات و التنمية البشرية و قلت أن هذا ينفي خصوصية كل فرد و يعمل على التمييز بينهم على أساس أن هناك فئة منهم من ذوي المعاملات الخاصة، و لكن حينما انتبهت إلى هذه المتلازمة وجدت أنه كان الأولى أن يكون موضوع المحاضرة "التكيف مع الآخرين" على أساس أن هذه الفئة الأخرى تحتاج بالضرورة أن تعرف كيف تعامل الأولى أيضا.

Wednesday, August 15, 2007

Design: Top-Down or Bottom-Up?

Once, I prepared a session on practices for good design, symptoms of bad design, time given to design, giving considerable attention to interfaces, testable design, loosely coupled design, cohesive design, principles of good design, test-first design...

When I got to real life, I found myself following the same old practices of almost not going into design at all.
As before, I started writing code immediately, doing all things in main() with a just-get-it-done attitude, when things finally work I start to refactor code in the structured old fashion - just putting common behavior into functions, then when things begin to be slightly complex I eventually start ask my self what about classes, responsibilities of them, relations between them, interfaces ...etc.

I don't know how to follow all these practices and design guidelines from the start. Whatever you're aware of problem domain and requirements are neat, you never see things clearly until you get your hands into solving the problem.

It's unreasonable to start designing thing you don't know, or writing test cases (in TDD culture) for something you don't grasp fully. It's natural to improve incrementally, nothing could get perfect from one shot, so there is no one happy design you'll adhere to from the start to the end and your code will be refactored several times until it becomes mature.