如何成为一个优秀的程序员

by Amy M Haddad

通过艾米·M·哈达德(Amy M Haddad)

如何成为一名优秀的程序员 (How to be a great programmer)

What sets apart the really great programmers?

是什么使真正出色的程序员与众不同?

As we all know, great programmers build amazing features, websites, apps, and the like. But what do they have in common?

众所周知,优秀的程序员会构建出色的功能,网站,应用程序等。 但是它们有什么共同点?

In my research, it’s not just about knowing a language really well or having a particular educational background. It’s that the really talented programmers have mastered the fundamentals. That foundation is what enables them to build great things and come up with breakthrough ideas.

在我的研究中,这不只是真正了解一种语言或具有特定的教育背景。 才华横溢的程序员已经掌握了基础知识。 这个基础使他们能够构建伟大的事物并提出突破性的想法。

Think of a pyramid. It has a large base, but gradually gets smaller and thinner toward the top. Learning the fundamentals of programming forms that base. Everything takes off from there.

想想一个金字塔。 它的底面很大,但逐渐向顶部变小变细。 学习编程基础的基础。 一切都从那里起飞。

So what are those fundamentals? Based on my experience and the programmers whose backgrounds I’ve researched, I see programming fundamentals as a two-part approach.

那么这些基本原理是什么? 根据我的经验以及研究过背景的程序员,我将编程基础知识分为两部分。

问题解决者非凡 (Problem Solver Extraordinaire)

First, you have to be an effective problem solver. This is an important place to start since programming is problem-solving.

首先,您必须是有效的问题解决者。 这是一个重要的起点,因为编程可以解决问题。

Although there are many ways to solve a problem, there are a few parts of the process that stand out to me. Programmers who are also great problem solvers distill a problem to its essence, in order to identify their overall aim and begin a problem with purpose. Then, they break each problem into small, manageable parts — attacking each part in turn, and sometimes in visual terms by drawing a picture to make it “real world.”

尽管有很多方法可以解决问题,但是过程中的一些部分对我很突出。 也是伟大的解决问题者的程序员,从本质上讲问题,以便确定他们的总体目标,并从目的着手解决问题。 然后,他们将每个问题分解成可管理的小部分–依次攻击每个部分,有时还通过绘制图片使其成为“真实世界”来以视觉方式进行攻击。

The process is harder than it sounds. When I started to program, I hit a wall: like many others, I never learned how to problem solve in school; it’s a skill that’s not readily taught. I was given a problem set in math class and just dove in, which is what I did when I started to program. Unsurprisingly, I was spinning my wheels unnecessarily and hitting roadblocks on the simplest of problems.

这个过程比听起来困难。 当我开始编程时,我遇到了麻烦:像许多其他人一样,我从未在学校学习过如何解决问题的方法; 这是一项不易教授的技能。 我在数学课上遇到了一个问题,只是开始学习,这就是我开始编程时所做的。 毫不奇怪,我不必要地打了个转轮,就最简单的问题打了障碍。

Things began to change when I began learning about the problem solving process, and how to problem solve effectively. I now begin a problem with intent. I have George Polya’s book, How to Solve It, to thank for that bit of advice.

当我开始学习问题解决过程以及如何有效解决问题时,事情开始发生变化。 我现在开始意图问题。 感谢George Polya的书《 如何解决它》

I’ve adapted some of Polya’s ideas to programming, like understanding the problem. “The problem must be understood,” Polya writes. This includes being able to “point out the principal parts of the problem, the unknown, the data and the condition.” For each problem, I pull out a sheet of paper and write answers to these questions: what am I solving for or trying to find? (unknown); what am I given? (data); and what constraints or details do I need to be aware of? (condition).

我已经将Polya的一些想法应用于编程,例如理解问题。 “必须理解问题,” Polya写道。 这包括能够“指出问题的主要部分,未知,数据和状况。” 对于每个问题,我都会抽出一张纸并写下以下问题的答案:我要解决或试图找到什么? (未知); 我得到什么? (数据); 我需要注意哪些约束条件或细节? (健康)状况)。

