学习编程的主要Struts-以及初学者为什么应该掌握它们。

by Rainer Hahnekamp

通过Rainer Hahnekamp

学习编程的主要Struts-以及初学者为什么应该掌握它们。 (The main pillars of learning programming — and why beginners should master them.)

I have been programming for more than 20 years. During that time, I’ve had the pleasure to work with many people, from whom I learned a lot. I’ve also worked with many students, coming fresh from university, with whom I had to take on the role of a teacher or mentor.

我从事编程已有20多年了。 在这段时间里,我很高兴与很多人一起工作,从中学到了很多东西。 我还与许多刚从大学毕业的学生一起工作过,我不得不与他们一起担任老师或导师的角色。

Lately, I have been involved as a trainer in a program that teaches coding to absolute beginners.

最近,我作为一名培训师参与了向绝对初学者教授编码的程序。

Learning how to program is hard. I often find that university courses and bootcamps miss important aspects of programming and take poor approaches to teaching rookies.

学习如何编程很难。 我经常发现大学课程和训练营错过了编程的重要方面,并且采用了糟糕的方法来教授新手。

I want to share the five basic pillars I believe a successful programming course should build upon. As always, I am addressing the context of mainstream web applications.

我想分享我认为成功的编程课程应该建立的五个基本Struts。 与往常一样,我正在探讨主流Web应用程序的上下文。

A rookie’s goal is to master the fundamentals of programming and to understand the importance of libraries and frameworks.

新手的目标是掌握编程的基础知识,并了解库和框架的重要性。

Advanced topics such as the cloud, operations in general, or build tools should not be part of the curriculum. I am also skeptical when it comes to Design Patterns. They presume experience that beginners never have.

云,一般操作或构建工具等高级主题不应成为课程的一部分。 对于设计模式,我也表示怀疑。 他们假定初学者从未有过的经验。

So let’s look at where new programmers should start.

因此,让我们看看新程序员应该从哪里开始。

测试驱动开发(TDD) (Test-Driven Development (TDD))

TDD brings a lot of benefits. Unfortunately, it is an advanced topic that beginners are not entirely ready for.

TDD带来很多好处 。 不幸的是,这是一个高级主题,初学者还没有完全做好准备。

Beginners shouldn’t write tests. This would be too much for their basic skill levels. Instead, they should learn how to use and work with tests.

初学者不应该编写测试。 对于他们的基本技能水平来说,这太高了。 相反,他们应该学习如何使用和使用测试。

Each programming course should center around exercises. I extend my exercises with unit tests and provide the students an environment which is already setup for running those tests.

每个编程课程都应围绕练习进行。 我将单元测试扩展到练习中,并为学生提供一个已经准备好运行这些测试的环境。

All the students have to do is write their code and then watch the lights of the testrunner turning from red to green. The resulting gamification is a nice side effect.

所有学生要做的就是编写他们的代码,然后看着测试运行程序的指示灯从红色变为绿色。 最终的游戏化是一个很好的副作用。

For example: If the selected technology is Spring, I provide the exercises and tests within a Spring project. The students don’t need to know anything about Spring. All they need to know is the location of the exercises and the button to trigger the tests.

例如:如果选择的技术是Spring,那么我将在Spring项目中提供练习和测试。 学生不需要了解Spring。 他们只需要知道练习的位置和触发测试的按钮即可。

Additionally, students must know how to use a debugger and have a Read-Eval-Print Loop (REPL) handy. The ability to analyse code during runtime and to have a playground for small experiments is essential in TDD.

此外,学生必须知道如何使用调试器,并具有阅读-评估-打印循环(REPL)的便利。 在TDD中,分析运行时代码并为小型实验提供场地的能力至关重要。

The main point is to ensure students don’t have to learn basic TDD behaviours after they’ve acquired core programming skills. Changing habits later in the students’ career will be much harder than learning those habits now. That’s why they should live and breath unit tests from the beginning.

