开发中mock什么意思_开发中

开发中mock什么意思

You don’t develop code. Code develops you.

您不开发代码。 代码可以帮助您发展。

During a recent lecture via Zoom in the Flatiron School software program, I attempted to crack-wise on the chat as my fellow students and I often do. I can’t exactly remember what prompted me, but I wrote:

在最近通过Flatiron School软件程序中的Zoom进行的一次演讲中,我试图像我的同学和我一样经常在聊天中进行细化。 我不记得是什么提示了我,但我写道:

“You don’t develop code. Code develops you.”

“您不开发代码。 代码可以培养您。”

Although I was trying to make a joke, this stuck with me. I believe it’s true, if you’re serious about learning how to code (well).

尽管我想开个玩笑,但这种想法一直困扰着我。 我相信这是真的,如果您认真学习如何编码(很好)。

What do I mean by “code develops you”? A few things come to mind, but the overarching truth about code development for me is:

“代码使您成长”是什么意思? 我想到了一些事情,但是对我来说,关于代码开发的首要真理是:

“A computer is literally as dumb as a rock. It literally needs to be told how to do EACH. AND. EVERY. LITTLE. THING.”

“一台计算机实际上就像一块石头一样愚蠢。 从字面上需要告诉每个人如何做。 和。 每个。 小。 事情。”

Because computers are dumb, it’s often necessary for you to break down a problem and its solution into smaller, simpler pieces to ensure your code will do what you want need. You also quickly learn how tedious, frustrating, aggravating, exasperating and humbling this process can be. Turns out, instructing a rock how to manipulate the DOM and persist changes in the back end can easily drive a person insane. I know. Trust.

由于计算机很笨,因此通常需要将问题及其解决方案分解为更小,更简单的部分,以确保您的代码能够满足您的需要。 您还可以快速了解该过程的繁琐,令人沮丧,加重,生气和挫败。 事实证明,指导某人如何操纵DOM并在后端保持持久的更改很容易使人发疯。 我知道。 相信。

In order to avoid going insane, I’ve had to develop myself in several key areas, many of which overlap and relate to each other:

为了避免发疯,我不得不在几个关键领域发展自己 ,其中许多领域相互重叠并相互联系:

Discipline (aka “Code like everyone one is watching?”)Unless you’re disciplined in structuring your application and writing your code, before you know it you’ll have thousands of lines in a jumble of files with comments few and far between. If you’re lucky enough to somehow get it working, fixing the inevitable bug will likely have you cursing yourself in the wee hours too many times. Let’s hope you’ll never need to add to or modify its functionality, or need to explain how it works to the poor soul tasked with maintaining it.

纪律处分(又名“每个人都在看代码吗?”)除非您受过结构化应用程序和编写代码的训练,否则在您不知不觉中,您会在成堆的文件中成千上万行,注释之间几乎没有距离。 如果您很幸运能够以某种方式使其正常工作,则修复不可避免的错误可能会使您在凌晨时分诅咒自己太多次。 我们希望您永远不需要添加或修改其功能,也不需要向负责维护它的可怜人解释它的工作原理。

Thoroughness (aka “Meet my nemesis: The Infamous Corner Case”)Just when you think the code demo is going flawlessly, in walks nobody’s friend, Corner Case (it’s telling that it’s also know as pathological case). Either due to your laziness, a bad assumption or an incomplete grasp of reality, one of these nasty buggers WILL decide to make its presence known, as it often does, AT THE WORST POSSIBLE TIME.

彻底性(又名“遇见我的敌人:臭名昭著的极端案例”)就在您认为代码演示正在顺利进行时,没有人知道它的朋友Corner Case (它也被称为病理案例 ) 。 由于您的懒惰,错误的假设或对现实的不完全掌握,这些令人讨厌的窃听者之一决定在最坏的可能时像通常那样使它的存在众所周知。

Clarity (aka The What, The How and sometimes, The Why)You need to be clear about the problem being solved and how to solve it (and sometimes, why to solve it), hopefully before you type your first line of code. If not, the risk is great that you’ll soon find yourself wondering: “What the f*ck is this function supposed to be doing? How the f*ck is it supposed to work? Why the f*ck am I up at 3AM?”

清晰度(又名“什么,什么,如何以及有时,为什么” ),希望在键入第一行代码之前就要解决的问题以及如何解决(有时,为什么要解决)的问题保持清楚。 如果不是这样,则冒着很大的风险,您很快就会发现自己在想: “此功能应该执行的功能是什么? f * ck应该如何工作? 我为什么要在凌晨3点起床?”

Efficiency (aka “Nobody’s got time for that”)One of the main selling points of these dumb rocks is that they can do stuff quickly, the same way every time, for a bazillion times in a row. Therefore, if we can save one step each loop, we will have saved ourselves and the dumb rock a bazillion steps. “A bazillion here, a bazillion there, and pretty soon you’re talking about real gigaflops.”

效率(又称“没有人有时间”)这些笨蛋的主要卖点之一是它们可以连续以每次相同的方式快速完成工作,连续进行数十亿次。 因此,如果每个循环都可以节省一步,那么我们将节省自己和笨拙的岩石的步伐。 “这里有一个亿万富翁,那里有一个亿万富翁,不久之后,您将谈论真正的千兆级软硬件。”

