程序员编程的聪明省力法:Google一次我可以写10行代码

在软件开发这个领域中,特别是那些刚入行的小菜鸟,特别喜欢问这种问题:「大大们写程序会 Google 吗?」、「大神们 %%% 打键盘写程序时会上网找资料吗?」

Yes,答案是十分肯定的,就算是老司机,Google 也是他们最好的朋友。

  查询资料,而不是盲目的复制贴上

换句话说,正确地使用 Google 并不会让你变成比较烂的程序设计师,盲目地复制贴上才会。事实上,Google 可以说是程序设计师的基本工具,每个人都必须知道要如何使用它。

对程序设计师来说,使用 Google 的其中一个理由,是你没有办法记住全部的细节,特别是你使用一个以上的语言与框架。

就像爱因斯坦说的:

不要去记那些一查就有的东西。“Never memorize something that you can look up.”

除此之外,好的程序设计师们也知道,他们不是世界上第一个遇到某个问题的人。他们使用 Google 搜寻,运用适当的关键字搜寻,来找寻一切可能的解答,并小心地评估这个解答,从中找出真正有用的内容。

而有些专家级的程序设计师则非常多疑,他们不断地自我怀疑并质疑自己的程式码,当他们这类型的症状开始发作时,他们会使用 Google 来证明自己是正确的。

  Google 一次我可以写 10 行代码

我应该勉强算是个有经验的程序设计师,最近,我必须用 Netty 基于 Java 的框架来写个网站功能,我从来没有使用过 Netty ,以下是我的 Google 搜寻纪录:

1. netty tutorial

2. netty maven dependency

3. netty bytebuf to string

4. netty bytebuf release

5. netty 4 changes

6. setOption (“child.bufferFactory”) netty 4

7. ByteBuf netty

8. opensource projects using netty framework

9. netty 4 examples

10. netty 4 adding json encoder

11. netty channel pipeline

12. netty 4 messagetomessage encoder

13. netty serverbootstrap childhandler

14. ByteBuf netty

15. lengthfieldbasedframedecoder netty 4

16. netty 4 client examples

17. netty 4 bytebuf to bytebuffer

18. netty 4 endianness

19. netty channelhandlercontext

20. netty channelhandlercontext thread safe

21. netty user authentication

22. netty heartbeat handling

23. load test netty with 10k concurrent sockets

最后,我写了 255 行代码,包含一个可以运作的服务与客户端。我总共搜寻了 Google 23 次,资料大多来自 StackOverflow、Netty 4 website、GitHub 以及 JavaDocs。如果你的数学老师没有请假,你可以算出,平均 Google 一次我大概可以写 10 行程式码。

所以,各位工程师,在椅子上坐好坐满,并跟着我默念,Google 就是我们最好的朋友。

余下全文(1/3)
分享这篇文章:

请关注我们:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注