编辑
2023-09-24
英语学习
00

This is a question from Quora.

Should I go to UC Berkeley for 75k a year and take on the debt?

I’m a computer science professor, I hold a PhD, and I live in California. If I had a bright, hardworking child who wanted to study STEM, while I would support their preference, I would strongly discourage them from attending UC Berkeley.

The class sizes are outrageous, especially in CS. The intro class holds up to 2,000 students in the fall.

If you’re impressed by research, realize that it’s much harder to get into a lab as an undergraduate, and if you do, you’ll likely be mentored by a more senior undergraduate who is themselves being mentored by a grad student who will occasionally meet with the professor.

Living in Berkeley is absurd. The cost is high, the competition for apartments is intense, and much of the housing is low quality.

I get the appeal, and perhaps I’d have a different opinion for the humanities and social sciences, but for STEM, I’d choose an academically more conducive environment.

Now if you’re taking on $75,000 a year in debt, that’s just nonsense. Absolute nonsense. That’s so far beyond the scope of reason that it should be an entrance test; if you’re willing to do so, you should not be at Berkeley.

中文翻译

我应该每年花费7.5万美元去加州大学伯克利分校,并承担债务吗? 我是一名计算机科学教授,拥有博士学位,居住在加利福尼亚。如果我有一个聪明、勤奋的孩子想要学习STEM(科学、技术、工程和数学),虽然我会支持他们的选择,但我会强烈劝阻他们不要去加州大学伯克利分校。

课程规模太庞大,特别是在计算机科学领域。入门课程在秋季学期最多容纳2,000名学生。

如果你对研究印象深刻,要意识到作为本科生要进入实验室会更加困难,如果成功进入,你可能会由一名更高年级的本科生指导,而他们自己则是一名研究生生导师的学生,偶尔会与教授见面。

住在伯克利是荒谬的。成本高昂,公寓竞争激烈,而且大部分住房质量较低。

我理解其吸引力,也许我对人文和社会科学有不同的看法,但对于STEM来说,我会选择一个学术环境更有利的地方。

现在,如果你每年承担7.5万美元的债务,那就太荒谬了。绝对的荒谬。这已经远远超出了合理范围,应该成为一个入学考试;如果你愿意这样做,那么你不应该选择伯克利。

  • should:应该。
  • go to:去。
  • UC Berkeley:加州大学伯克利分校(美国加州一所著名的大学)。
  • for:为了。
  • 75k a year:每年7.5万美元。
  • take on:承担。
  • debt:债务。
  • computer science professor:计算机科学教授。
  • hold a PhD:拥有博士学位。
  • live in:居住在。
  • California:加利福尼亚(美国西海岸的州)。
  • bright:聪明的。
  • hardworking:勤奋的。
  • child:孩子。
  • study:学习。
  • STEM:STEM(科学、技术、工程和数学)。
  • support:支持。
  • preference:选择。
  • strongly discourage:强烈劝阻。
  • class sizes:课程规模。
  • outrageous:庞大的。
  • especially in:特别是在。
  • CS:计算机科学(Computer Science的缩写)。
  • intro class:入门课程。
  • holds up to:最多容纳。
  • students in:学生。
  • the fall:秋季学期。
  • impressed by:对...印象深刻。
  • research:研究。
  • realize:意识到。
  • much harder to get into:更难进入。
  • a lab as an undergraduate:作为本科生进入实验室。
  • mentored by:由...指导。
  • a more senior undergraduate:更高年级的本科生。
  • themselves being mentored by:他们自己是由...指导的。
  • a grad student:一名研究生。
  • who will occasionally meet with:偶尔会与...见面。
  • professor:教授。
  • Living in:生活在。
  • absurd:荒谬的。
  • cost:成本。
  • competition for apartments:公寓竞争。
  • intense:激烈的。
  • housing:住房。
  • low quality:质量较低的。
  • get the appeal:理解其吸引力。
  • perhaps:也许。
  • I'd have a different opinion:我会有不同的看法。
  • academically more conducive:学术环境更有利的。
  • environment:环境。
  • now:现在。
  • if someone brings up:如果有人提出。
  • the topic of:...的话题。
  • won't get swept away by jargons:不会被术语所迷惑。