Perspective (aka “There’s got to be a better way”)Unlike loading a dishwasher, there are often several “right” ways to perform a task. Developing the ability and discipline to examine a problem from several angles will often lead to a better solution. The key is to explore your options before you charge ahead down a dead end path. (Yeah, I know, I usually do charge ahead, get stuck, curse, try to untangle the mess, cry, eat ice cream, delete everything, repeat…)

透视图(又称“必须有更好的方法”)与装入洗碗机不同,执行任务通常有几种“正确”的方法。 发展从多个角度检查问题的能力和纪律通常会导致更好的解决方案。 关键是您走入死胡同之前,先探索您的选择。 (是的,我知道,我通常会提前充电,卡住,诅咒,解开混乱,哭泣,吃冰淇淋,删除所有内容,重复…)

Pattern-recognition (aka “Have we met before?”)People have been telling dumb rocks how to do things for millenia, so it’s rare that a solution to your problem hasn’t already been told to a million dumb rocks long ago. The only things that have changed is that our dumb rocks are typically smaller, faster, cheaper and are powered by electrons rather than steam or some animal. So the ability to recognize a problem and a tried-and-true solution is valuable in that you’re not reinventing an inferior, bug-filled wheel, and therefore can spend more time sleeping, eating right and taking the occasional shower.

模式识别(又称“我们以前见过吗?”)人们一直在告诉哑石千禧世代如何做事情,因此很早以前就没有告诉过您解决问题的方法。 唯一改变的是,我们的笨蛋通常更小,更快,更便宜,并且由电子而非蒸汽或某些动物提供动力。 因此,识别问题和经过实践检验的解决方案的能力非常有价值,因为您无需重新发明劣质的,装满虫子的轮子,因此可以花更多时间睡觉,正确饮食和偶尔洗个澡。

Analogies and MetaphorsRelated to perspective and pattern-recognition, analogies and metaphors help me to visualize a problem and possible solutions using familiar everyday objects and situations. A recent favorite analogy is how a callback function is like a self-addressed, stamped envelope. The recipient of the envelope can be as dumb as a rock and the sender of the envelope will likely have returned what it needs (assuming the USPS is still functioning).

类比和隐喻与透视和模式识别相关,类比和隐喻帮助我使用熟悉的日常对象和情况来可视化问题和可能的解决方案。 最近最喜欢的一个类比是回调函数如何像一个自寻址的,带有标记的信封。 信封的接收者可能像石头一样傻,信封的发送者很可能已经退回了所需的东西( 假设USPS仍在运行 )。

K.I.S.S. (Keep It Simple, Stupid)Computers are dumb as rocks. The more complex your code, the more likely it will be that errors will creep in as you try to explain a complex operation to a dumb rock. Did I mention that computers are literally as dumb as rocks?

KISS(保持简单,愚蠢)计算机愚蠢如磐石。 您的代码越复杂,当您尝试向笨拙的对象解释复杂的操作时,错误就越有可能蔓延。 我是否提到计算机字面上像石头一样愚蠢?

The Perfect vs. The Functional (aka “If it ain’t broke…”)I don’t know about you, but sometimes when I notice a small thing that’s just not right, I’d like to ignore it… BUT IT’S NOT PERFECT. Most times, making it “perfect” doesn’t come back to bite me in the ass, but when it does, it’s typically AT THE WORST POSSIBLE TIME.

完美与功能性(又名“如果还没有破裂……”)我不了解您,但是有时当我发现一件不对劲的小事时我想忽略它…… 但并非如此完善。 在大多数情况下,使它“完美”并不会使我陷入困境,但是当它恢复正常时,通常是在最糟糕的时候。

Reduce, Reuse, Recycle (aka “Laziness is a virtue”)Related to pattern-recognition, it’s best not to attempt to create a “better” mousetrap. The mousetrap has been around so long that the design has been optimized, debugged and improved by legions of better and more experienced mousetrap developers and “tested” on untold numbers and species of mice. It’s unlikely that you’ll be able to create a better one. My ego has tempted me to “roll my own” many times, but I don’t believe I’ve ever recreated a better version of anything. Best to spend your time on the bits and pieces that you can’t get off the shelf, as well as showering and sleeping, eating right and exploring the world.

减少,重复使用,回收(又称“懒惰是一种美德”)模式识别相关,最好不要尝试创建“更好的”捕鼠器。 捕鼠器已经存在了很长时间,以至于许多更好和更有经验的捕鼠器开发人员对设计进行了优化,调试和改进,并对无数数量和种类的小鼠进行了“测试”。 您不太可能创造出更好的产品。 我的自我吸引了我很多次“自己动手” ,但我不相信我曾经重新创造过任何更好的版本。 最好将时间花在无法下架的零碎物品上,并为淋浴和睡眠,正确饮食和探索世界打下基础。

And, lastly: “You’re always in development, if you’re doing it right.”

最后,“如果您做对了,那么您就一直在开发中。”

翻译自: https://medium.com/swlh/in-development-6c6727d9f4be

开发中mock什么意思

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值