Understanding the problem may seem obvious, but the obvious is easily overlooked. On more than one occasion, I’ve poured hours into a problem only to realize much later that I missed a small, but critical detail in the problem statement. Writing out problem details slows me down mentally, and helps me think through exactly what I need to do, which is half of the battle.

理解问题似乎很明显,但显而易见的事实很容易被忽略。 在不止一次的情况下,我花了很多时间解决问题,但后来才意识到我错过了问题陈述中一个很小但很关键的细节。 写出问题的详细信息会使我的思想减慢,并帮助我仔细考虑需要做的事情,这是成功的一半。

From there, I make a plan, which is another of Polya’s suggestions. It makes sense. I write an outline before I write an article. An artist makes a sketch of the painting before working on the painting itself. A builder uses drawings and blueprints to build a house. It’s no different with programming. Instead of rushing into doing, I need to start by thinking about what I’m setting out to do and make a plan of attack.

从那里,我制定了一个计划,这是Polya的另一个建议。 这说得通。 在写文章之前,我先写大纲。 在进行绘画本身工作之前,艺术家会先绘制绘画草图。 建筑商使用图纸和蓝图建造房屋。 编程没有什么不同。 我不必急着去做 ,而是要开始思考我打算做的事情并制定进攻计划。

There are many ways to go about this. Sometimes I outline the steps I need to take in numerical order: first do this, second do that. Other times I make the problem visual. When I was learning about for loops, I pulled out a handful of almonds and physically iterated through the pile. It’s a silly example, but it helped me think through the problem.

有很多方法可以解决此问题。 有时,我会按数字顺序列出需要采取的步骤:首先执行此操作,然后执行此操作。 其他时候,我将问题可视化。 当我学习循环时,我抽出了少数杏仁,并在堆中进行了物理迭代。 这是一个愚蠢的例子,但是它帮助我思考了这个问题。

I’ll also draw pictures or diagrams. For a recursive problem, I’ll draw a diagram of what’s happening on each recursive call until I hit the base case. Almost always, however, I find a way to simplify the problem to make it more manageable and to help me spot a pattern. Above all, the aim for me is to enter a problem with purpose, and maintain that sense of purpose throughout.

我还将绘制图片或图表。 对于递归问题,我将画出每个递归调用发生的情况的图表,直到找到基本情况为止。 但是,几乎总是可以找到一种方法来简化问题,使其更易于管理,并帮助我确定模式。 最重要的是,对我来说,目的是解决有目的的问题,并始终保持这种目的感。

Despite the best made plans, problems are still hard and I still get stuck. Becoming a great problem solver takes time; it’s a skill I’m still working on and it’s definitely worth the effort. It’s a difference you can see.

尽管制定了最好的计划,但问题仍然很棘手,我仍然陷入困境。 成为一个出色的问题解决者需要时间。 这是我仍在努力的一项技能,绝对值得付出努力。 您可以看到差异。

When I read code written by a great problem solver, it’s clean and easy to understand. Variables are well named. Functions are short and crisp. Each line of code has a specific purpose; the fluff is removed. The clarity of the code mirrors the programmer’s thought-process: I can read the program from top to bottom and know exactly what’s going on. That’s great problem solving, and that’s what I’m striving for.

当我阅读由出色的问题解决者编写的代码时,它很干净而且易于理解。 变量是很好的命名。 功能简短。 每行代码都有特定的用途。 绒毛被去除。 代码的清晰性反映了程序员的思想过程:我可以从上至下阅读程序,并确切地知道发生了什么。 那是解决问题的好方法,而这正是我所追求的。

那你的电脑呢? (What about your Computer?)

Learning computer science is the second programming fundamental. I recently started learning computer science, and love it because I’m moving beyond surface level. I’m going “behind the scenes” to learn what happens when I use a built-in function, for example. I’m also learning about memory and run time, among many other topics. In short, I’m learning why a computer does the things it does.

学习计算机科学是第二个编程基础。 我最近开始学习计算机科学,并喜欢它,因为我已经超越了表面层面。 例如,我将“在幕后”学习使用内置函数时会发生什么。 我还正在学习有关内存和运行时间的许多其他主题。 简而言之,我正在学习为什么计算机可以完成其工作。