编辑
2023-09-24
英语学习
00

How is Kubernetes (k8s) different from Docker?

The question “Kubernetes vs. Docker?” in itself is rather absurd, like comparing apples to oranges. One isn’t an alternative to the other. Quite the contrary, Kubernetes can run without Docker and Docker can function without Kubernetes. But Kubernetes can (and does) benefit greatly from Docker and vice versa.

中文翻译

"“Kubernetes vs. Docker?”这个问题本身相当荒谬,就像比较苹果和橙子一样。它们不是相互替代的。恰恰相反,Kubernetes 可以在没有 Docker 的情况下运行,而 Docker 也可以在没有 Kubernetes 的情况下工作。但 Kubernetes 可以(并且确实)从 Docker 获得很大的好处,反之亦然。"

  • question:问题
  • rather:相当
  • absurd:荒谬的
  • like:像
  • comparing:比较
  • apples:苹果
  • oranges:橙子
  • alternative:替代品
  • one:一个
  • isn't:不是
  • another:另一个
  • quite:相当
  • contrary:相反的
  • can:可以
  • run:运行
  • without:没有
  • function:工作
  • benefit:获益
  • greatly:极大地
  • from:从...中
  • vice versa:反之亦然

Docker is a standalone application which can be installed on any computer to run containerized applications. Containerization is an approach of running applications on an OS such that the application is isolated from the rest of the system. You create an illusion for your application that it is getting its very own OS instance, although there may be other containers running on the same system. Docker is what enables us to run, create and manage containers on a single operating system.

中文翻译

Docker 是一个独立的应用程序,可以安装在任何计算机上,用于运行容器化应用程序。容器化是一种在操作系统上运行应用程序的方法,使应用程序与系统的其余部分隔离开来。您为您的应用程序创建了一个假象,让它认为它有自己的操作系统实例,尽管可能在同一系统上运行其他容器。Docker 是让我们能够在单个操作系统上运行、创建和管理容器的工具。

  • Docker:Docker(容器化平台的名称)。
  • standalone:独立的。
  • application:应用程序。
  • installed:安装。
  • computer:计算机。
  • run:运行。
  • containerized:容器化的。
  • applications:应用程序。
  • Containerization:容器化。
  • approach:方法。
  • running:运行。
  • isolated:隔离的。
  • rest:其余部分。
  • system:系统。
  • create:创建。
  • illusion:假象。
  • getting:得到。
  • very own:自己的。
  • OS instance:操作系统实例。
  • other:其他。
  • containers:容器。
  • enables:使能够。
  • us:我们。
  • manage:管理。
  • single:单个。
  • operating system:操作系统。

Kubernetes turns it up to eleven. If you have Docker installed on a bunch of hosts (different operating systems), you can leverage Kubernetes. These nodes or Docker hosts can be bare metal servers or virtual machines. Kubernetes can then allow you to automate container provisioning, networking, load-balancing, security and scaling across all these nodes from a single command-line or dashboard. A collection of nodes that are managed by a single Kubernetes instance is referred to as a Kubernetes cluster.

中文翻译

Kubernetes 把它推向了更高级别。如果您在一堆主机上安装了 Docker(不同的操作系统),您可以利用 Kubernetes。这些节点或 Docker 主机可以是裸机服务器或虚拟机。然后,Kubernetes 可以允许您从单个命令行或仪表板自动化容器的配置、网络、负载均衡、安全性和扩展,跨所有这些节点。由单个 Kubernetes 实例管理的一组节点被称为 Kubernetes 集群。

  • Kubernetes:Kubernetes(容器编排平台的名称)。
  • turns it up to eleven:将其提升到更高级别(表示 Kubernetes 是高级的容器编排工具)。
  • installed:安装。
  • bunch:一堆。
  • hosts:主机。
  • different:不同的。
  • operating systems:操作系统。
  • leverage:利用。
  • nodes:节点。
  • Docker hosts:Docker 主机。
  • bare metal:裸机(指裸机服务器,没有虚拟化层的服务器)。
  • servers:服务器。
  • virtual machines:虚拟机。
  • allow:允许。
  • automate:自动化。
  • container provisioning:容器配置。
  • networking:网络。
  • load-balancing:负载均衡。
  • security:安全性。
  • scaling:扩展。
  • across:跨越。
  • single:单个。
  • command-line:命令行。
  • dashboard:仪表板。
  • collection:集合。
  • managed by:由...管理。
  • instance:实例。
  • referred to as:称为。
  • cluster:集群。

