Pattern vision - مواضيع منقولة من مواقع اخرى2

ryan

العودة   ryan > مواضيع منقولة من مواقع اخرى2

إضافة رد
 
أدوات الموضوع انواع عرض الموضوع
  #1  
قديم 11-28-2012, 07:39 PM
rss rss غير متواجد حالياً
Senior Member
 
تاريخ التسجيل: Sep 2012
المشاركات: 721,669
افتراضي Pattern vision

Design and programming patterns are wonderful ways of disseminating k**wledge. It’s immensely satisfying to bring solution to a tough problem by applying a perfect-fit pattern.

But success with Pattern applications is like taking that first in**cent bump. You quickly want more of what made you feel this good. And buoyed by the high of a perfect fit, it’s easy to develop Pattern vision where code, like Tetris shapes, become mere blocks for fitting into the Pattern holes.

With this infliction, you will invariably drift away from the original intent of making specific and immediate pain go away. Where the perfect and legitimate fit will remove a thorn that’s obviously hurting the code right **w, the speculative fit pretends to do the same for future hurts.

**w that’s an ho**rable intention. A pinch of prevention over a pound of cure, right? Only, it rarely works out like that. Speculative Pattern applications to avoid future, possible ails is a form of fortune telling. It’s the reason YAGNI was coined.

The further down this rabbit hole you go, the farther away from practical improvement you’ll end up. Go deep e**ugh and the Pattern vision turns into articles of faith. Inheritance is always bad, only composition can be our true savior! Only standalone command objects can give us the reusability this application needs!

Turning patterns into articles of faith takes them out of the realm of rational discussion. Code either adheres to the holy patterns or it doesn’t. If it does **t, the programmer must first repent, say his 25 rose-delegations, and then swear never to let an opportunity for a policy object extraction pass by him again!

The naming of many design principles supports this theological world view that patterns also at times inhibit. It’s obvious that you’re a sinner if you break The Law of Demeter and of weak will if you forgo the Single Responsibility Principle.

Patterns are best thought of like helpful guidelines and suggestions, **t laws, **t imperatives. It’s a written account of “hey, if you have this problem, you can try this thing to make it better”. Their core value is transforming some code to better code in a way that’s immediately obvious to the writer.

Evaluating such improvement is easy. You look at the code you had before applying the Pattern and after it. Did it make the code simpler to understand? Clearer? Prettier? If you can’t easily see whether that’s so, you’ve been sold.

Pattern vision Pattern vision
Pattern vision

أكثر...
??????? ??????: Pattern vision || ??????: rss || ??????: اسم منتداك

كلمات البحث

العاب ، برامج ، سيارات ، هاكات ، استايلات


رد مع اقتباس
إضافة رد


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع


الساعة الآن 10:21 PM


Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. TranZ By Almuhajir
This Forum used Arshfny Mod by islam servant