Knowing the “why” enhances my contextual knowledge and makes me a more informed programmer. As a result, I’m more thoughtful with the code I write. Now that I know a bit about run time, for instance, I’ll opt to use a binary search instead of iterating through each element in a list.

知道“为什么”会增强我的上下文知识,并使我成为一个更有见识的程序员。 结果,我对编写的代码更加体贴。 例如,现在我对运行时有所了解,我将选择使用二进制搜索而不是遍历列表中的每个元素。

It’s also enriching my understanding of how core programming concepts work. For example, I was working on a recursive problem and I wasn’t getting the solution I anticipated. After close examination, I learned why: it had to do with the execution of the call stack, an idea that would’ve escaped me just a few months ago.

这也丰富了我对核心编程概念如何工作的理解。 例如,我正在处理一个递归问题,但没有得到我期望的解决方案。 经过仔细检查,我了解了原因:它与调用堆栈的执行有关,这种想法在几个月前就没能对我产生作用。

Or take classes. I struggled immensely with classes for the longest time, and was terrified to use one. I knew how to write a class, but wasn’t confident when and why I’d use one. That changed when I learned what actually happens in my computer when I create instances and call methods. It finally clicked, once I had some context. For both recursion and classes, computer science bridged gaps in my knowledge.

或参加课程。 我花了很长时间在课堂上苦苦挣扎,并为使用一个而感到恐惧。 我知道如何写一堂课,但是我不确定何时以及为什么要使用一堂课。 当我了解创建实例和调用方法时计算机中实际发生的情况时,情况发生了变化。 一旦我有了一些上下文,它终于点击了。 对于递归和课堂,计算机科学弥合了我的知识空白。

All too often, the fundamentals get pushed aside. Progress can be slow, and people tend to pick more “fun” stuff to work on when given the option. That’s a shame. Programmers who master the fundamentals seem to code with confidence: they know the “how” and “why” of their programming choices, which improves their work and builds their credibility with others.

很多时候,基本面被抛在一边。 进展可能会很慢,并且如果有选择,人们会倾向于选择更多的“有趣”东西来进行工作。 真可惜 掌握基础知识的程序员似乎对代码充满信心:他们知道编程选择的“方式”和“原因”,从而改善了工作并建立了与他人的信誉。

Plus, a solid grasp of the fundamentals makes learning new languages and technologies easier to do. For example, taking the time to really understand core concepts like iteration, recursion, and abstraction with one language will help when learning another. Simply put, there’s a lot to gain and little to lose by mastering the fundamentals.

另外,扎实的基础知识使学习新语言和新技术变得更加容易。 例如,花点时间真正了解一种语言的核心概念,例如迭代,递归和抽象将对学习另一种语言有所帮助。 简而言之,掌握基础知识可以带来很多收获,而没有损失。

I’m a writer (amymhaddad.com), and a beginner programmer.

我是作家( amymhaddad.com )和初学者。

翻译自: https://www.freecodecamp.org/news/how-to-be-a-great-programmer-34939494996d/

如何成为一个优秀的程序员

