《卓有成效的程序员(影印版)》内容简介:任何一个以开发软件为生的人都需要掌握一种经过实践检验的方法,来使自己工作得更好、更快、更高效。《卓有成效的程序员》在"如何节省时间"方面提供了宝贵意见和实用工具,无论你使用何种平台,都能立刻应用于其中。大师级的开发者Neal Ford不仅提供了关于提高生产力的建议:如何更明智地工作,排除干扰,充分利用计算机,以及避免重复;同时他还详细介绍了许多有价值的实践经验,帮助你规避常见陷阱,改善代码,从而为团队创造更大的价值。
你将学习到如何:
· 在写代码前先写测试
· 一丝不苟地管理你的对象的生命周期
· 只做你现在必须要做的,而非你将来可能要做的
· 将古老的哲学应用到软件开发当中
· 敢于质疑,而不是盲目遵从标准
· 利用元编程,将困难转为容易,化不可能为可能
· 确保同一方法中的所有代码处于同一个抽象层面
· 选择合适的编辑器,打造工具组合
这些不是空泛的理论,而是Ford现实的经验成果。不论你是初学者还是富有多年经验的专家,《卓有成效的程序员》中简单而直接的原则对你的工作和职业生涯都将有所裨益。
Neal Ford是全球IT咨询公司ThoughtWorks的应用软件构架师。他曾在美国和其他国家进行实地授课,对象包括军方和多家《财富》500强企业。
FOREWORD
PREFACE
1 INTRODUCTION
Why a Book on Programmer Productivity?
What This Book Is About
Where to Go Now?
Part One MECHANICS
2 ACCELERATION
Launching Pad
Accelerators
Macros
Summary
3 FOCUS
Kill Distractions
Search Trumps Navigation
Find Hard Targets
Use Rooted Views
Use Sticky Attributes
Use Project-Based Shortcuts
Multiply Your Monitors
Segregate Your Workspace with Virtual Desktops
Summary
4 AUTOMATION
Don`t Reinvent Wheels
Cache Stuff Locally
Automate Your Interaction with Web Sites
Interact with RSS Feeds
Subvert Ant for Non-Build Tasks
Subvert Rake for Common Tasks
Subvert Selenium to Walk Web Pages
Use Bash to Harvest Exception Counts
Replace Batch Files with Windows Power Shell
Use Mac OS X Automator to Delete Old Downloads
Tame Command-Line Subversion
Build a SQL Splitter in Ruby
Justifying Automation
Don`t Shave Yaks
Summary
5 CANONICALITY
DRY Version Control
Use a Canonical Build Machine
Indirection
Use Virtualization
DRY Impedance Mismatches
DRY Documentation
Summary
Part Two PRACTICE
6 TEST-DRIVEN DESIGN
Evolving Tests
Code Coverage
7 STATIC ANALYSIS
Byte Code Analysis
Source Analysis
Generate Metrics with Panopticode
Analysis for Dynamic Languages
8 GOOD CITIZENSHIP
Breaking Encapsulation
Constructors
Static Methods
Criminal Behavior
9 YAGNI
10 ANCIENT PHILOSOPHERS
Aristotle`s Essential and Accidental Properties
Occam`s Razor
The Law of Demeter
Software Lore
11 QUESTION AUTHORITY
Angry Monkeys
Fluent Interfaces
Anti-Objects
12 META-PROGRAMMING
Java and Reflection
Testing Java with Groovy
Writing Fluent Interfaces
Whither Meta-Programming?
13 COMPOSED METHOD AND SLAP
Composed Method in Action
SLAP
14 POLYGLOT PROGRAMMING
How Did We Get Here? And Where Exactly Is Here?
Where Are We Going? And How Do We Get There?
Ola`s Pyramid
15 FIND THE PERFECT TOOLS
The Quest for the Perfect Editor
The Candidates
Choosing the Right Tool for the Job
Un-Choosing the Wrong Tools
16 CONCLUSION: CARRYING ON THE CONVERSATION
APPENDIX: BUILDING BLOCKS
INDEX
Shortcuts that Windows users miss a lot on Mac OS X are the Alt key accelerators forapplications. Mac OS has them, but they're based on incremental search rather than explicitkey relationships. The Ctrl-F2 key moves focus up to the menu bar, and you can type the firstpart of the menu item you want. When it's highlighted, hit Enter and start incrementally typingthe enclosed menu item. It sounds complicated, but it works beautifully, and it works acrossall applications. You can also use CtrloF8 to move the focus to the far right of the menu bar,where all the services icons live.
My biggest problem with this was the cumbersome gymnastics needed to invoke Ctrl-F2, so Iused the standard Mac OS X keyboard shortcut dialog to remap it to Ctrl-Alt-Apple-Spacebar(which sounds even worse, but they all line up, so it's an easy combination to hit). Plus, myQuicksilver invoker is mapped to Apple-Enter, so all my "meta" navigation is mapped to moreor less the same general area.
If you are using the latest version of Mac OS X, choosing menu items is even easier. One ofLeopard's help features finds menu items for you when you type the name (or just part of thename). This is a great way to access menu items that live in deeply nested menus, ones whosenames you remember but whose locations evade you, and things that you think the applicationshould do but you don't know where the functionality lives. If you hit the Apple-? key, thehelp search option will appear. Type any part of the menu item name you want, and Leopardwill highlight it for you and invoke itif you hit Enter. As is the case with much keyboard magic,it is harder to explain than to do (Figure 2-6).