程序员 cs 转 bs
“The mediocre teacher tells. The good teacher explains. The superior teacher demonstrates. The great teacher inspires.“ — William Arthur Ward
“平庸的老师告诉。 好老师解释。 上级老师演示。 伟大的老师给人启发。” — 威廉·亚瑟·沃德
If you want to really learn something, try teaching it to someone else because only then will you be sure that you fully understand it. That statement is entirely true. It’s even more accurate when you try to teach some relatively complex topics to six-, seven-, or eight-year-olds. Then, you don’t only need to understand the topic fully. You need to attempt to simplify it enough that kids will understand it without making it sound small and unimportant.
如果您想真正学习一些东西,请尝试将其教给其他人,因为只有这样才能确保您完全理解它。 该说法完全正确。 当您尝试向6岁,7岁或8岁的孩子教授一些相对复杂的主题时,它甚至更准确。 然后,您不仅需要完全理解该主题。 您需要尽量简化它,以使孩子们理解它而不会使它听起来很小且不重要。
I have been teaching kids computer science for five years now and have been through more than 50 students. I can say for sure that my computer science and programming knowledge is now far superior to what it was five years ago. Teaching kids helped me grow as a person and improve my technical skills in a way I never thought about when I first started teaching.
我教孩子计算机科学已有五年了,已经有50多名学生。 我可以肯定地说,我的计算机科学和编程知识现在已经远远超过五年前。 教孩子们使我成长为一个人,并以我第一次开始教学时从未想过的方式提高了我的技术技能。
Here are five ways that teaching CS to kids helped me improve as a programmer.
向孩子们教授CS的以下五种方法可以帮助我提高程序员的水平。
以相关的方式解释概念的能力 (The Ability to Explain Concepts in a Relatable Manner)
I have always heard that programmers are bad at explaining what they did and how they made their code work directly. I guess that’s partly true. As developers, we mostly communicate with other developers, so we subconsciously make many assumptions about the knowledge of the person we are explaining things to. Because of that, we get used to defining terms and ideas at a very high abstract level. It is also why we find it challenging to explain the same terms and concepts to a more general audience or personnel without the same background knowledge.
我一直听说程序员不善于解释他们做了什么以及如何使他们的代码直接工作。 我想部分是正确的。 作为开发人员,我们通常与其他开发人员进行交流,因此我们下意识地对要向其解释事物的人员的知识做出许多假设。 因此,我们习惯于在很高的抽象水平上定义术语和思想。 这也是为什么我们发现在没有相同背景知识的情况下向更广泛的受众或人员解释相同的术语和概念具有挑战性的原因。
The ability to explain programming concepts in simple, easy-to-understand ways means that you entirely — and to the core — understand these concepts.
以简单易懂的方式解释编程概念的能力意味着您完全-甚至是核心地-理解了这些概念。
Try explaining what a list or a stack is. Not even that, try to explain the modulo operator to someone who hasn’t studied division in school yet. You will need to be more creative in explaining such terms. One way I teach lists and indexing in Python is by asking my students to picture a building where the apartments are the items and the apartment numbers are the indexes.
尝试解释什么是列表或堆栈。 甚至还不行,尝试向尚未在学校学习过除法运算的人解释模运算符。 您需要在解释此类术语时更具创造力。 我用Python教授列表和索引的一种方法是让学生为一栋建筑物绘制图片,其中公寓是项目,公寓号是索引。
The process of thinking and coming up with ideas to explain such concepts in a way six-year-olds would understand forces you to rethink that concept and try to approach it from different perspectives until you reach one that can be easily explained and understood.
思考和提出想法以六岁儿童理解的方式进行的过程迫使您重新思考该概念,并尝试从不同的角度来探讨它,直到您可以轻松地理解和理解。
回到基础知识总是好的 (It’s Always Good to Go Back to the Basics)
The longer we program, the further we go through our career path, learning new tools and advanced techniques, the further we move away from the basics. Although we do know those basics, they are stored somewhere in our memory. Our current knowledge is based on them, but their details have become somewhat blurry.
我们学习的时间越长,我们越走越职业道路,学习新工具和先进技术,就越远离基础知识。 尽管我们确实知道这些基础知识,但它们仍存储在我们的内存中。 我们目前的知识基于这些知识,但是它们的细节变得有些模糊。
Going back to the basics is always a good idea. It helps us refresh our knowledge. Not just that, going back to the basics with more advanced knowledge could help us better understand the basics and strengthen our understanding of the higher-level tools we use daily.
回到基础知识总是一个好主意。 它有助于我们更新知识。 不仅如此,使用更高级的知识回到基础知识还可以帮助我们更好地理解基础知识,并加深我们对日常使用的高级工具的理解。
逆向教学 (Teaching Is Learning in Reverse)
When one teaches, they are not just delivering information. They are also receiving ideas and perspectives from their students. Kids are incredibly creative and see things from a completely different angle. Because of that, their solutions to some problems may seem weird and very simplistic, which is precisely why teaching them is a form of learning.
当一个人教书时,他们不仅仅是在传递信息。 他们还从学生那里收到想法和观点。 孩子们极富创造力,并且从完全不同的角度看事物。 因此,他们对某些问题的解决方案看起来很奇怪而且非常简单,这就是为什么教他们是一种学习形式的原因。
I learned a lot from my students: how they perceive the problem, how they think of solutions, and the solutions themselves. Teaching kids made me always look for the simplest, most straightforward answer to any problem. I learned to stop overcomplicating things and trying to find an answer that shows how much I know. Instead, I started focusing on finding an efficient solution that is easy to understand for anyone who reads my code — regardless of their knowledge level.
我从学生那里学到了很多东西:他们如何看待问题,如何看待解决方案以及解决方案本身。 教孩子们使我总是寻找任何问题的最简单,最直接的答案。 我学会了停止使事情变得过于复杂,并试图找到一个可以说明我所学知识的答案。 取而代之的是,我开始专注于寻找一种有效的解决方案,无论其知识水平如何,该解决方案对于任何阅读我的代码的人都易于理解。
经常使用伪代码 (Use Pseudocode More Often)
Pseudocode is one of the underrated gems of computer science. Often, when we are faced with a new programming challenge, we jump into finding solutions rather than laying out the problem step by step and trying to find solutions for each level.
伪代码是计算机科学中被低估的瑰宝之一。 通常,当我们面临新的编程挑战时,我们会跳入寻找解决方案的过程,而不是一步一步地布置问题并尝试为每个级别寻找解决方案。
Using pseudocode is the first skill I teach my students. It shows them — and me — that ideas and concepts are what matter. Not syntax. Learning to code is not about learning the syntax of a programming language. It is instead about learning the process of thinking and reaching an answer. Unfortunately, that is not the way I was taught programming. I was taught strictly via using C++ syntax, expanding my knowledge to a more abstract level where ideas are what matter. The thought process was a skill I learned when I started working on real-life projects.
使用伪代码是我教给学生的第一项技能。 它向他们(以及我)表明,思想和观念至关重要。 不是语法。 学习编码与学习编程语言的语法无关。 相反,它是关于学习思考和获得答案的过程。 不幸的是,这不是我学习编程的方式。 严格地讲,我是使用C ++语法进行授课的,将我的知识扩展到更重要的抽象水平,在这里思想至关重要。 思考过程是我开始从事现实项目时学到的技能。
编写更短,更简单的代码/注释 (Write Shorter, Simpler Code/Comments)
I have always believed a self-explanatory code is the best kind of code. This belief got even stronger when I started teaching CS. I needed to be very careful with my variable naming, my function naming, and my comments. My naming scheme had to go beyond descriptive. It had to be short and concise. Kids get bored and distracted quickly, so they want to figure out what the code is trying to achieve fast and easily. If the code is not well organized and well commented, they are going to lose interest and will not go further in reading/learning about what the code does.
我一直认为,不言自明的代码是最好的代码。 当我开始教授CS时,这种信念变得更加坚定。 我需要非常小心地使用变量命名,函数命名和注释。 我的命名方案必须超出描述范围。 它必须简短明了。 孩子们很快就会感到无聊和分心,因此他们想弄清楚代码试图快速轻松实现的目的。 如果代码没有很好的组织和注释,他们将失去兴趣,并且不会进一步阅读/学习代码的功能。
结论 (Conclusion)
Ever since I started teaching kids, I began applying the skills I learned from them to my daily coding. I became better at explaining complex programming ideas and started using more visualization and graphics to make my techniques more comfortable to grasp. My code has become more organized, more concise, and definitely more readable. I have finally managed to write near-perfect comments.
自从我开始教孩子们以来,我就开始将从他们那里学到的技能应用到我的日常编码中。 我变得更擅长于解释复杂的编程思想,并开始使用更多的可视化和图形方式来使我的技术更易于掌握。 我的代码变得更有条理,更简洁并且更易于阅读。 我终于设法写出了近乎完美的评论。
So, my advice to any programmer or developer is to try to teach programming to your younger siblings, your kids, your nieces, or nephews. Attempt to explain your ideas to them, and if they fail to understand it, simplify it and try again.
因此,对于任何程序员或开发人员,我的建议是尝试向您的年幼兄弟姐妹,孩子,侄女或侄子传授编程知识。 尝试向他们解释您的想法,如果他们无法理解,请简化并重试。
Simplifying your work will give a deeper understanding of the mechanisms behind it.
简化您的工作将使您更深入地了解其背后的机制。
You will be shocked by the positive effects that explaining your code has on the quality of your future work.
解释代码对未来工作质量的积极影响将使您感到震惊。
翻译自: https://medium.com/better-programming/how-teaching-kids-cs-made-me-a-better-programmer-37030dd2d3e4
程序员 cs 转 bs