如何成为一个优秀的程序员_如何成为一名优秀的程序员相关推荐

  1. 程序人生:如何成为一名优秀的全栈工程师

    对性能影响有着深入理解的技术通才 掌握多种技能,并能利用多种技能独立完成产品的人 一位资深开发工程师.架构师,以及具有敏捷开发技能的程序员 目 录 1. 什么是全栈工程师 2. 全栈工程师的价值 3. ...

  2. 程序自动启动_如何在Gnome Shell上自动启动程序

    登录Gnome Shell时自动打开应用程序是提前设置工作区的好方法.在Gnome Shell上自动启动程序的最简单方法是使用Tweaks应用程序. 在本指南中,我们将介绍如何安装Gnome Twea ...

  3. h5 bootstrap 小程序模板_软件测试人员必知H5/小程序测试点

    最近接触了较多关于H5页面的测试,H5页面的测试除了业务逻辑功能测试外,其他部分的测试方法基本是可以通用的,在此对H5页面和小程序的一些通用测试方法进行总结分享给大家 01 H5相关测试 H5优势: ...

  4. cass地籍参数设置命令_想成为一名厉害的测绘员?南方Cass教程+插件+课件不可少!...

    想成为一名厉害的测绘员?南方Cass教程+插件+课件不可少! 南方Cass绝对是测绘人的工作神器,强大的测绘功能,精准的计算无一不受广大测绘人的好评.自推出上线以来已经占据了我国绝大部分的测绘市场,但 ...

  5. 做一名优秀的软件开发qa_如何成为一名优秀的开发人员

    做一名优秀的软件开发qa As a PHP developer, or any kind of developer as a matter of fact, you need to constantl ...

  6. c语言c99标准_如何成为一名优秀的 C 语言程序员?

    问题的提出 每过一段时间我总会收到一些程序员发来的电子邮件,他们会问我是用什么编程语言来编写自己的游戏的,以及我是如何学习这种编程语言的.因此,我认为在这篇文章里列出一些有关C语言的最佳读物应该能帮到 ...

  7. 蜂鸣器发出7种音阶c语言程序_我们做为一名优秀的程序员,是不是应该知道编程语言的发展简史...

    我们都知道,编程语言是一组用来定义计算机程序的语法规则.它是一种被标准化的交流语言,用来向计算机发出指令.一种计算机语言让程序员能够准确地定义计算机所需要使用的数据,并较精确地定义在不同情况下所应当采 ...

  8. ai取代程序员_自主编程的AI会取代程序员吗?

    原标题:自主编程的AI会取代程序员吗? 去年3月,AlphaGo大战棋手李世石备受瞩目,而今年5月,AlphaGo将来华挑战东方少年柯洁.与此同时,围绕AlphaGo背后的人工智能技术迅速火爆起来,各 ...

  9. 核心代码是整个程序吗_你认为3D建模是像程序员一样敲代码吗?你太out了

    什么是三维模型? 简单介绍三维模型概念,三维模型是物体的多边形表示,通常用计算机或者其它视频设备进行显示.显示的物体可以是现实世界的实体,也可以是虚构的物体.任何物理自然界存在的东西都可以用三维模型表 ...

最新文章

  1. Zone.js 简介 抛砖引玉
  2. 重磅|PPT讲解机器人产业发展现状与未来展望,重磅资料
  3. 深度丨我们可以有多信任人工智能
  4. ajax-Ajax试题
  5. Openresty Redis正确使用连接池(set_keepalive)
  6. phoneGap异步加载JS失败
  7. transpose公式_EXCEL转置你是用公式还是选择性粘贴?
  8. CSS 小结笔记之滑动门技术
  9. 计算机公共基础知识书第二版答案,二级计算机公共基础知识课后习题及答案.doc...
  10. [bzoj4826][Hnoi2017]影魔
  11. 列和相减 L3-L2
  12. qq轻聊版打开后显示服务器返回数据错误,电脑qq登录报错误报告如何处理_qq打开显示错误报告的解决方法...
  13. 修改音频采样率和单双通道
  14. Android Jetpack架构组件之Room
  15. 计算机设备评分标准,电脑租赁设备评判标准(硬件篇)
  16. 大数据技术具备哪些特点
  17. 【开发工具】Linux环境下JDK安装(无错完整)
  18. biti_rainy's blog
  19. windows 任务栏桌面消失怎么办
  20. 狂神说Spring讲解第19动态代理中错误java: 不兼容的类型: com.Orac.kuang.Host无法转换为com.kuang.demo3.Rent

热门文章

  1. 保驾护航金三银四,使用指南
  2. Android基础夯实--你了解Handler有多少?
  3. Centos 6.5安装MySQL-python
  4. struts2官方 中文教程 系列六:表单验证
  5. 深入浅出面向对象分析与设计
  6. HDU 2204 Eddy's爱好(容斥原理)
  7. 敏捷结果30天之第十二天:效率角色-你是启动者还是完成者
  8. [置顶] Java Socket实战之一 单线程通信
  9. MonoRail学习-介绍篇(一)
  10. mall整合RabbitMQ实现延迟消息