学习OOP、设计模式、简洁代码和重构。
什么是简洁代码?
第十一章在系统级别讨论了简洁代码,如依赖注入和面向方面编程技术。
Chapter 11 talks about clean code in the context of system-level techniques such as Dependency Injection and Aspect-Oriented Programming.
虽然他们定义简洁代码的侧重点不尽相同,但其中仍有共通之处:简单、无重复、易读、优雅。
Although they all emphasize different aspects of clean code, there are a few emerging themes: simplicity, lack of duplication, readability, elegance.
像Rails那样使用这种方法,您可以两全其美:具有较少重复的简洁代码而不会失去灵活性。
Using this approach, as Rails does, you get the best of both worlds: concise code with less repetition without sacrificing flexibility.
在第一章,Martin以极富说服力的方式表明,简洁代码不仅仅是人们所希望的,并且是必须的。
In Chapter 1, Martin convincingly argues that clean code is not just desirable — it is necessary.
好名字的价值如何估计都不为过,记住Ward原则:当每一个子程序都只做它应该做的,你就拥有了简洁代码。
It is hard to overestimate the value of good names. Remember Ward's principle: you know you are working on clean code when each routine turns out to be pretty much what you expected.
这样的DECLARE语句也意味着代码更加简洁。
Such DECLARE statements also mean code that is more concise.
还要注意,这里仍然对异常未加检查,这将使代码异常简洁。
Also note the continuing pattern of unchecked exceptions, which keeps the code remarkably concise.
如果这个匿名类可被作为一个内部类单独放置,那么清单1中的代码将会简洁很多。
The code in Listing 1 would be much neater if the anonymous class was placed separately as an inner class.
但是这种欣赏并不是一定要求代码易读或者简洁。
But this appreciation does not necessarily require the code to be readable or maintainable.
使用固定的游戏速度和最大的FPS是一个容易实现而且代码简洁的解决方案。
Using a constant game speed with a maximum FPS is a solution that is easy to implement and keeps the game code simple.
为了简洁,此代码已经被压缩。
从一开始就要寻求使得代码简洁的方法。
代码十分简洁并且在运行时非常高效。
The code is fairly succinct and is very efficient when it runs.
在一个例子中ejb组件的正确使用使得代码更简洁、更易懂。
In one case proper use of EJB components resulted in less, and more easily understood code.
如果这些字符串经过精心挑选,它们就可以使结果代码更简洁。
If those strings are selected carefully, they can make the resulting code much clearer.
我不认为软件工程的教授们都特别欣赏代码的简洁。
I'd like to think that software engineering professors are especially tuned into code cleanliness.
你所选择的语言,你应该觉得“舒服”,并且能够写出有效(而且简洁)的代码。最重要的,让语言去适应项目,反之亦然。
The language you choose should provide you with a suitable "comfort" level, the ability to produce efficient (and clean) code, and, above all, allow the language to suit the project and vice-versa.
看起来XML还有另一个好处:代码比文本版的代码更为简洁、容易。
It looks like there's another benefit to XML: the code is a lot cleaner and easier than the text version.
结果更为简洁,如清单2中的代码所示。
This results in the code shown in Listing 2, which is much neater.
如果代码不简洁,开发的速度就会越来越慢。
绿地开发(greenfielddevelopment)是指开发团队首先开发一个空白的IDE控制台,并用漂亮、简洁的代码填充它,这只是软件应用程序生存期中一个非常小的片段。
Greenfield development, where a development team starts out with a blank IDE console and fills it with beautiful, concise code is a very small slice in the life of a software application.
尽管还能让这段Perl代码更简洁,但是它已经足以说明在Perl中处理XML是多么容易。
Although you can make the Perl more concise, this code also illustrates how easy it is to manipulate XML in Perl.
简洁的代码更容易debug。
我们在Generic .Dictionary类中可以发现更为简洁的代码。
This gives us the much simpler code found in the Generic.Dictionary class.
有人可能会说Ruby的语法很简洁,这正是它的意图:这种语言使开发人员可以迅速编写简洁的代码。
Some might say that Ruby's syntax is terse, and it's that way with a purpose: this language lets you create concise working code in short order.
如果你的代码是简洁的,这就更容易发现bugs。
如您在第1部分中了解到的,它们也是多变的,能够以各种方式定制和扩展,帮助实现优质、简洁的代码。
As you learned in the previous article, they're also malleable, willing to be customized and extended in all kinds of ways, in service of good, clean code.
也就是说,PHP让你快速简洁地编写代码,这对于许多应景而生的应用是合适的。
A.K.A., they allow code to be written quickly and compactly, which is fine for many situational applications that spring up.
应用推荐