重点是确保学生在掌握核心编程技能后不必学习基本的TDD行为。 在学生职业生涯的后期改变习惯要比现在学习这些习惯困难得多。 这就是为什么他们从一开始就应该进行生活和呼吸单元测试的原因。

Later in their professional life, they should have an antipathy for projects without unit tests. They should intuitively see the absence of unit tests as anti-pattern.

在职业生涯的后期,他们应该对没有单元测试的项目产生同感。 他们应该直观地将缺少单元测试视为反模式。

基础第一 (Fundamentals First)

I hear very often that rookies should immediately start with a framework. This is like teaching people how to drive by placing them in a rally car and asking them to avoid oversteering. This simply ignores the fact that they still mistake the brake for the throttle.

我经常听到新秀应该立即从框架开始。 这就像教人们如何将他们放在拉力赛车上并要求他们避免转向过度一样。 这完全忽略了他们仍然将制动器误认为节气门的事实。

The same applies when we start students with a framework like Angular. Beginners need to understand the fundamentals of programming first. They need to be familiar with the basic elements and what it means to write code before they can use somebody else’s.

当我们以Angular之类的框架开始学习学生时,情况也是如此。 初学者需要首先了解编程的基础知识。 他们需要熟悉基本元素以及编写代码的含义,然后才能使用其他人的代码。

The concept of a function, a variable, a condition, and a loop are completely alien to novices. These four elements build the foundations of programming. Everything a program is made of relies on them.

函数,变量,条件和循环的概念与新手完全无关。 这四个要素为编程奠定了基础。 程序所构成的一切都依赖于它们。

Students are hearing these concepts for the very first time, but it is of the utmost importance that the students become proficient with them. If students do not master the fundamentals, everything that follows looks like magic and leads to confusion and frustration.

学生们是第一次听到这些概念,但是最重要的是,学生要精通它们。 如果学生不掌握基础知识,那么随之而来的一切都会像魔术一样,并导致混乱和沮丧。

Teachers should spend more time on these fundamentals. But, sadly, many move on far too quickly. The problem is that some teachers struggle to put themselves into the role of a student. They have been programming for ages and have forgotten what types of problems a beginner has to deal with. It is quite similar to a professional rally driver. He can’t imagine that somebody needs to think before braking. He just does it automatically.

教师应该在这些基础知识上花费更多的时间。 但是,可悲的是,许多人发展得太快了。 问题是,有些老师努力让自己扮演学生的角色。 他们已经编程了很长时间了,却忘记了初学者必须处理哪些类型的问题。 它与职业拉力赛车手非常相似。 他无法想象有人在刹车之前需要思考。 他只是自动执行。

I design my exercises so that they are challenging but solvable in a reasonable amount of time by using a combination of the four main elements.

我将练习设计为使它们具有挑战性,但可以通过结合四个主要要素在合理的时间内解决。

A good example is a converter for Roman and Arabic numbers. This challenge requires patience from the students. Once they successfully apply the four elements to solve the challenge, they also get a big boost in motivation.

一个很好的例子是罗马数字和阿拉伯数字的转换器。 这一挑战需要学生的耐心。 一旦他们成功地运用了这四个要素来解决挑战,他们的动机也会大大增强。

Fundamentals are important. Don’t move on until they are settled.

基本原理很重要。 在解决之前不要继续前进。

库和框架 (Libraries and Frameworks)

After students spend a lot of time coding, they must learn that most code already exists in the form of a library or a framework. This is more a mindset than a pattern.

在学生花费大量时间进行编码之后,他们必须学习大多数代码已经以库或框架的形式存在。 这更是一种思维模式,而不是一种模式。

As I have written before: Modern developers know and pick the right library. They don’t spend hours writing a buggy version on their own.

正如我写之前 :现代开发商知道并选择正确的库。 他们不会花费数小时自行编写错误的版本。

