您的位置:知识库 » 程序人生

编程的单纯心

来源: solidot  发布时间: 2011-01-16 18:12  阅读: 709 次  推荐: 1   原文链接   [收藏]  

  Randall Degges 写道 "我已经做了很久的程序员。当我最开始编程时,我将全部心思投入到电脑中编写代码。虽然,我的代码糟透了,但我仍然品尝了乐趣,收获了知识。然而,时过境迁,编程的单纯心离开了我。能剥夺程序员单纯心的,是恐惧。是担心不知道最好实现方式的恐惧;是疑惑没有使用正确工具和语言的恐惧;是害怕错误的恐惧;对计划的恐惧;对公开的恐惧(别的程序员会如何看待我的代码?)。我深深怀疑,随着程序员越来越有经验,这些恐惧也会与日俱增地悬于他们头顶。

  编程的单纯心赋予程序员力量。之前当我内省这个问题时,想起了所知的一些顶尖程序员。他们有什么地方值得我尊重?他们因何而如此优秀?我相信,他们的优秀与他们的单纯密不可分。最好的程序员会天真地冲锋陷阵:毫无畏惧地删除代码,不分昼夜在与世隔绝中搭建原型,无视批评和外界影响。他们是真的猛士。面对难题,他们用毫不留情的编码来化解。他们无欲无求。然而,怎样才能重拾已经遗失的编程的单纯心?

  吼出来:操!

  • 发现另一种高效方法来重写代码?写之!不要担心为此需要学很多东西,学之!代码可以改进,或许以后你会学到更好的方法,但现在你所做的,不是浪费,而是成长。
  • 担心自己所用库、语言会在几年后过时?不。敏锐你的思想,你的代码不会比它们变化得更慢。
  • 被最后期限压迫得喘不过气?无视之。这个时候你就是代码的上帝。如果你看屏幕足够狠,代码就会自行出现。毫不怀疑你的能力,毫不畏惧在此时把自己封闭起来编程,像野兽一样编程!
  • 担心别的程序员对自己的代码指手画脚?不要被他们阻碍。如果他们对你的代码有真正的意见,他们应该发来他们的代码补丁。

  归结到一个道理便是:当碰到挫折时,不要被挫折打倒,保持一颗单纯心。"

  英文原文(http://projectb14ck.org/programming-innocence):

  Programming Innocence

  I've been programming for a long time. When I first started programming, I would spend as long as I humanely could on the computer writing code. Sure, my code sucked, but I was having fun, and I was learning a lot. Over the years, this programming innocence left me.

  The one true thing that can strip a programmer of his innocence is fear. Fear of not knowing the best way to do things (best practices). Fear of not using the right tools and languages. Fear of errors (especially compiler errors). Fear of schedules. Fear of publicity (what will other programmers think about this code?). I suspect that all programmers experience those fears in greater and greater amounts as they become better and better.

  Programming innocence is a powerful thing. When reflecting about this topic in my head over the past week or so, I immediately began thinking of the best programmers I know. What do I respect about them? What makes them so great? I believe that in most cases, their greatness can be directly correlated to their innocence. The best programmers I know are the ones who naively charge into battle: fearlessly removing code, spending days in complete isolation getting a prototype hacked together, ignoring all critics and outside influences. These guys are my heroes. They code ruthlessly in order to solve their problems. They yield for nothing.

  So how can you regain your programming innocence once it has been lost?

  Just Say "fuck it"

  • Found a more efficient way to write your code? Implement that shit! Don't make yourself worry about all you have to learn, just learn it. Code can be enhanced over time, so don't worry that learning new things in the future will waste your time now. Every time you write code, you grow.
  • Worried that your library / programming language / etc. will be outdated in the next few years? Don't be. Think agile. When things change, change your code with it.
  • Feeling stressed out by that deadline? Fuck it. You are a hacking god. If you stare at the computer hard enough, the code will practically write itself. Be confident in your abilities, and never be afraid to completely isolate yourself from the world, and code like an animal.
  • Do you worry what other programmers will say about your code? Don't let that stop you. If other people have a problem with your code, have them send you a pull request.

  The moral is: when things bring you down, instead of letting them best you, remain innocent. Hack your heart out every day, and don't forget that the only thing that really matters is how much fun you have along the way.

1
0
标签:程序员

程序人生热门文章

    程序人生最新文章

      最新新闻

        热门新闻