Now, why would you need to have multiple nodes in the first place? The two main motivations behind it are:

中文翻译

那么,为什么首先需要多个节点呢?背后的两个主要动机是

  • need:需要。
  • multiple:多个。
  • nodes:节点。
  • first place:首先。
  • two:两个。
  • main:主要的。
  • motivations:动机。
  • behind:背后的。

To make the infrastructure more robust — Your application will be online, even if some of the nodes go offline, i.e, High Availability. To make your application more scalable — If workload increases simply spawn more containers and/or add more nodes to your Kubernetes cluster. “Kubernetes automates the process of scaling, managing, updating and removing containers. In other words, it is a container orchestration platform. While Docker is at the heart of the containerization, it enables us to have containers in the first place.

中文翻译

为了使基础设施更加健壮 — 即使一些节点下线,您的应用程序也将在线运行,即实现高可用性。为了使您的应用程序更加可扩展 — 如果工作负载增加,只需生成更多容器和/或添加更多节点到您的 Kubernetes 集群。 "Kubernetes 自动化了扩展、管理、更新和删除容器的过程。换句话说,它是一个容器编排平台。虽然 Docker 是容器化的核心,它使我们能够首次使用容器。

  • To make:为了使。
  • infrastructure:基础设施。
  • more robust:更加健壮。
  • Your application:您的应用程序。
  • online:在线。
  • even if:即使。
  • some:一些。
  • go offline:下线。
  • i.e.:即,即是(拉丁语缩写,表示 "that is",即 "也就是说")。
  • High Availability:高可用性。
  • scalable:可扩展。
  • workload:工作负载。
  • increases:增加。
  • simply:简单地。
  • spawn:生成。
  • containers:容器。
  • and/or:和/或(用于表示 "和" 或 "或" 的组合)。
  • add:添加。
  • nodes:节点。
  • Kubernetes cluster:Kubernetes 集群。
  • automates:自动化。
  • process:过程。
  • scaling:扩展。
  • managing:管理。
  • updating:更新。
  • removing:删除。
  • container orchestration platform:容器编排平台。
  • While:虽然。
  • Docker:Docker(容器化平台的名称)。
  • at the heart of:在...的核心。
  • containerization:容器化。
  • enables:使能够。
  • have:拥有。
  • containers:容器。

In principle, Kubernetes can work with any containerization technology. Two of the most popular options that Kubernetes can integrate with are rkt and Docker. However, Docker has won the greatest market segment and that has led to a lot of effort in perfecting the integration between Docker and Kubernetes, more than any other containerization technology.

中文翻译

原则上,Kubernetes 可以与任何容器化技术一起使用。Kubernetes 可以与最流行的两种选项集成,分别是 rkt 和 Docker。然而,Docker 赢得了最大的市场份额,这导致了在 Docker 和 Kubernetes 之间完善集成的许多努力,超过了任何其他容器化技术。

  • In principle:原则上。
  • Kubernetes:Kubernetes(容器编排平台的名称)。
  • can work with:可以与...一起使用。
  • any:任何。
  • containerization technology:容器化技术。
  • Two of the most popular options:最流行的两种选项。
  • integrate with:与...集成。
  • are:是。
  • rkt:rkt(一种容器运行时)。
  • Docker:Docker(容器化平台的名称)。
  • However:然而。
  • has won:赢得。
  • the greatest:最大的。
  • market segment:市场份额。
  • that has led to:导致了。
  • a lot of:许多。
  • effort:努力。
  • perfecting:完善。
  • the integration between:在...之间的集成。
  • more than:超过。
  • any other:任何其他。

Similarly, Docker Inc., the company behind Docker, offers their own container orchestration engine, named Docker Swarm. But even they realized the fact that Kubernetes has risen to the point that even Docker for Desktop (MacOS and Windows) comes with its own Kubernetes distribution.