To make that mindset transition a success, the examples from the “fundamentals phase” should be solvable by using well-known libraries like Moment.js, Jackson, Lodash, or Apache Commons.

为了使这种思维方式成功过渡,应该使用Moment.js,Jackson,Lodash或Apache Commons等著名的库来解决“基础知识阶段”中的示例。

This way, students will immediately understand the value of libraries. They crunched their heads around those complicated problems. Now they discover that a library solves the exercise in no time.

这样,学生将立即了解图书馆的价值。 他们为那些复杂的问题cru之以鼻。 现在他们发现图书馆可以立即解决此问题。

Similar to TDD, students should become suspicious when colleagues brag about their self-made state management library that makes Redux unnecessary.

与TDD类似,当同事吹嘘自己的自制状态管理库(使Redux变得不必要)时,学生应该变得可疑。

When it comes to frameworks, students will have no problem understanding the importance once they understand the usefulness of libraries.

说到框架,一旦学生了解了图书馆的有用性,他们便会毫无疑问地理解其重要性。

Depending on the course’s timeframe, it may be hard to devote time to frameworks. But as I already pointed out, the most important aspect is shifting the mindset of the student away from programming everything from scratch to exploring and using libraries.

根据课程的时间框架,可能很难花时间在框架上。 但是,正如我已经指出的,最重要的方面是使学生的思维方式从编程的所有内容转移到从探索到使用库的一切。

I did not add tools to this pillar, since they are only of use to experienced developers. At this early stage, students do not need to learn how to integrate and configure tools.

我没有在此Struts上添加工具,因为它们仅对有经验的开发人员有用。 在此早期阶段,学生无需学习如何集成和配置工具。

硕士与学徒 (Master & Apprentice)

In my early 20s I wanted to learn to play the piano. I did not want a teacher, and thought I could learn it by myself. Five years later, I consulted a professional tutor. Well, what can I say? I’ve learned more in 1 month than during the five years before.

在20多岁的初期,我想学习弹钢琴。 我不想要老师,以为自己可以学习。 五年后,我咨询了一名专业导师。 好吧,我能说什么? 与过去五年相比,我在1个月内学到的知识更多。

My piano teacher pointed out errors in my playing I couldn’t hear and made me aware of interpretational things I never would have imagined. After all, she instilled in me the mindset for music and art, both of which were out of reach for me as a technical person.

我的钢琴老师指出了我听不到的演奏中的错误,并使我意识到了我从未想过的解释性内容。 毕竟,她向我灌输了音乐和艺术的思想,这对我作为技术人员来说都是遥不可及的。

It is the same in programming. If somebody has no experience in programming, then self-study can be a bad idea. Although there are many success stories, I question the efficiency of doing it alone.

在编程中是相同的。 如果没有编程经验,那么自学可能不是一个好主意。 尽管有许多成功的故事,但我对单独执行的效率表示怀疑。

Instead, there should be a “master & apprentice” relationship. In the beginning, the master gives rules the apprentice must follow — blindly! The master may explain the rules, but usually the reasoning is beyond the apprentice’s understanding.

取而代之的是应该有一个“主人与徒弟”的关系。 刚开始时,主人给学徒必须遵循的规则-盲目! 船长可以解释规则,但是通常推理是学徒无法理解的。

These internalised rules form a kind of safety net. If one gets lost, one always has some safe ground to return to.

这些内部化的规则形成了一种安全网。 如果迷路了,总会有一些安全的理由可以返回。

Teaching should not be a monologue. The master has to deal with each student individually. He should check how the students work, give advice, and adapt the speed of the course to their progress.

教学不应该是独白。 主人必须与每个学生单独打交道。 他应检查学生的工作方式,提供建议并根据他们的进步调整课程速度。

Once the apprentices reach a certain level of mastery, they should be encouraged to explore new territory. The master evolves into a mentor who shares “wisdom” and is open for discussions.

