steal the code

Learning anything is easy. Internalizing it is difficult.

Something I’ve found myself doing in my last few projects is to steal ideas from other projects. Not actually “stealing”, of course, but browsing your favorite projects and developers and stealing concepts from them. Design patterns. Refactoring methodologies. How does Chris deal with command-line arguments in hub ? How does Wayne transition between shell scripting and Ruby in rvm ? Anything that conceptually requires you to come out of auto-pilot programming mode and think, “hey, how do I actually do this?” is a great place to start.

Once you reach that point, sure, you could google a blog post to get the answer. But by “stealing” it from someone else, you achieve two things:

  1. You form a mental connection between your concept and that specific project.
  2. You acquire “ownership” in that concept.

“Acquiring ownership” in something you “steal” is counter-intuitive, but think about it: you spend the necessary time to understand the concept, and then you apply it to your own problem domain. The mental act of doing that can be an intensely satisfying process. Once that bell clicks, you’ll start understanding why the author may have refactored that method, or why they needed a separate helper class.

Don’t get me wrong; hammering things out on your own is great. That’s almost an entirely different class of learning, and it works well in the majority of cases. But sometimes learning others' best practices is the quickest way to enlightenment- not in terms of fixing your problem at hand, but of substantially understanding the forces involved.

By seeing how others have tackled your problem, reaching the point of your own personal understanding, and then reshaping it to fit within your viewpoint, the concept then becomes “your” concept and you then have it in your pocket for your next project. It may be just another word for “learning”, but as soon as I thought of it in this concrete, compartmentalized fashion — Oh, this is just like that inheritance strategy I stole from Homebrew in my other project a few months back — my ability to retain knowledge has gone way up.

Once you’ve reached that level of internalization, that difficult concept becomes just another concept you can auto-pilot.

 

原文地址:http://zachholman.com/2010/10/steal-the-code/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值