中文翻译

同样地,Docker Inc.,即 Docker 背后的公司,提供了他们自己的容器编排引擎,名为 Docker Swarm。但即使他们也意识到 Kubernetes 已经崭露头角,以至于即使是 Docker for Desktop(适用于 MacOS 和 Windows)也附带了自己的 Kubernetes 发行版。

  • Similarly:同样地。
  • Docker Inc.:Docker 公司(Docker 背后的公司)。
  • the company behind:背后的公司。
  • offers:提供。
  • their own:他们自己的。
  • container orchestration engine:容器编排引擎。
  • named:命名为。
  • Docker Swarm:Docker Swarm(Docker 提供的容器编排工具)。
  • But even:但即使。
  • they realized:他们意识到。
  • the fact that:事实是。
  • has risen to the point:已经崭露头角。
  • that even:以至于即使。
  • Docker for Desktop:Docker for Desktop(用于 MacOS 和 Windows 的 Docker 版本)。
  • comes with:附带。
  • its own:自己的。
  • Kubernetes distribution:Kubernetes 发行版。

If anyone was nervous about adopting Kubernetes for their Docker-based product, that last point would get rid of all of the doubts. Both projects have wholeheartedly embraced each other and have benefited tremendously from this symbiosis.

中文翻译

如果有人对于在其基于 Docker 的产品中采用 Kubernetes 感到紧张,那么最后一点将消除所有疑虑。这两个项目都全力拥抱了彼此,并从这种共生关系中获得了巨大的好处。

  • If anyone:如果有人。
  • was nervous about:对...感到紧张。
  • adopting:采用。
  • Kubernetes:Kubernetes(容器编排平台的名称)。
  • for their:为他们的。
  • Docker-based product:基于 Docker 的产品。
  • that last point:最后一点。
  • would get rid of:将消除。
  • all of the:所有的。
  • doubts:疑虑。
  • Both:两者都。
  • projects:项目。
  • have wholeheartedly embraced:全力拥抱。
  • each other:彼此。
  • and have benefited tremendously from:并从中获得了巨大的好处。
  • this symbiosis:这种共生关系。

These projects are more than technologies, they are a community of people, who, despite their differences, are is composed of some of the brightest minds in the industry. When like-minded individuals collaborate, they exchange bright ideas and learn best practices from one another.

These are some of such ideas that both, Kubernetes and Docker, share:

中文翻译

这些项目不仅仅是技术,它们是一群人的社区,尽管他们之间存在差异,但组成这些社区的人才是该行业中最杰出的一些人。当志同道合的个体合作时,他们交流睿智的思想,并从彼此那里学习最佳实践。

以下是该段话中的关键单词的中文意思:

  • These projects:这些项目。
  • are more than:不仅仅是。
  • technologies:技术。
  • they are:它们是。
  • a community of people:一群人的社区。
  • who:谁。
  • despite their differences:尽管他们之间存在差异。
  • is composed of:由...组成。
  • some of the brightest minds:一些最杰出的思想。
  • in the industry:在该行业中。
  • When:当。
  • like-minded:志同道合的。
  • individuals:个体。
  • collaborate:合作。
  • they exchange:他们交流。
  • bright ideas:睿智的思想。
  • and learn:并从中学习。
  • best practices:最佳实践。
  • from one another:从彼此那里学习。

Their love for microservice based architecture (more on this later). Their love for open source community. Both are largely open source projects. They are largely written in Go which allows them to be shipped as small lightweight binaries. They use human-readable YAML files to specify application stacks and their deployments. In theory, you can learn about one without having a clue about the other. But keep in mind that in practice you will benefit a lot more if you start with the simple case of Docker running on a single machine, and then gradually understand how Kubernetes comes into play.

中文翻译