一旦学徒达到一定的掌握水平,应鼓励他们探索新的领域。 主人演变成一个分享“智慧”的导师,并愿意进行讨论。

挑战与动机 (Challenge and Motivation)

“Let’s create a Facebook clone!” This doesn’t come from a CEO backed by a horde of senior software developers and a multi-million euro budget. It is an exercise from an introductory course for programmers. Such an undertaking is virtually impossible. Even worse, students are put into wonderland and deluded into believing they have skills that are truly beyond their reach.

“让我们创建一个Facebook克隆!” 这并不是来自一群由高级软件开发人员和数百万欧元预算支持的首席执行官。 这是针对程序员的入门课程的练习。 这项工作实际上是不可能的。 更糟糕的是,学生被放进了仙境,以为他们相信自己拥有真正超出自己能力的技能。

No doubt the teacher is aware of that, but creates such exercises for motivational reasons.

毫无疑问,老师知道这一点,但出于动机的原因而进行此类练习。

The main goal of an exercise is not to entertain. It should be created around a particular technique and should help the students understand that technique.

锻炼的主要目的不是娱乐。 它应该围绕特定技术创建,并应帮助学生理解该技术。

Motivation is good, but not at the sacrifice of content. Programming is not easy. If the students don’t have an intrinsic motivation, coding might not be the way to go.

动机是好的,但不能牺牲内容。 编程并不容易。 如果学生没有内在动力,那么编码可能就不可行了。

Newbies should experience what it means to be a professional developer. They should know what awaits them before they invest lots of hours.

新手应该体验成为专业开发人员的意义。 他们应该在投入大量时间之前知道等待他们的是什么。

For example, many business applications center around complex forms and grids. Creating these is an important skill that exercises can impart. Building an application similar to Facebook might not be the best lesson for students to learn right away.

例如,许多业务应用程序都围绕复杂的表单和网格。 创造这些是锻炼可以传授的重要技能。 构建类似于Facebook的应用程序可能不是让学生立即学习的最佳课程。

Similarly, a non-programmer might be surprised at how few code lines a developer writes per day. There are even times where we remove code or achieve nothing.

同样,非程序员可能会对开发人员每天编写的代码行数感到惊讶。 甚至有时候我们删除代码或什么也没做。

Why? Because things go wrong all the time. We spend endless hours fixing some extremely strange bugs that turn out to be a simple typo. Some tool might not be working just because a library got a minor version upgrade. Or the system crashes because somebody forgot to add a file to git. The list can go on and on.

为什么? 因为事情总是出错。 我们花了无尽的时间来修复一些非常奇怪的错误,这些错误原来是一个简单的错字。 某些工具可能仅由于库进行了次要版本升级而无法使用。 否则系统崩溃,因为有人忘记了向git添加文件。 该列表可以继续下去。

Students should enjoy these experiences. An exercise targeting an unknown library under time pressure might be exactly the right thing. ;)

学生应该享受这些经历。 在时间压力下针对未知图书馆进行练习可能是正确的选择。 ;)

The sun isn’t always shining in real life. Beginners should be well-prepared for the reality of programming.

在现实生活中,太阳并不总是照耀着。 初学者应该为编程的现实做好充分的准备。

最终建议 (Final Advice)

Last but not least: One cannot become a professional programmer in two weeks, two months or even a year. It takes time and patience.

最后但并非最不重要的一点:一个人不能在两周,两个月甚至一年内成为一名专业程序员。 这需要时间和耐心。

Trainers should not rush or make false promises. They should focus on whether students understand the concepts and not move on too fast.

培训师不应着急或做出虚假的承诺。 他们应该关注学生是否理解概念,而不要太快。

Originally published at www.rainerhahnekamp.com on June 10, 2018.

最初于2018年6月10日发布在www.rainerhahnekamp.com上。

翻译自: https://www.freecodecamp.org/news/the-main-pillars-of-learning-programming-and-why-beginners-should-master-them-e04245c17c56/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值