Go homepage(回首页)
Upload pictures (上传图片)
Write articles (发文字帖)

The author:(作者)delv
published in(发表于) 2014/1/6 10:12:31
Harmful on the design pattern,

Harmful on the design pattern-design patterns, programming language-IT information Theory of design patterns to unwanted

Work with experienced good programmers can make you learn a lot of things, which I feel is most helpful is to learn the programming of pragmatism.

Have a college background is a good thing, if you didn't go to College, I think half of my programmer career may not be able to catch up now. But on the other hand, College of impedance mismatch between theory and market, students leave school to enter the professional societies, with an air of being brainwashed J2EE pure illusion, forget a lot of things that have only themselves to learn--that's why a lot of self-taught programmer to liberation from bondage, developed because of the great revolutionary software.

I used to like this, I had memorized the design patterns for a variety of design patterns, and try to use them at any one of you can use. However, when leaving the University, began programming in the real world, I began to realize one thing: doing "the right thing?" Are not always bring you the means. In my opinion, could prove one of the largest examples of this phenomenon is the JavaScript language: Although there are so many good programming languages in the world, why a JavaScript as a "nondescript" language will become the most popular and most common language? (Leave it all to discuss in the comments)

Back to the topic of design patterns: design patterns are recurring issues examples of good, reusable solutions. Good stuff, isn't it? How come they become harmful?

Problem is not with the design itself, but we use them everywhere without OCD, they think they are the right programming.

This habit of thinking can lead you to find what you want, forcing problems to adapt to the design pattern provides a solution, rather than it was supposed to take the programme also leads to excessive and unnecessary technical complexity, these setbacks will result in projects in the future.

Adopting a pragmatic way, natural emergence of design patterns in your code, without ornament. Have you read these design patterns, you know they are there, but you don't need a purposely using them as standards to achieve a solution. Instead, with your experience, these patterns in your code, a natural formation, and appropriate for your problem, without any restraint. Maybe you don't even know what model this is, what, it's not important, but if you know that you can comment about it, it could help other programmers to more easily understand, help them understand what your code is doing, and do not need to read the entire piece of code--because you follow a design pattern.

So, I think, understand and become familiar with design patterns is important – you should always go and see how others like you wrote the code, is how to solve the problem in a different way--but is not forced to use them in your code. Go with the flow, keep it simple, stupid!


(

设计模式有害论 - 设计模式,编程语言 - IT资讯
设计模式有害论

跟有经验的优秀程序员一起工作能让你学到很多东西,而其中我感觉最有帮助的一点就是学会了编程中的实用主义。

有学院背景是件好事,如果没有上过大学,我估计我的程序员仕途未必能赶得上现在的一半。但从另外一方面看,学院理论和市场之间存在阻抗失配,学生离开学校毕业进入职业社会,都带着一种被J2EE洗脑的纯洁的错觉,忘记了很多东西只有亲自动手才能学到——这就是为什么很多自学成才的程序员能够解除束缚,开发出伟大的具有革命性的软件的原因。

我曾经就是这样,我曾经熟记《设计模式》里的各种设计模式,并且试图在任何一个可以用的的地方使用它们。但是,当离开大学,开始在现实世界里编程时,我开始认识到一个事情:做“正确的事情?”并非是总能给你带来成功的途径。以我的观点,能证明这种现象的最大的一个例子就是JavaScript语言:虽然世界上有这么多的好的编程语言,为何一个像JavaScript这样的“四不像”语言会成为最流行和最通用的语言?(这个问题留给大家在评论里讨论)

回到设计模式的话题:设计模式是对重复出现的问题的好的、可重用的解决方案的范例。很好的东西,不是吗?它们怎么可能变成有害的呢?

问题并不是出在设计模式自身,而是我们的一种不加选择地到处使用它们的强迫症,总以为用了它们才是正确的编程。

这种思维习惯会导致你按图索骥,强行让问题去适应设计模式提供的解决方案,而不是它本该采取的方案,同样也会导致过度技术化和不必要的复杂,这些在将来都会导致项目受挫。

采用实用主义的态度,让设计模式在代码中自然的出现,不需要雕琢。你读过这些设计模式,你知道它们的存在,但你不需要特意的以它们为标准去实现一种解决方案。相反,凭借你的经验,这些模式会在你的代码里天然的形成,并适合你的问题,不带任何束缚。也许你甚至不知道这是什么模式,叫什么,这不重要,但如果你知道,你可以注释一下,这能帮助其他程序员更容易的理解,帮助他们明白你的代码在做什么而不需要阅读整段代码——因为你遵循了一种设计模式。

所以,我认为,懂得和熟悉设计模式很重要——就像是你应该经常去看看别人是如何写代码的,是如何用另一种方式解决问题的——但是,不要强迫在代码中使用它们。顺其自然,keep it simple, stupid!


)


If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)





QQ:154298438
QQ:417480759