他们对微服务架构的热爱(稍后会详细介绍)。 他们对开源社区的热爱。它们都是大规模的开源项目。 它们主要是用 Go 语言编写的,这使它们能够作为小型轻量级二进制文件进行发布。 它们使用人类可读的 YAML 文件来指定应用程序堆栈及其部署。 从理论上讲,您可以了解其中一个而对另一个一无所知。但请记住,在实践中,如果您从单台机器上运行 Docker 的简单情况开始,然后逐渐了解 Kubernetes 如何运作,您将受益良多。

  • Their love for:他们对...的热爱。
  • microservice based architecture:微服务架构。
  • more on this later:稍后详细介绍。
  • open source community:开源社区。
  • Both are largely:它们都是大规模的。
  • largely written in:主要用...编写。
  • Go:Go 语言(一种编程语言)。
  • allows them to be:使它们能够。
  • shipped as:作为...进行发布。
  • small lightweight binaries:小型轻量级二进制文件。
  • use:使用。
  • human-readable:人类可读的。
  • YAML files:YAML 文件。
  • specify:指定。
  • application stacks:应用程序堆栈。
  • deployments:部署。
  • In theory:从理论上讲。
  • you can learn about:您可以了解有关...的信息。
  • one without:一个而没有。
  • having a clue about:一无所知。
  • But keep in mind that:但请记住。
  • in practice:在实践中。
  • you will benefit a lot more:您将获益更多。
  • if you start with:如果您从...开始。
  • the simple case of:简单情况。
  • Docker running on:在...上运行 Docker。
  • a single machine:单台机器。
  • gradually understand:逐渐了解。
  • comes into play:起作用。

Containers are amazing! They allow us to think about services and systems in a completely new and digital way. Both Docker and Kubernetes are here to stay. They are continuously changing to transform themselves into something better in the future. Keep your company involved in the Technology era and implement the containers that your infrastructure needs the most.

中文翻译

容器是令人惊奇的!它们使我们能够以全新的数字方式思考服务和系统。Docker 和 Kubernetes 都将继续存在。它们正在不断变化,以将自己转变为未来更好的东西。让您的公司参与科技时代,并实施您的基础设施最需要的容器。

  • Containers:容器。
  • are amazing:令人惊奇。
  • They allow us to:它们使我们能够。
  • think about:思考。
  • services and systems:服务和系统。
  • in a completely new and digital way:以全新的数字方式。
  • Both:两者都。
  • here to stay:将继续存在。
  • They are continuously changing:它们正在不断变化。
  • to transform themselves into:将自己转变为。
  • something better in the future:未来更好的东西。
  • Keep your company involved in:让您的公司参与。
  • the Technology era:科技时代。
  • implement:实施。
  • the containers:容器。
  • that your infrastructure needs:您的基础设施最需要的。

Designing newer software for a container-centric platform would not only make your apps more scalable but also more future-proof. Sticking to the old VMs might work for now, but a few years down the line you will eventually have to either bear the heavy cost of migrating everything into containers or abandon your projects altogether. Hopefully, now if someone brings up the topic of “Kubernetes vs Docker” you won’t get swept away by jargons.

中文翻译

为容器为中心的平台设计新的软件不仅会使您的应用程序更具可扩展性,而且更具未来可塑性。坚持使用旧的虚拟机可能暂时有效,但几年后,您最终将不得不承担将所有内容迁移到容器中的巨大成本,或者完全放弃您的项目。希望现在如果有人提出“Kubernetes vs Docker”的话题,您不会被术语所迷惑。

  • Designing newer software for:为...设计新的软件。
  • a container-centric platform:一个以容器为中心的平台。
  • would not only:不仅仅会。
  • make your apps more scalable:使您的应用程序更具可扩展性。
  • but also:而且。
  • more future-proof:更具未来可塑性。
  • Sticking to:坚持使用。
  • insight: 理解
  • the old VMs:旧的虚拟机。
  • might work for now:可能暂时有效。
  • but a few years down the line:但几年后。
  • you will eventually have to:最终将不得不。
  • either bear the heavy cost of:承担巨大的成本。
  • migrating everything into containers:将所有内容迁移到容器中。
  • or abandon your projects altogether:或者完全放弃您的项目。
  • Hopefully:希望。
  • now if someone brings up:现在如果有人提出。
  • the topic of:...的话题。
  • won't get swept away by jargons:不会被术语所迷惑。
编辑
2023-09-23
英语学习
00

This is a question from Quora.

Is going to college for computer science with a focus of software engineering still worth it in 2023? I just finished my freshman year of college.

中文翻译

在2023年,选择攻读计算机科学专业,专注于软件工程方向,是否仍然值得?我刚刚完成大学一年级。

  • college: 大学
  • computer science: 计算机科学
  • focus: 专注
  • software engineering: 软件工程
  • worth it: 值得
  • 2023: 2023年
  • freshman year: 大一

You have three choices:

1.Continue in computer science.

2.Change to a different major.

3.Drop out of college.

Each of these carries risk and potential rewards. If you're only pursuing CS because you dream of making $150k

right after graduating college, I think you should choose something else. The market has shifted and that was not a sustainable reality. I warned that it would come to an end. There will be great opportunities, but making $300k 3–4 years out of college will be reserved for exceptional talent.

But if you stay, you will get a solid education that balances theory and practice. I don't know what the job market will look like in two years when you start applying for post-grad jobs, but there will be computing jobs.

中文翻译

你有三个选择:

  • 继续攻读计算机科学专业。
  • 转换到其他专业。
  • 辍学。

每个选择都有风险和潜在回报。如果你只是追求计算机科学专业,因为你梦想着在大学毕业后能够赚取15万美元,我认为你应该选择其他专业。市场已经发生了变化,那并不是一个可持续的现实。我曾警告过这种情况会结束。将来会有很好的机会,但赚取30万美元的机会将仅限于非凡的人才。

但是,如果你选择留下来,你将得到一种理论与实践相结合的扎实教育。我不知道两年后你开始申请毕业后的工作时,就业市场会是什么样子,但计算机相关的工作机会将会存在。

  • Continue: 继续
  • Computer Science: 计算机科学
  • Change: 改变
  • Different: 不同的
  • Major: 专业
  • Drop out: 辍学
  • College: 大学
  • Carries: 带有
  • Risk: 风险
  • Potential: 潜在的
  • Rewards: 奖励
  • Pursuing: 追求
  • Dream: 梦想
  • Graduating: 毕业
  • Sustainable: 可持续的
  • Reality: 现实
  • Market: 市场
  • Shifted: 转变
  • Warned: 警告
  • End: 结束
  • Opportunities: 机会
  • Reserved: 保留
  • Exceptional: 出色的
  • Talent: 才能
  • Stay: 留下
  • Solid: 坚实的
  • Education: 教育
  • Balances: 平衡
  • Theory: 理论
  • Practice: 实践
  • Job market: 就业市场
  • Two years: 两年
  • Start: 开始
  • Applying: 申请
  • Post-grad: 研究生毕业后的
  • Computing jobs: 计算机相关工作
编辑
2023-09-23
英语学习
00

This is a question from Quora.

As a computer science educator if you can teach only one thing to your students what would it be?

中文翻译

作为一名计算机科学教育者,如果你只能教授一件事给你的学生,那会是什么?

  • Computer Science: 计算机科学
  • Educator: 教育者
  • Teach: 教授
  • One: 一
  • Thing: 事物
  • Student: 学生
  • What: 什么
  • Would: 将会
  • It: 它
  • Be: 存在/是

Algorithmic thinking. There's a lot that underlies that, but you fundamentally need to be able to learn how to break problems down in to smaller solvable tasks, and apply tightly constrained instructions to solve those tasks. The rest is just syntactic sugar and math. Really, really important math.

中文翻译

Algorithmic thinking(算法思维)是一种重要的思维方式,它需要学会将问题分解为可解决的小任务,并应用严格限定的指令来解决这些任务。除此之外,算法思维还涉及到一些基础的数学知识。算法思维是计算机科学中的核心概念,它帮助我们设计和实现高效的解决方案。除了语法和数学知识外,算法思维是非常重要的。

  • Algorithmic: 算法的
  • Thinking: 思维
  • Underlies: 构成...的基础
  • Fundamentally: 基本上
  • Need: 需要
  • Learn: 学习
  • Break down: 分解
  • Problems: 问题
  • Smaller: 更小的
  • Solvable: 可解决的
  • Tasks: 任务
  • Apply: 应用
  • Tightly constrained: 严格限定的
  • Instructions: 指令
  • Rest: 其余部分
  • Syntactic sugar: 语法糖
  • Math: 数学

I want to teach my students how to fail. Part of learning to fail is simple programming practice. It's fundiversión to write code, and the temptation is to write dozens of lines of code at a time. It's much less fun to debug code, and when your dozens of lines fails in strange ways you've made your life far more difficult than it needs to be. So take baby steps: write the smallest number of lines that can be tested, then stop and test it. That code will fail, too, but debugging it will be a relatively pain-free process and you get the psychological boost of solving lots of small failures relatively quickly.

中文翻译

"我想教我的学生如何失败。学习失败的一部分是简单的编程实践。编写代码很有趣,很容易一次写下几十行代码。但调试代码就没那么有趣了,当你的几十行代码以奇怪的方式失败时,你让自己的生活变得比必要的困难得多。所以要采取小步骤:写下最少的可以测试的代码行,然后停下来进行测试。那段代码也会失败,但调试起来相对轻松,而且你会获得在相对短的时间内成功解决许多小失败的心理推动。"

  • teach (教)
  • students (学生)
  • fail (失败)
  • relatively (相对的)
  • learning (学习)
  • much less (更不用说)
  • programming practice (编程实践)
  • write code (编写代码)
  • dozens of lines (几十行代码)
  • debug code (调试代码)
  • strange ways (奇怪的方式)
  • difficult (困难)
  • baby steps (小步骤)
  • smallest number of lines (最少的代码行数)
  • test (测试)
  • pain-free (相对轻松的)
  • process (过程)
  • psychological boost (心理推动)
  • solve (解决)
  • small failures (小失败)
  • quickly (迅速)

Source control also has a role to play here. If you commit often, you can occasionally take larger risks secure in knowing that if it doesn't work out, one command will bring you back to a known state.

中文翻译

"版本控制在这方面也起着重要作用。如果经常提交代码,你可以偶尔冒一些较大的风险,因为你知道如果不成功,只需一个命令就能将代码还原到已知状态。"

  • source control (版本控制)
  • role (角色,作用)
  • commit often (经常提交)
  • larger risks (较大的风险)
  • secure (安心)
  • one command (一个命令)
  • bring back (还原)
  • known state (已知状态)

The deeper lesson is divorcing code that fails from the feeling of failure. If your code X produced state Y and you wanted state Z, and you take this personally, you're in for a long semester. If, on the other hand, I can convince you that you've now learned something you didn't know before about code X, then you're much less likely to feel helpless. If you're not feeling helpless, it's a lot easier to try something different and eventually (after visiting states P, D, Q, and aleph-1) getting to Z.

中文翻译

"更深层次的教训是将失败的代码与失败的感觉分离开来。如果你的代码 X 产生了状态 Y,而你想要的是状态 Z,如果你将此视为个人失败,那么你将度过漫长的学期。另一方面,如果我能够说服你,让你相信你现在学到了关于代码 X 的一些以前不知道的东西,那么你就不太可能感到无助。如果你不感到无助,尝试不同的方法就会容易得多,最终(在经历了状态 P、D、Q 和 aleph-1 之后)达到状态 Z。"

  • divorcing (分离)
  • code that fails (失败的代码)
  • feeling of failure (失败的感觉)
  • lesson (教训)
  • personally (个人地)
  • easier (小心的)
  • long semester (漫长的学期)
  • learned something (学到了一些东西)
  • feel helpless (感到无助)
  • try something different (尝试不同的方法)
  • eventually (最终)
  • visiting states (经历状态)
  • getting to Z (达到状态 Z)

Once you've learned how to do controlled failures and divorce programming failure from the emotion of failure, programming starts to become pretty enjoyable and your learning rate goes up by an order of magnitude.

中文翻译

"一旦你学会了如何进行可控的失败,并将编程失败与情绪分离开来,编程就会变得非常有乐趣,你的学习速度将提高一个数量级。"

  • controlled failures (可控的失败)
  • divorce programming failure (将编程失败分离开来)
  • emotion of failure (失败的情绪)
  • programming (编程)
  • enjoyable (有乐趣的)
  • learning rate (学习速度)
  • an order of magnitude (一个数量级)
编辑
2023-09-23
cpp
00
c
#include <stdio.h> #include <stdlib.h> #include <string.h>