惠勒延迟选择实验

tech2023-02-20  88

惠勒延迟选择实验

In this episode of the Versioning Show, Tim and David are joined by Ken Wheeler, a Formidable JavaScript programmer well known for open-source projects like Slick Carousel. They discuss the ups and downs of creating and maintaining open-source software, balancing open-source and commercial work, the challenges of fatherhood, and making rap music.

在Versioning Show的这一集中,Tim和David与Ken Wheeler一同加入,Ken Wheeler是一个强大JavaScript程序员,以开源项目(如Slick Carousel)而闻名。 他们讨论了创建和维护开源软件,平衡开源和商业工作,父亲身份的挑战以及说唱音乐制作的起伏。

Visit the Versioning Show Home Page

访问版本控制显示主页

Subscribe on iTunes | Subscribe on Stitcher | View All Episodes

在iTunes上订阅 | 订阅Stitcher | 查看所有剧集

显示笔记 (Show Notes)

Ken on Twitter

肯在推特上

Ken on GitHub

Ken在GitHub上

Formidable

强大

Ken on SoundCloud

Ken在SoundCloud上

Slick Carousel

圆滑的旋转木马

Flux

助焊剂

React Native

React本机

Electrode

电极

ESLint

ESLint

Walmart lint configs

沃尔玛皮棉配置

Builder

建造者

Redux

Redux

Dan Abramov

丹·阿布拉莫夫

Gatsby

盖茨比

Spectacle

眼镜

React-blessed

有React的

ngrok

恩格罗克

scotch.io

苏格兰人

More Twitter links: @mdavidgreen | @tevko | @versioningshow | @sitepointdotcom

更多Twitter链接: @mdavidgreen | @tevko | @versioningshow | @sitepointdotcom

对话重点 (Conversation Highlights)

One thing worth mentioning is, keep the APIs small … a lot of people are going to come at you with requests for options, different options and capabilities and things like that, based upon edge cases. And then catering to each one isn’t going to do anything good. If you catered to every single edge case, if you add every single option that’s proposed in the interest of being a cool guy who is doing it, no. Because what’s going to happen is now you have this big, bloated library of different Band-Aids for different edge cases, and you’ve gotten away from the original vision of something that is just this small rock-solid set of APIs for the 90% use case. Don’t let that happen to your project — please!

值得一提的是, 使API保持较小 ……根据边缘情况,很多人会要求您提供选项,不同的选项和功能以及类似的要求。 然后,迎合每个人将无济于事。 如果您要迎合每一个极端情况,那么如果添加每个建议的选项都是为了成为一个很酷的人,那就没有。 因为现在要发生的事情是,您现在拥有一个庞大的,Band肿的库,其中包含针对不同情况的不同创可贴,而且您已经摆脱了最初的设想,而这仅仅是针对90年代这种小巧而坚固的API集用例百分比。 不要让这种情况发生在您的项目中-请!



See this TV behind me right here? There’s a Raspberry Pi hooked up to that. I suffer from open-source guilt. I have deep, deep open-source guilt, so I want to do a better job of being a maintainer. So I decided that I wanted to have it in my face all day long, every issue of anything like that. So I have the Raspberry Pi there.

在这里看到我身后的电视吗? 有一个Raspberry Pi与之相关。 我患有开源罪恶感。 我有深深的开源内deep感,因此我想做一个更好的维护者。 因此,我决定我希望整天都在我的脸上露面,每一本类似的东西。 所以我在那里有Raspberry Pi。



Don’t just pull repos down … where there’s thousands of people depending on it. That is not a subtweet to any particular thing; I’m just saying!

不要只是将回购协议拉下来……那里有成千上万的人依赖它。 那不是对任何特定事物的推文; 我只是说!

成绩单 (Transcript)

Tim: 蒂姆:

Hey, what’s up, everybody, this is Tim Evko …

嘿,大家好,我是Tim Evko……

David: 大卫:

… and this is M. David Green. And you’re listening to episode seven of the Versioning Show. This is a place where we get together to discuss the industry of the web from development to design — with some of the people making it happen today and planning where it’s headed in the next version.

…这是David Green先生。 您正在听Versioning Show的第七集。 在这里,我们可以聚在一起讨论从开发到设计的网络行业,其中一些人将其付诸实践,并计划下一版的发展方向。

Tim: 蒂姆:

Today we have with us a special guest, Ken Wheeler. We’re going to talk about how Ken got started in the industry, we’re going to talk a little bit about reactive programming, it’s going to be a great show, so let’s go ahead and get this version started.

今天,我们有一位特别的客人,肯·惠勒。 我们将谈论Ken的行业起步方式,我们将讨论React式编程,这将是一个很棒的节目,所以让我们继续以该版本开始。

David: 大卫:

Ken, thanks for joining us. How are you doing today?

肯,谢谢您加入我们。 今天过得好吗?

Ken: 肯:

I’m doing lovely. Thanks for having me.

我好可爱 感谢您的款待。

David: 大卫:

Cool. Tim, would you like to ask Ken our philosophical question?

凉。 蒂姆,你想问肯恩我们的哲学问题吗?

Tim: 蒂姆:

Yes, it’s about that time. So, Ken, we have a philosophical question we like to ask every guest who comes up on the show. So here goes: in your current career, what version are you and why?

是的,大约是那个时候。 因此,肯,我们有一个哲学问题,我们想问问参加演出的每位客人。 所以这就是:在您当前的职业中,您是哪个版本,为什么?

Ken: 肯:

O wow, you’re going to drop something that heavy on me this early?

哇,您打算在今天这么早就丢下一些沉重的东西吗?

Tim: 蒂姆:

We always get this response too — it’s great! [Laughs]

我们也总是得到这个回应-太好了! [笑]

Ken: 肯:

I haven’t done so well with semantic versioning in the past. Well, I’d like to say that I’m like 0.19-alpha perhaps — or at least I’d like to think that.

过去,我在语义版本控制方面做得还不够好。 好吧,我想说的是也许我喜欢0.19-alpha,或者至少我想这样。

David: 大卫:

It’s nice that you’re keeping it in the alpha range. That’s important.

很高兴您将其保持在alpha范围内。 那很重要

Ken: 肯:

That’s right. It’s not quite beta yet. It’s still a little rough around the edges. Not ready for a 1.0.

那就对了。 还不是beta版。 边缘仍然有些粗糙。 尚未准备好1.0。

Tim: 蒂姆:

Cool, so this is the stage you are at in your career. How did you get to this stage? What brought you into the world of what we’re doing?

很酷,所以这是您职业生涯中的阶段。 您是如何进入这个阶段的? 是什么使您进入了我们正在做的世界?

Ken: 肯:

I did it a lot as a child. When I was a little kid, I learned to type really quickly. Most of the computer classes were typing at that point in time. Me, already being a proficient typer, having the privilege to have a computer in the home, I was kind of excused from the typing portion of the computer classes. I got to mess around with other things like QBasic or Visual Basic.

我小时候做的很多。 小时候,我学会了快速打字。 当时大多数计算机类都在输入。 我已经是一名熟练的打字员,有幸在家中拥有一台计算机,所以我对计算机类的打字部分感到宽恕。 我不得不弄乱诸如QBasic或Visual Basic之类的其他东西。

And it fascinated me, so I would play with that. I had a really good time doing it — did a lot of Visual Basic as a kid — and then I stopped programming. Wait, before I stopped programming, I also did a lot of early HTML — like remember, what is it? Like GeoCities and all that jazz, the 3D wireframe spinning skills and blood dripping banners and all that fun stuff.

它让我着迷,所以我会去玩。 我玩得很开心–小时候做过很多Visual Basic –然后我停止了编程。 等等,在我停止编程之前,我还做了很多早期HTML-就像记住的,这是什么? 像GeoCities和所有爵士乐一样,3D线框旋转技巧,滴血横幅和所有有趣的东西。

David: 大卫:

We will see if we can find an archived copy of your GeoCities page to put up with the podcast. [Editor’s note: we couldn’t find anything, but let us know if you have any luck finding something!]

我们将查看是否可以找到您的GeoCities页面的存档副本以与播客放在一起。 [编者注:我们找不到任何东西,但是让我们知道您是否有幸找到一些东西!]

Ken: 肯:

I sure hope you don’t! But yeah, it was a good time. I stopped programming for a little while, and I became a rapper — more so a record producer than a rapper. I really enjoyed music (had from a young age). I eventually got pretty good at rapping and making the background music to rap songs, to the point where I was a signed artist. I worked as a recording engineer for some pretty interesting artists and what not.

我当然希望你不要! 但是,是的,这是个好时机。 我停止编程了一段时间,成为了一名说唱歌手,比说唱歌手更像是唱片制作人。 我真的很喜欢音乐(从小开始)。 最终,我非常擅长说唱和制作背景音乐来说唱歌曲,以至于我是一名签约歌手。 我曾担任过一些非常有趣的艺术家的录音工程师,而实际上不是。

Napster came out, and that stopped being a career for me. I had a couple of funny careers after that. Maybe “career” is not the right word. Maybe funny jobs in the interstitial period. I was a matchmaker — a high-end matchmaker at that. It’s not like sports — like relationship matchmaking for wealthy folks.

Napster出来了,那对我来说不再是一个职业。 在那之后,我有几个有趣的职业。 也许“职业”不是正确的词。 在插页广告期间,也许是有趣的工作。 我是媒人-那时候是高端媒人。 这不像运动,而是富人的婚介。

And I was a stockbroker, which was probably even more hilarious. All kinds of jobs — a butcher’s assistant, pizza delivery, the list goes on, absurd occupations. At one point, I realized that I know how to do computers, and I like it, I enjoy it, so why not pursue that a little.

我是个股票经纪人,这可能更有趣。 各种各样的工作-屠夫的助手,披萨送货,清单还在继续,荒唐的职业。 有一次,我意识到自己会做电脑,而且我喜欢它,我很喜欢它,所以为什么不那么做呢。

So I remember the first job that I got, I lied my way into. We were writing Flash — it was like a Flash shop at the time. I don’t know if you guys remember that back in the day, but it was like a full Flash shop. We’d make websites for restaurants and local companies with the super fancy intro, and sweet photo galleries, writing ActionScript, ActionScript 2, later ActionScript 3, keeping it ECMA the entire time.

所以我记得我获得的第一份工作,我撒谎了。 我们正在编写Flash-当时就像一家Flash商店。 我不知道你们是否还记得这一天,但是那就像一家完整的Flash商店。 我们会为餐厅和本地公司提供网站,并提供超豪华的介绍和精美的照片画廊,并编写ActionScript,ActionScript 2和后来的ActionScript 3,并始终将其保留为ECMA。

David: 大卫:

Of course.

当然。

Ken: 肯:

But yeah, I told them I knew how to do that, and at the time I did not know how to do that, but I was confident that in a short time I would be able to do that. Lo and behold, I was able to do that, so I did that for a little while. I was a Flash developer, and then the iPhone came out. When the iPhone came out, they kind of murdered Flash. Saw the writing on the wall, and got back into the whole HTML/CSS/JavaScript thing, where I guess jQuery is just starting to get like sort of popular. And I kind of took it from there for about maybe like a year or two, writing the kind of stuff that we do today. Not necessarily the stuff we do today, but not Flash.

但是,是的,我告诉他们我知道如何做到这一点,当时我还不知道如何做到这一点,但是我有信心在短时间内就能做到这一点。 瞧,我能够做到,所以我做了一段时间。 我是Flash开发人员,然后iPhone问世了。 当iPhone出来时,他们有点杀了Flash。 在墙上看到了文字,然后又回到了整个HTML / CSS / JavaScript的领域,我猜想jQuery在这方面正开始流行起来。 我从那里拿了大概一两年的时间,写出了我们今天所做的事情。 不一定是我们今天要做的事情,但不是Flash。

David [4:26]: 大卫[4:26] :

This is interesting, because I notice a couple of trends that I’ve seen in other engineers. First of all, it sounds like you don’t have like an engineering degree. Is this something that you pretty much learned from teaching it yourself?

这很有趣,因为我注意到在其他工程师中看到的一些趋势。 首先,听起来您没有工程学位。 这是您从自己教书中学到的东西吗?

Ken: 肯:

Absolutely. That’s how I’ve done almost everything that I’ve been necessarily good at, music included. It works for some people, it doesn’t work for other people. I’m an autodidact, so I do very poorly when attempting to be instructed by other people, but teaching myself works out pretty well.

绝对。 这就是我几乎一直擅长的所有事情的完成方式,包括音乐。 它适用于某些人,不适用于其他人。 我是一个自欺欺人的人,所以在尝试别人的指导时我做得很差,但是自学效果很好。

David: 大卫:

There’s also a trend that I’ve noticed: a lot of people who do this also have musical backgrounds.

我也注意到了一种趋势:许多这样做的人也都有音乐背景。

Ken: 肯:

Is that right?

那正确吗?

David: 大卫:

Yeah, it seems like there is a relationship between like comfort with music and a comfort with engineering, with programming.

是的,似乎对音乐的舒适与对工程和编程的舒适之间存在某种关系。

Tim: 蒂姆:

Yeah, I have a similar sort of origin story where I first started working at a recording studio and then building websites for the recording studio and yeah, same sort of … Well, I didn’t rap, or produce anything, but I wasn’t that cool …

是的,我有一个类似的起源故事,我首先开始在唱片公司工作,然后为唱片公司建立网站,是的,嗯……我没有说唱,也没有制作任何东西,但我不是。太酷了……

Ken: 肯:

I’m sure you could have.

我敢肯定你会的。

Tim: 蒂姆:

Yeah, maybe I’ll lay down a couple of tracks later as outro music.

是的,也许以后我会放一些音乐作为离群音乐。

Ken: 肯:

We could do it collab.

我们可以合作。

Tim: 蒂姆:

That would be so good. We could use like Web Audio API or stuff. It’s very complicated sounding, but I’m down.

那太好了。 我们可以使用Web Audio API之类的东西。 这听起来很复杂,但是我很沮丧。

Ken: 肯:

East Coast?

东海岸?

Tim: 蒂姆:

Yeah, you’re in Jersey, I’m in Queens — it’s perfect.

是的,您在泽西岛,我在皇后区-太完美了。

Ken: 肯:

I feel like the East Coast needs a little rapping these days, my man.

我觉得这些天东海岸需要一点敲打声。

Tim: 蒂姆:

They do. So, Ken, cool projects you’ve been working on recently. Do you want to talk about some of the recent programming paradigms, challenges, cool projects, anything like that?

他们是这样。 因此,Ken,您最近正在从事的很棒的项目。 您是否想谈谈最近的一些编程范例,挑战,很棒的项目等等?

Ken: 肯:

I would say that a lot of this React work that I’m doing at Walmart is super interesting, because it’s like a new thing, but it’s also at scale — at humongous scale; so that’s been pretty interesting.

我要说的是,我在沃尔玛所做的许多React工作都非常有趣,因为它就像新事物一样,但是规模也很大-规模巨大; 所以这很有趣。

Other things are having popular open-source projects. I wrote Slick Carousel, and actually writing it was not effortless, but it wasn’t super hard. It’s dealing with it after the fact, which has been interesting. It’s very interesting to try and maintain these sort of things — and that applies to all open source. I have a lot of libraries out there that I don’t maintain as well as I probably should. It’s super interesting to see the process of something getting popular and then the different projects, how some have certain issues that other ones don’t. Something like Slick Carousel is like a low hanging fruit: who doesn’t need a carousel, right?

其他事情有受欢迎的开源项目。 我写了《 Slick Carousel》 ,实际上写起来并不费力,但并不是很难。 这是事实之后的处理,这很有趣。 尝试维护这类事情非常有趣-这适用于所有开源。 我那里有很多我不应该维护的库。 看到事物流行的过程,然后看到不同的项目,其中某些事物有某些其他事物所没有的某些问题,这真是非常有趣。 像Slick Carousel这样的东西就像是低垂的水果:谁不需要旋转木马,对吗?

Almost every website that you are building for somebody else for money, they’re going to need some kind of slider on there. But you have other things like Flux libraries and things like that. It’s a little … I’m not going to say “exclusive”, but it’s a smaller audience; it’s a more focused audience, so you have different kind of problems. You have people coming to you with, “I’m not like super-hot on JavaScript. How does this work?” It’s more like, “I am super-hot on JavaScript. We need to optimize this”, or something like that.

您为别人建立的几乎每个网站都是为了赚钱,他们那里将需要某种滑块。 但是您还有其他类似Flux库之类的东西。 有点……我不会说“排他”,但听众较少。 受众群体更加集中,因此您遇到了各种各样的问题。 有人来找您,“我不喜欢JavaScript。 这是如何运作的?” 更像是,“我对JavaScript 非常热。 我们需要优化它”或类似的东西。

Dealing with all of that in the open-source space has been pretty interesting. One of the absolutely most interesting things that I’ve been doing lately is React Native, which is crazy. You’re writing real, native applications in JavaScript, which is absolutely crazy to me.

在开源领域中处理所有这些非常有趣。 我最近一直在做的绝对最有趣的事情之一是React Native ,这很疯狂。 您正在用JavaScript编写真实的本机应用程序,这对我来说绝对是疯狂的。

David: 大卫:

I’ve heard a little bit about React Native, and I’m curious: what kind of challenges are you facing when you try to develop in React Native?

我听说过一些有关React Native的信息,我很好奇:当您尝试在React Native中进行开发时,您将面临什么样的挑战?

Ken [7:30]: 肯[7:30] :

Well, you have a couple of different benefits there of using it. First of all you get cross-platform, so you write at once, generally speaking, and you get the same experience on Android and iOS — from a single code base. If you’re really nifty, you can even share some of the Redux from the web with that application if they are similar enough. Next up, you get cool things like you can hop the Play code, so you can kind of sidestep the App Store submission process (which has actually gotten a little bit better lately).

好吧,使用它有许多不同的好处。 首先,您获得了跨平台的支持,因此,通常来讲,您一次编写代码,并且从一个代码库就可以在Android和iOS上获得相同的体验。 如果您真的很聪明,甚至可以在网上与该应用程序共享一些Redux,只要它们足够相似。 接下来,您将获得一些很酷的功能,例如可以跳到Play代码,因此可以避开App Store的提交过程(最近实际上有所改善)。

One thing that I see at scale, which is pretty cool, is if you have like a bunch of engineers that are familiar with JavaScript, or familiar with React, suddenly your entire JavaScript team can work on your mobile apps. And again, that’s generally speaking.

我看到的一件很酷的事情是,如果您像一群熟悉JavaScript或React的工程师一样,突然间您的整个JavaScript团队都可以在您的移动应用程序上工作。 再说一遍,通常来说。

I’m doing React Native at Walmart, and it’s remarkably non-trivial. There is a lot of stuff going on on the native side that is pretty complicated. So it’s not like just anybody from the JavaScript side can come over and mess with it.

我在沃尔玛(Walmart)做React Native,这显然很简单。 本机方面有很多事情很复杂。 因此,这并不是说JavaScript方面的任何人都可以过来惹它。

React Native isn’t a replacement for certain things. It just doesn’t make sense for certain things. Essentially, if you were to have a native application, and you found a place where you would use a WebView (this is for like hybrid applications, right?). If you had a place in that where you would use a web view — like a Cordova sort of thing — but you wanted it to feel native, React Native is an excellent candidate for that.

React Native不能替代某些东西。 只是对于某些事情没有意义。 本质上,如果要使用本机应用程序,并且找到了使用WebView的位置(这类似于混合应用程序,对吗?)。 如果您有一个可以使用Web视图的地方(例如Cordova之类的东西),但是您希望它看起来很自然,那么React Native就是一个很好的选择。

Tim: 蒂姆:

What is it about React Native that makes it feel more native than say a PhoneGap/Cordova sort of situation?

React Native有什么用,它比PhoneGap / Cordova这样的情况更使人感到本地化?

Ken: 肯:

It literally is native. What happens is, how exactly it works — maybe not exactly, but how I personally understand it to work after working with it and reading up on it in detail — is that you have your JavaScript, which is interpreted on one thread, and then you have native code that takes that interpreted JavaScript and builds native views with that. You’re essentially telling your native program how to lay out and act with JavaScript — but it’s not in the browser or WebView. You’re not running JavaScript in the context of a browser. You’re not rendering to HTML. At no point in time is HTML ever used. What you’re doing is specifying types, like view and text and things like that, and those are representative of (if you are in iOS) things like UI views, UI text, any of these controls. What makes it even cooler is, there’s probably the best bridging system that I’ve ever seen, so your developer experience is amazing.

它实际上是本地的。 发生的事情是,它是如何工作的(也许不完全是,但是我个人理解它在使用并详细阅读之后如何工作)是您拥有了在一个线程上解释JavaScript,然后您具有使用解释后JavaScript并以此构建本机视图的本机代码。 您实际上是在告诉本地程序如何布局并使用JavaScript进行操作-但它不在浏览器或WebView中。 您没有在浏览器的上下文中运行JavaScript。 您没有渲染为HTML。 任何时候都不会使用HTML。 您正在执行的操作是指定类型,例如view和text以及诸如此类的东西,这些代表(如果您在iOS中)诸如UI视图,UI文本以及任何这些控件的代表。 使它更酷的是,可能是我见过的最好的桥接系统,因此您的开发人员体验令人赞叹。

Almost anything you can imagine on the native side you can bridge over to JavaScript very easily. I had a situation where I needed to use geocoding. So you take a string, and you want to get a lat-long from that string: that’s in iOS.

在本机方面,您几乎可以想象的任何内容都可以非常轻松地过渡到JavaScript。 我遇到需要使用地理编码的情况。 因此,您选择了一个字符串,并希望从该字符串中获取经度纬度: 这是在iOS中 。

So, you can bridge that to your JavaScript application. You can make an async call out to the geocoder — or the geocoder class that you have set up in a native module class with a callback; it’s bridged. You can make a call to it, and it’ll send back to you lat-long coordinates.

因此,您可以将其桥接到JavaScript应用程序。 您可以对Geocoder进行异步调用,也可以对在本地模块类中设置的带有回调的Geocoder类进行异步调用; 它被桥接。 您可以打电话给它,它会发回纬度坐标。

That’s just one example of the sort of things you could do. Not only can you bridge modules like that, where you can write an Objective-C class, where you do anything under the sun: you can also expose and render views. Any view that you can imagine — any control, so to say — you can hook it up, bridge it, and then represent that in a tag with props (which are essentially HTML attributes) and then wire those up to control it.

那只是您可以做的事情的一个例子。 您不仅可以桥接这样的模块,还可以在其中编写一个Objective-C类,在阳光下进行任何操作:还可以显示和渲染视图。 您可以想象的任何视图-可以说是任何控件-您可以将其连接,桥接,然后在带有props(本质上为HTML属性)的标签中表示出来,然后将其连接起来以控制它。

David: 大卫:

That’s really great. I’m curious if the challenges that you’re facing at Walmart have to do more with dealing with the native aspect of it, or dealing with the scale of what you are trying to accomplish.

真的很棒 我很好奇,如果您在沃尔玛面临的挑战更多地是要处理它的本机方面,或者要处理您要完成的任务的规模。

Ken: 肯:

A lot of it is balance, to be honest. They do some pretty nontrivial things over there on the native side. There is a lot of brilliant mobile engineers, who have some really cool base stuff set up.

老实说,很多都是平衡。 他们在本机那边做一些非常重要的事情。 有很多出色的移动工程师,他们设置了一些非常酷的基础知识。

For me, being a JavaScript guy coming in over there, I want to play as nice as possible. [Laughs] So a lot of it’s balance. I want to use as much native as I can, while still remaining flexible on the JavaScript side.

对我来说,作为一名JavaScript专家过来,我想玩得尽可能好。 [笑]这很重要。 我想尽可能多地使用本机,同时在JavaScript方面仍然保持灵活性。

Scale — of course, that’s difficult, but a lot of that is not only user scale (a lot of that is really services more so than UI). We’re not getting any kind of UI concurrency with the users or anything like that; that’s more of a service problem. But I guess the scale would be developer scale, organizational scale, which we do have to mitigate.

规模-当然,这很困难,但是很多不仅是用户规模(其中很多实际上是服务,而不是用户界面)。 我们没有获得与用户的任何类型的UI并发性; 那更多是服务问题。 但是我想规模应该是开发人员规模, 组织规模,我们必须减轻这些规模。

So internally at Walmart, we have a platform called Electrode, where we have a ton of common elements and common components — what have you — that everybody can pick from and that are maintained as a whole.

因此,在沃尔玛内部,我们有一个名为Electrode的平台,在这里,我们有大量的公共元素和公共组件(您拥有什么),每个人都可以从中选择并进行整体维护。

So, rather than each individual app going into doing their own thing, we have a centralized collection of components and Redux helpers and things like that, that are maintained organizationally. The idea being that if you have three different teams working on three different apps, and they have the same text box component, rather than doing their own thing, they’re going to go and use that one text box component. And then, if one of those teams finds that the text box component isn’t as flexible as they need it to be, they PR it and it gets better. And that process propagates, until you have rock solid, really good components. Because these components are added to, pull requested, tested thoroughly, better reviewed, you can be sure when using them that you’re going to have something more stable than had you just gone and done it on your own.

因此,我们没有每个应用程序都去做自己的事情,而是集中收集了组件和Redux帮助器以及诸如此类的东西,这些东西在组织上得到了维护。 这个想法是,如果您有三个不同的团队在三个不同的应用程序上工作,并且他们具有相同的文本框组件,而不是自己做,他们将使用该文本框组件。 然后,如果其中一个团队发现文本框组件不像他们所需要的那样灵活,他们会对其进行PR改进,它将变得更好。 直到您拥有坚如磐石的,非常好的组件为止,这个过程一直在传播。 由于这些组件已添加,拉出请求,进行了全面测试,得到了更好的审查,因此可以确定,使用它们时,您将比刚完成时要稳定一些。

Tim [13:04]: 提姆[13:04] :

That’s pretty cool. It’s almost like Walmart has its own sort of internal open-source environment to kind of keep track of all of those. Are there any lessons that you can take from how Walmart does its sort of open-source-like work and kind of translate that into the actual, much wider open-source community?

太酷了。 就像沃尔玛拥有自己的内部开源环境一样,它可以跟踪所有这些环境。 从沃尔玛如何开展类似开源的工作并将其转化为实际的,更广泛的开源社区的过程中,您可以从中学到什么吗?

Ken: 肯:

Absolutely. We have an ESLint config. I work for Formidable; through them, then, I work for Walmart. We use the Walmart lint configs, all the process there. We also have a tool called Builder, which we use to manage several repos. If you have that Walmart-like situation where you have a ton of repos, we use Builder to essentially have the same build processes — everything like that — across all those, and be able to update that across all those.

绝对。 我们有一个ESLint配置。 我为艰巨而工作; 通过他们,我为沃尔玛工作。 我们使用Walmart lint configs进行所有过程。 我们还有一个名为Builder的工具,可用于管理多个存储库。 如果您遇到类似沃尔玛的情况,并且您有大量的回购,我们将使用Builder在所有这些基础上本质上具有相同的构建过程-诸如此类的所有过程,并能够在所有这些基础上进行更新。

So, if you had a Webpack configuration — you had like ten repos — and then you changed something in one of them with Webpack, you’d then have to go into each one and update your Webpack config in every single one of those to get the new way that you’re doing that build. So we have tooling around things like that, where we have this shared build system and testing and things like that — where we can make one change in one place, and then it will propagate across, what, 90 repos or something?

因此,如果您有一个Webpack配置(您有10个存储库),然后使用Webpack在其中一个中进行了更改,则必须进入每个配置并在每个配置中更新Webpack配置才能获得您进行构建的新方式。 因此,我们具有围绕诸如此类的工具,拥有共享的构建系统和测试以及诸如此类的工具-在这里我们可以在一个地方进行一次更改,然后它会传播到90个存储库之类的东西上?

David: 大卫:

Wow. That’s a great example of how that sort of thing can apply, because when you’re dealing with open source, you’ve got all of these different people working on different things simultaneously, and trying to keep track of all of that can be insane. How do you balance your open-source work with the work that you’re doing inside of companies?

哇。 这是如何应用这类事情的一个很好的例子,因为当您使用开放源代码时,所有这些不同的人同时从事不同的工作,并且试图跟踪所有这些可能是疯狂的。 您如何在开源工作与公司内部工作之间取得平衡?

Ken: 肯:

Well, it’s actually funny, because Formidable, the company that I work for, we bill ourselves as an open-source company that does contract work to keep the lights on. It’s not like I go do my day job and then do open-source work. A lot of my day job is open-source work. We have officially sanctioned open source that I’m given time to work on in the 9 to 5 that I’m here.

好吧,这实际上很有趣,因为我所工作的公司Formidable使得我们将自己称为一家开源公司,它从事合同工作以保持正常运转。 这不像我先去做日常工作,然后再去做开源工作。 我的很多日常工作是开源工作。 我们已经正式批准了开放源代码,我有时间在这里进行9到5的工作。

When I wrote Slick Carousel, that was not the case. I was working at a great company but was in an open-source–driven sort of thing. I would do my open source at night and come back and do client work throughout the day — a lot of the time getting my client work done a lot better by doing my open source at night, or tools that would allow me to work quicker, faster, better, what have you.

当我写《 Slick Carousel》时,情况并非如此。 我当时在一家很棒的公司工作,但是从事的是开源驱动的事情。 我会在晚上做开放源代码,然后整天回去做客户工作–很多时候,晚上做开源可以使我的客户工作做得更好,或者可以让我更快地工作的工具,更快,更好,你有什么。

Now, at Formidable, open source is encouraged. We’re given time to work on it, and we have a ton of open source that we work on. As far as my personal open source, my personal open source is suffering at the moment. There is only one reason for that, and that’s fatherhood. I’d come home, my wife would put on The Bachelor or something like that (and who wants to watch that?), so I hang out and work at my open source, tap away the keys. If she had a big day in the morning, she’d go to bed at 10:00, I’d stay up until 1:00 in the morning playing with computers.

现在,在《强大》中,鼓励开源。 我们有足够的时间来处理它,并且我们有大量的开放源代码正在研究。 就我的个人开源而言,我的个人开源目前正在遭受痛苦。 这样做的理由只有一个,那就是父亲身份。 我要回家,我的妻子会穿上单身汉之类的衣服(谁想看那个?),所以我出去玩,在开放源代码上工作,敲开按键。 如果她早上过得很开心,她会在10:00上床睡觉,我会一直熬到凌晨1:00才玩电脑。

That’s not the case anymore. Now, the time that I am working with, I’m either getting my dad on, I’m completely exhausted and/or drinking. There’s not as much time as I wish there were to do my personal open source, but I make it work.

现在已经不是了。 现在,在我工作的时候,我要么让父亲上床,要么就筋疲力尽和/或饮酒。 我没有那么多的时间来做我的个人开源程序,但是我使它工作了。

I try to manage it a little more, whereas previously, whatever I was interested in I would just work on. Now I’m trying to say, “Okay, well, this needs to happen on this and this needs to happen on this.” I’m getting a lot of these new hot thumbs-up things on GitHub — the “reactions”, or whatever they call those. I’m like, “Ah, well, you got to take care of that one.”

我尝试对其进行更多管理,而以前,无论我对什么感兴趣,都可以继续工作。 现在我想说:“好吧,这需要在此发生,而这需要在此发生。” 在GitHub上,我收到了很多这些新的热门建议-“React”,或他们所谓的“React”。 我想,“嗯,你得照顾那个。”

So I’ve been trying to not just cut releases, but delegate the work a little bit more. Some of these libraries are pretty popular, and there’s a lot of people depending on them. If somebody comes to me and they say like, “I have this thing that needs to be done by this time”, I’ll try and prioritize it for them. Or if somebody at some company is like, “We need this feature”, I’ll try and prioritize that for them. It’s interesting to try and manage.

所以我一直在尝试不仅削减发行版,而且还多委托一些工作。 其中一些库非常受欢迎,并且有很多人依赖于它们。 如果有人来找我,并且他们说:“到现在为止,我已经完成了这件事”,我将尝试为他们确定优先级。 或者,如果某家公司的某人喜欢“我们需要此功能”,我将尝试为他们确定优先级。 尝试和管理很有趣。

You’re writing code for free, but you are still somehow indebted with it — but it’s not free, right? I told my wife I got some absurd amount of hits on the page, the documentation page for Slick, and she’s like, “What if you charge for it?”

您正在免费编写代码,但是您仍然欠债-但这不是免费的,对吧? 我告诉我的妻子,我的页面(Slick的文档页面)上的点击量很荒唐,她想:“如果您为此付费,该怎么办?”

I’m like, “If I charge for it, someone will use the different one that’s free.” It’s not like you don’t get anything from it. You get an enormous amount from open source. While you might not be getting like paid directly, the fact that you’ve written certain open source opens the doors to different things career-wise. It’s like you’re not technically being compensated, but it’s good. I build cool things, other people build cool things, it all works out because now we have all these cool things.

我想,“如果我为此付费,那么有人会使用免费的另一种。” 并不是说您从中什么都没有得到。 您可以从开源中获得大量收益。 尽管您可能不会直接获得报酬,但是您已经编写了某些开源程序这一事实为您在职业上走向其他事物打开了大门。 就像您在技术上没有得到补偿一样,但这很好。 我创造了很酷的东西,其他人也创造了很酷的东西,这一切都可以实现,因为现在我们拥有了所有这些很酷的东西。

Tim [17:11]: 蒂姆[17:11] :

Yeah, that’s very true. Speaking more to the health, or at least the mental health, and organization of open-source maintainers, do you have any tips for people who are looking to get started with contributing to open source? If someone for example has what they think will be a really good idea but might be worried about the long-term burden of maintaining something like that?

是的,这是真的。 对于开源维护者的健康,或者至少是心理健康,以及组织,您有什么秘诀供那些希望开始为开源做出贡献的人们使用? 例如,如果有人认为这是一个很好的主意,但可能会担心维护此类东西的长期负担?

Ken: 肯:

A lot of people that I see commenting about it, or talking about it, it’s almost that they’re scared — they’re uneasy about doing it. They don’t know if their code’s going to be good enough. All I’ve got to say to that is just put it out there. I still don’t think my code is good enough, and it probably never will be. You know what I mean? It’s just like put it out there, and if something’s that bad, somebody will say something about it.

我看到很多人对此发表评论或谈论,几乎让他们感到害怕 -他们对此感到不安。 他们不知道他们的代码是否足够好。 我要说的就是把它放在那里。 我仍然认为我的代码不够好,可能永远也不会。 你知道我的意思? 这就像把它摆在那里,如果事情是坏 ,有人会说一些事情。

But if they’re saying something about it, it’s an opportunity to improve it. I did some things with Slick Carousel early on, or I did some things [on] other libraries. When people call me out on that, I’d be like, “Wow, I never actually knew that. I never knew that that was like a perf thing. Thank you so much.” They are like, “This is like a cross-site scripting vulnerability or something like that?” I was like, “Wow, I had no idea that was possible like that.” It’s just a learning thing.

但是,如果他们对此发表意见,这是一个改进它的机会。 我很早就使用Slick Carousel做过一些事情,或者是在其他库上做过一些事情。 当人们大声疾呼我时,我会想:“哇,我从来不知道。 我从来不知道那是一件好事。 非常感谢。” 他们就像,“这就像跨站点脚本漏洞一样?” 我当时想,“哇,我不知道那样有可能。” 这只是一个学习的东西。

It’s like any time anybody calls you on something, don’t feel dumb. You can feel dumb, I feel dumb all the time, but don’t take it personally. If they’re worried about the long-term maintenance, who cares? You don’t owe these people anything. You’re putting something out there for free, taking time out of your day to support it, and that should be good enough. If people are depending on it, if people are really depending on it, I think delegating and making sure that it’s reasonably up to date is a good thing. Don’t just pull repos down and shit, where there’s thousands of people depending on it. That is not a subtweet to any particular thing; I’m just saying!

就像任何时候有人打电话给你,不要感到愚蠢。 您可能会觉得很蠢,我一直都觉得很蠢,但是请不要个人对待。 如果他们担心长期维护,谁在乎? 您不欠这些人任何东西。 您免费提供一些东西,花点时间支持它,那应该足够了。 如果人们依赖它,如果人们真的依赖它,我认为委派并确保它合理地更新是一件好事。 不要只是将回购协议拉下来然后拉屎,那里有成千上万的人依靠它。 那不是对任何特定事物的推文; 我只是说!

But I would just tell people don’t worry about it. Just build stuff and put it out there. I wish I could not worry about it a little bit more, personally. I’m actually a little uneasy to build any new things or put them out there, not just because of time, but because I know that I can’t maintain them. It’s like having a child that I know I can’t take care of.

但我只是告诉人们不要担心。 只需制造东西,然后放到那里。 我希望我自己可以不用再为此担心了。 实际上,构建任何新事物或将它们放在那里有点不自在,这不仅是因为时间的缘故,还因为我知道我无法维护它们。 就像有一个我知道我无法照顾的孩子。

I know that I’m not going to be able to like dedicate this full-time issue. It’s not the writing the code. I can fix the bugs, no problem, that’s not even a big deal. It’s the issue management. That’s the biggest thing. Having to sit here and argue with people.

我知道我不会喜欢专门讨论这个全日制期刊。 这不是编写代码。 我可以修复这些错误,没问题,这没什么大不了的。 这是问题管理。 那是最大的事情。 必须坐在这里与人争论。

One thing worth mentioning is, keep the APIs small. If there’s one thing that I’ve run into, very personally, is that a lot of people are going to come at you with requests for options, different options and capabilities and things like that, based upon edge cases. And then catering to each one isn’t going to do anything good. If you catered to every single edge case, if you add every single option that’s proposed in the interest of being a cool guy who is doing it, no. Because what’s going to happen is now you have this big, bloated library of different Band-Aids for different edge cases, and you’ve gotten away from the original vision of something that is just this small rock-solid set of APIs for the 90% use case. Don’t let that happen to your project — please!

值得一提的是, 使API保持较小 。 如果我个人碰到过一件事,那么很多人都会根据特殊情况要求您提供选项,不同的选项和功能以及类似的要求。 然后,迎合每个人将无济于事。 如果您要迎合每一个极端情况,那么如果添加每个建议的选项都是为了成为一个很酷的人,那就没有。 因为现在要发生的事情是,您现在拥有一个庞大的,Band肿的库,其中包含针对不同情况的不同创可贴,而且您已经摆脱了最初的想法,而这仅仅是用于90年代的这些小巧而扎实的API集用例百分比。 不要让这种情况发生在您的项目中-请!

Tim [20:12]: 蒂姆[20:12] :

Yeah, I have to say that some of the best advice that I’ve gotten — and realized myself when releasing some of the limited, very low-starred libraries that I have in open source — is just keeping it small, but also with the ability to extend for those who need to. I think I’m mostly in favor of releasing small, single-purpose APIs where the documentation is good enough so someone can just fork it themselves. And then it’s, “O, let me add this thing.” Maybe their version will get more recognition than mine, but it definitely keeps the maintenance burden so much lower.

是的,我不得不说,我所获得的一些最佳建议(在发布一些我在开源中拥有的​​有限的,低星数的库时意识到了自己)只是在保持小巧的同时,还与为需要扩展的能力。 我认为我主要是支持发布小型的,单一用途的API,这些API的文档足够好,因此有人可以自己编写。 然后是,“哦,让我添加这个东西。” 也许它们的版本会比我的版本得到更多的认可,但是绝对可以使维护负担降低很多。

Ken: 肯:

It’s good not just to close off the scope, but to give an escape hatch for people to iterate upon. I think an amazing example of that is Redux. Shout out to my man Dan Abramov.

不仅要关闭范围,而且要让人们可以反复使用,这是一个好习惯。 我认为Redux是一个很好的例子。 向我的男人丹•阿布拉莫夫大喊 。

Redux is remarkably small. It’s a very small library that does a very small thing. But it is gives you the escape hatch of middleware. Now an entire ecosystem has sprung up around it, where all those edge cases that people needed for all the different projects are now individually managed by those people and other people who have those edge cases in separate projects via middleware.

Redux非常小。 这是一个很小的库,只做很小的事情。 但这给了您避免中间件的麻烦。 现在整个生态系统如雨后春笋般冒出来,所有这些不同项目所需要的边缘案例现在都由那些人和其他通过中间件在单独项目中拥有这些边缘案例的人们分别进行管理。

There’s Redux middleware for everything nowadays. It’s something an action comes through and it makes you a taco. I think that’s a really great way to go about that. He really struck gold with that API design, because there you go, there’s your escape hatch. You can iterate on that for perpetuity with middleware.

如今,Redux中间件可满足所有需求 。 这是动作的结果,它使您成为炸玉米饼。 我认为这是实现这一目标的绝佳方法。 他的API设计确实给人留下了深刻的印象,因为您走了,那里就有逃生门。 您可以使用中间件对其进行永久访问。

Tim: 蒂姆:

So Ken, what do you say to people — and I guess sometimes I’m a part of this camp (you and I go back and forth every now and then). But what do you say to people who say, “I’m just working on a project that’s x size. Why do I need to do something like React or Redux for my project?”

肯,你对人们怎么说?我想有时候我是这个阵营的一部分(你和我时常来回走动)。 但是您对那些说“我正在从事一个x大小的项目的人”说的话。 为什么我需要为我的项目做类似React或Redux的事情?”

Ken: 肯:

It depends on your project. It’s hard to say though, right? Like I can sit here and say I wouldn’t use React for a static site, but actually I would, because of Gatsby. I wouldn’t write a presentation. Of course I wrote Spectacle, I write presentations in React. For React itself — that’s not a good one — but I think it certainly speeds things up, but it’s highly independent upon your needs.

这取决于您的项目。 不过,很难说,对吧? 就像我可以坐在这里说,我不会将React用于静态站点,但实际上我会因为Gatsby而使用 。 我不会写演讲。 当然,我写了Spectacle ,我在React中写了演示文稿。 对于React本身-这不是一个好选择-但我认为它确实可以加快速度,但是它完全独立于您的需求。

If you’re writing an application, I think it can really help you. I think if you’re writing just like a local deli web page, you probably don’t need React or Redux. Most of the time you don’t even need Redux. I have developed React Native games without Redux. Redux is the sort of thing that you cross that bridge when you get to it.

如果您正在编写应用程序,那么我认为它确实可以为您提供帮助。 我认为,如果您像本地熟食店网页一样编写内容,则可能不需要React或Redux。 大多数时候,您甚至不需要Redux。 我已经开发了没有Redux的React Native游戏。 Redux是您到达桥梁时要跨越的东西。

David: 大卫:

I can see that. React is versatile enough you can use it for tiny little components, or for the entire application.

我理解了。 React具有足够的通用性,您可以将其用于很小的组件或整个应用程序。

Ken: 肯:

There’s projects where I guess you can have React almost act like Web Components, where it’ll mount them into little pieces of a regular web page. If you just want like a React widget, or if you want a full-scale application, you render the whole page in React. Which is generally speaking what I do. Or if you’re a maniac, you render an entire native app with it. Or, if you’re even crazier, you use React-blessed and use React to render to your CLI blessed terminals, where you have CLI dashboards that are written in React.

在某些项目中,我想您可以使React几乎像Web组件一样工作,它将这些组件安装到常规网页的小块中。 如果您只想要一个React小部件,或者想要一个完整的应用程序,则可以在React中渲染整个页面。 一般来说,这是我的工作。 或者,如果您是疯子,则可以使用它渲染整个本机应用程序。 或者,如果您甚至更疯狂 ,则可以使用React-blessed并使用React将渲染到CLI的终端渲染到CLI终端,在那里您可以使用React编写CLI仪表板。

Tim: 蒂姆:

I think my brain is melting now.

我想我的大脑现在正在融化。

Ken: 肯:

Have you seen that?

你看到了吗?

Tim: 蒂姆:

No, I have not.

不我没有。

Ken: 肯:

O man, I got to show you. It’s pretty chill. I’ve set up GitHub webhook. See this TV behind me right here?

哦,我要告诉你。 很冷 我已经设置了GitHub webhook。 在这里看到我身后的电视吗?

Tim: 蒂姆:

Yeah.

是的

Ken: 肯:

There’s a Raspberry Pi hooked up to that.

有一个Raspberry Pi与之相关。

Tim: 蒂姆:

Of course.

当然。

Ken: 肯:

I suffer from open-source guilt. I have deep, deep open-source guilt, so I want to do a better job of being a maintainer. So I decided that I wanted to have it in my face all day long, every issue of anything like that. So I have the Raspberry Pi there. I didn’t get it actually completely finished, but what I had was I set up ngrok on the Raspberry Pi to expose it externally, and then set up a GitHub webhook, and then an Express server on the Raspberry Pi, so that every time something happened on GitHub, it would send it to the Raspberry Pi. The Express server would take it and then it would render a terminal output using Blessed, to give me a cool hacker review of how shitty I am on maintaining open source. But if you haven’t seen Blessed, it’s really cool.

我患有开源罪恶感。 我有深深的开源内deep感,因此我想做一个更好的维护者。 因此,我决定我希望整天都在我的脸上露面,每一本类似的东西。 所以我在那里有Raspberry Pi。 我实际上并没有完全完成它,但是我所要做的是我在Raspberry Pi上设置了ngrok使其在外部公开,然后设置了GitHub webhook,然后在Raspberry Pi上设置了Express服务器,以便每次GitHub上发生了一些事情,它将发送到Raspberry Pi。 Express服务器将其接收,然后将使用Blessed呈现终端输出,这使我很酷地回顾了黑客对保持开源的劣质态度。 但是,如果您还没有看过Blessed,那真的很酷。

Tim [24:28]: 蒂姆[24:28] :

That sounds amazing, and extremely unhealthy, and I’m worried about your sanity now.

这听起来很神奇,而且非常不健康,我现在担心您的理智。

[Laughter]

[笑声]

Ken: 肯:

No, I’m fine, I’m good.

不,我很好,我很好。

David: 大卫:

O come on Tim, who doesn’t have Raspberry Pi hooked up to their television set? Please!

哦,Tim,谁没有把Raspberry Pi连接到他们的电视机上? 请!

Tim: 蒂姆:

I know, that’s ridiculous.

我知道,这太荒谬了。

Ken: 肯:

Throw the first stone, right?

扔第一块石头吧?

David: 大卫:

Listen, Ken, how can people find you online?

听着,肯,人们如何在网上找到你?

Ken: 肯:

O wow — bodybuilding.com forums.

哇-bodybuilding.com论坛。

[Laughter]

[笑声]

Evko gets that one.

Evko得到了那个。

So, you can find me at github.com/kenwheeler. You can find me on twitter.com/ken_wheeler. You can go to formidable.com to see where I’m at over there. You can go to soundcloud.com/thekenwheeler if you want to hear some super-fresh stuff. I don’t know, you could Facebook friend me. I think I have privacy settings with friends of friends, but we should all become friends.

因此,您可以在github.com/kenwheeler上找到我。 您可以在twitter.com/ken_wheeler上找到我。 您可以访问formidable.com来查看我在那儿的位置。 如果您想听一些新鲜的东西,可以去soundcloud.com/thekenwheeler 。 我不知道,您可以让Facebook成为我的朋友。 我认为我与朋友的朋友有隐私设置,但我们都应该成为朋友。

David: 大卫:

We should all become friends, absolutely, and we will be putting links to those in the show notes. I just want to thank you. This has been a really great interview. Thank you for joining us today.

我们绝对应该成为朋友,我们将在展示笔记中建立链接。 我只想谢谢你。 这真是一次很棒的采访。 感谢您今天加入我们。

Ken: 肯:

Thank you so much for having me.

非常感谢您有我。

[Musical interlude]

[音乐插曲]

David: 大卫:

So it sounds like you knew Ken from before this.

听起来您从此之前就认识Ken。

Tim: 蒂姆:

Yes, actually. Ken and I became internet friends, because we both wrote articles for a website called scotch.io. It’s funny, because it didn’t surface very much here, but Ken and I actually wildly differ in opinions on frameworks, or very popular libraries. One of the big reasons for that actually is because Ken works on giant, hugely-scaled projects like Walmart and the stuff that he does in Formidable Labs. I work on a lot sort of smaller, less-having-to-worry-about-global-state-everywhere types of projects. But every once in a while him and I will go round for round on Twitter, talking about why we code one way versus another way. It’s always a sight to see if you ever witness it.

是的,实际上。 肯和我成为互联网朋友,因为我们俩都为一个名为scotch.io的网站撰写了文章。 这很有趣,因为在这里并没有太多涉及,但是Ken和我实际上对框架或非常流行的库的观点有很大的不同。 造成这种情况的主要原因之一,是因为Ken在沃尔玛(Walmart)以及他在Formidable Labs中从事的大型项目中从事大型项目。 我从事许多较小的,对全球状态无处不在的担心的项目类型。 但是偶尔我和他都会和我在Twitter上走来走去,谈论为什么我们用一种方式编码而另一种方式编码。 总是可以看到您是否亲眼目睹。

David: 大卫:

It’s interesting. I’ll have to look for those. I was impressed with how strongly he felt about his positions on these things, and I thought he brought very good arguments for why he’d come to the conclusions that he did about the different approaches that he has.

这真有趣。 我将不得不寻找那些。 他对他在这些事情上的立场有多强烈的印象给我留下了深刻的印象,我认为他提出了很好的论据,说明了为什么他会对他采用的不同方法得出结论。

Tim: 蒂姆:

Yeah, definitely, and it’s something that earlier on in my career I was — I think as we all are — very heavily opinionated towards a certain methodology or coding a certain way. But the more I experienced things like, “We have 15 or we have 50 developers on our team”, we need to standardize things. We need specific methods. We can’t walk into a project and code everything from scratch now, because there are much more concerns. There’s much larger scale, there’s much more code to push. Yeah, I can definitely see pretty much all of the reasons that he takes the approaches that he does on certain projects.

是的,肯定的,这是我职业生涯的早期(我认为,我们所有人)对某一种方法论或某种方式非常自以为是。 但是我经历的经验越多,例如“我们的团队中有15名开发人员,或者我们有50名开发人员”,我们就需要标准化这些东西。 我们需要特定的方法。 现在,我们不能从头开始进行任何项目的编写和编写所有代码,因为还有更多的关注点。 规模更大,需要推送的代码也更多。 是的,我绝对可以看到他采用某些项目所采用的方法的几乎所有原因。

David: 大卫:

It sounds like he came to these conclusions pretty organically — in particular, the way he was talking about the importance of small APIs on these open-source projects. I thought that was a really fascinating point.

听起来他似乎有机地得出了这些结论,尤其是他在谈论小型API在这些开源项目中的重要性的方式。 我认为那是一个非常有趣的观点。

Tim: 蒂姆:

Yeah, I gave a lightning talk at a meetup one time about that. I basically just open-sourced this really, really small, it wasn’t anything magnificent. It was just a small API that allowed you to work with cookies easier, because, as you know, document.cookie is just string manipulation. There’s really no function there. So I just kind of abstracted that into an object with some methods and made it a little bit easier. It was maybe like 50 lines of code, and there was obvious potential for other functionality.

是的,我一次在聚会上做了一次闪电演讲。 我基本上只是开源了这个很小的东西,没有什么了不起的。 它只是一个小API,使您可以更轻松地使用Cookie,因为众所周知, document.cookie只是字符串操作。 那里真的没有功能。 因此,我只是使用一些方法将其抽象为一个对象,并使其变得更加简单。 大概是50行代码,其他功能显然也有潜力。

For example, you could have, what if we save some of the cookie manipulation in local storage, or add some new methods here, or give the user a way to add secure cookies? I intentionally left that out, and I wrote down in the repository in the README, “Don’t submit new functionality.” … I said “please”. I said, “Please don’t submit any functionality to this. Rather, fork it and do what you need to, or submit a pull request that makes my crappy code better than it is, but leave the functionality to itself.”

例如,如果我们将一些cookie操作保存在本地存储中,或者在此处添加一些新方法,或者为用户提供一种添加安全cookie的方式,您将拥有什么呢? 我故意忽略了这一点,然后在自述文件的存储库中写下“不要提交新功能”。 ……我说“请”。 我说:“请不要为此提供任何功能。 而是分叉它并执行您需要做的事情,或者提交一个拉取请求,使我糟糕的代码变得更好,但是将功能留给自己。”

What I really want to do when I write open-source code is I want to encourage the user to learn more. I don’t want to write code that someone is going to use and implement without giving a second thought as to how it works. And that’s typically why I try to avoid abstractions as much as possible, and tend to move more towards not necessarily doing things from scratch every time, but coding in such a way that you are very, very, intimately familiar with how your application works.

What I really want to do when I write open-source code is I want to encourage the user to learn more. I don't want to write code that someone is going to use and implement without giving a second thought as to how it works. And that's typically why I try to avoid abstractions as much as possible, and tend to move more towards not necessarily doing things from scratch every time, but coding in such a way that you are very, very, intimately familiar with how your application works.

David [29:15]: David [29:15] :

I can see that, and the importance of having people learn something from the code that you’re writing. I think when you look at how quickly just the JavaScript landscape alone moves — how much is changing, how many new frameworks there are, how many paradigms are coming out — that people are saying, “This is now obviously the right way to do things, and you can’t do things that way anymore.”

I can see that, and the importance of having people learn something from the code that you're writing. I think when you look at how quickly just the JavaScript landscape alone moves — how much is changing, how many new frameworks there are, how many paradigms are coming out — that people are saying, “This is now obviously the right way to do things, and you can't do things that way anymore.”

But things change so very quickly. One of the things that Ken was talking about was this fear that people have of releasing things to open source, because of their own sense of intimidation about their expertise and how skilled they are.

But things change so very quickly. One of the things that Ken was talking about was this fear that people have of releasing things to open source, because of their own sense of intimidation about their expertise and how skilled they are.

But it’s really important, when you’re thinking about whether or not you want to release something to the open-source community, to remember that you’re at the stage that you are with the specific things that you’ve been exposed to, and somebody else is out there at that same stage but with completely different set of concepts that they’ve been exposed to. Each one of you can learn from each other, from the mistakes that you’re making as well as from the things that you’ve learned and that you want to share.

But it's really important, when you're thinking about whether or not you want to release something to the open-source community, to remember that you're at the stage that you are with the specific things that you've been exposed to, and somebody else is out there at that same stage but with completely different set of concepts that they've been exposed to. Each one of you can learn from each other, from the mistakes that you're making as well as from the things that you've learned and that you want to share.

Tim: 蒂姆:

Yeah, that was a lesson that I learned very quickly on my first major open-source project — which actually didn’t end too long ago, when we worked on WordPress Core to get responsive images into WordPress Core. I wrote version 0.01 of that plug-in, that eventually made its way into WordPress. There is maybe — I’m not exaggerating here — maybe one line of my original code made it to the actual final iteration. I was okay with that, and in fact more than happy, because what came out of it was this amazing thing that I could never have built on my own, because WordPress is just this enormous code base. I slowly learned that, OK, it’s not a bad thing to put something out there that’s terrible, because it’s going to get a conversation started. People will join on. People came out of nowhere.

Yeah, that was a lesson that I learned very quickly on my first major open-source project — which actually didn't end too long ago, when we worked on WordPress Core to get responsive images into WordPress Core. I wrote version 0.01 of that plug-in, that eventually made its way into WordPress. There is maybe — I'm not exaggerating here — maybe one line of my original code made it to the actual final iteration. I was okay with that, and in fact more than happy, because what came out of it was this amazing thing that I could never have built on my own, because WordPress is just this enormous code base. I slowly learned that, OK, it's not a bad thing to put something out there that's terrible, because it's going to get a conversation started. People will join on. People came out of nowhere.

Joe McGill, who basically saw this thing to the finish line, I’d never met him before. But one day he saw, “O, this thing is happening on WordPress”, and within a month or two he was a core contributor deleting all my bad code and writing in these new great things. At the end of the day, when this project was finished, we were all WordPress Core contributors. I learned right then and there not to be super worried about the thing that I’m pushing out, because the thing that I’m open-sourcing to the world, it’s as much a learning experience for me as it is a benefit maybe to somebody else. If it’s good, great, somebody else will use it, maybe I’ll get to talk about it one day. If it’s bad, I’m going to learn so much more.

Joe McGill, who basically saw this thing to the finish line, I'd never met him before. But one day he saw, “O, this thing is happening on WordPress”, and within a month or two he was a core contributor deleting all my bad code and writing in these new great things. At the end of the day, when this project was finished, we were all WordPress Core contributors. I learned right then and there not to be super worried about the thing that I'm pushing out, because the thing that I'm open-sourcing to the world, it's as much a learning experience for me as it is a benefit maybe to somebody else. If it's good, great, somebody else will use it, maybe I'll get to talk about it one day. If it's bad, I'm going to learn so much more.

David [31:50]: David [31:50] :

This is just as true in closed-source environments as it is in open-source environments. I’ve worked in so many companies where the projects that I’ve worked on, it’s been a team of people. And at the end of the day, one person might have been actively involved in coding constantly, and not a single line of code might have been included in the final project, but that participation and the involvement, the learning that went on, the different perspectives that come into play — it’s not like you can define a team by, “You wrote seven lines of code, so you get this much”, and “You wrote 12 lines of code, so you get that much.” It’s like an old joke in programming. You don’t pay people by the lines of code that they end up getting published. You have to focus on the learning and the value that’s being added by the collaboration of the team as a whole.

This is just as true in closed-source environments as it is in open-source environments. I've worked in so many companies where the projects that I've worked on, it's been a team of people. And at the end of the day, one person might have been actively involved in coding constantly, and not a single line of code might have been included in the final project, but that participation and the involvement, the learning that went on, the different perspectives that come into play — it's not like you can define a team by, “You wrote seven lines of code, so you get this much”, and “You wrote 12 lines of code, so you get that much.” It's like an old joke in programming. You don't pay people by the lines of code that they end up getting published. You have to focus on the learning and the value that's being added by the collaboration of the team as a whole.

Tim: 蒂姆:

I’ve learned probably the most that I have in my career through open source.

I've learned probably the most that I have in my career through open source.

David: 大卫:

Yeah, and the fact that there are so many people out there willing to share their knowledge and share their interest in these things is remarkable. When people started talking about it originally, it was like “People are going program for free? Nobody is going to do that.”

Yeah, and the fact that there are so many people out there willing to share their knowledge and share their interest in these things is remarkable. When people started talking about it originally, it was like “People are going program for free? Nobody is going to do that.”

Oh yeah? People are going to do that, and people are going to learn from it, and they’re going to benefit from it, and society as a whole is going to benefit from it.

哦耶? People are going to do that, and people are going to learn from it, and they're going to benefit from it, and society as a whole is going to benefit from it.

Tim: 蒂姆:

Yeah, definitely, and that’s one of the things that I love about open source. I feel like sometimes people can see it as, “It’s slave labor, it’s like you’re doing this stuff for free. Why would you ever do that? You are just sending your secrets out into the world for everybody to see.”

Yeah, definitely, and that's one of the things that I love about open source. I feel like sometimes people can see it as, “It's slave labor, it's like you're doing this stuff for free. Why would you ever do that? You are just sending your secrets out into the world for everybody to see.”

And I was at that point one time when I first got into coding. I was like, “Why would you show everybody what you’re doing? Why not keep it to yourself?” And then I realized that it’s very counterintuitive to most other industries that exist, but the more you put things out there, the more you teach each other, the more you personally benefit from it. That’s something I love about this industry.

And I was at that point one time when I first got into coding. I was like, “Why would you show everybody what you're doing? Why not keep it to yourself?” And then I realized that it's very counterintuitive to most other industries that exist, but the more you put things out there, the more you teach each other, the more you personally benefit from it. That's something I love about this industry.

David: 大卫:

Another thing that’s remarkable about it is you should only be so lucky as to have somebody copy what you are doing and try to riff on it and move forward with it. The thing you learn when you start putting things out into the open source is just how compelling your idea has to be before somebody will join in and start participating with you. It’s not like we have to hide your ideas in a safe under your bed in order to protect them. No, if you put your ideas out there, you’ll find out whether or not they have any value by whether or not people start using them.

Another thing that's remarkable about it is you should only be so lucky as to have somebody copy what you are doing and try to riff on it and move forward with it. The thing you learn when you start putting things out into the open source is just how compelling your idea has to be before somebody will join in and start participating with you. It's not like we have to hide your ideas in a safe under your bed in order to protect them. No, if you put your ideas out there, you'll find out whether or not they have any value by whether or not people start using them.

Tim: 蒂姆:

Yeah, I couldn’t say that better myself. And I’ve run that time and time and time again. Code that I’m absolutely terrified of putting out there, I’ll put out there, and then sometimes to my relief, it’s like “Nobody saw this, it’s been done a million times before, cool, that’s that.”

Yeah, I couldn't say that better myself. And I've run that time and time and time again. Code that I'm absolutely terrified of putting out there, I'll put out there, and then sometimes to my relief, it's like “Nobody saw this, it's been done a million times before, cool, that's that.”

Then at other times, I’ll release something, and some people will see it, and that’s great. One of the things that I really like that Ken was super, super honest about maintaining open-source projects. That is something I hear a lot from people who work on these projects that just balloon in popularity.

Then at other times, I'll release something, and some people will see it, and that's great. One of the things that I really like that Ken was super, super honest about maintaining open-source projects. That is something I hear a lot from people who work on these projects that just balloon in popularity.

People use them all the time, and then it becomes a sort of looming overhead stress that you have to keep up with maintaining this thing. People can become dads people, get married people, just go other places in their lives. And it’s [been] talked about before, but I think it’s something we have a responsibility to talk about. People in open source need that sort of mental health. Open source shouldn’t be a thing that people have to worry about intensely about maintaining and get stressed out over. I think as a community we should really be doing our best not just to thank but to help open-source maintainers wherever we can, because, hey, we’re all using their stuff.

People use them all the time, and then it becomes a sort of looming overhead stress that you have to keep up with maintaining this thing. People can become dads people, get married people, just go other places in their lives. And it's [been] talked about before, but I think it's something we have a responsibility to talk about. People in open source need that sort of mental health. Open source shouldn't be a thing that people have to worry about intensely about maintaining and get stressed out over. I think as a community we should really be doing our best not just to thank but to help open-source maintainers wherever we can, because, hey, we're all using their stuff.

David: 大卫:

I’ve actually heard it discussed as an issue about diversity, and marginalized communities in the programmer world who, may not have the flexibility or the privilege to be able to spend time working on open source. They get squeezed out of the job opportunities, because jobs are being offered only to people who have a large open-source resume.

I've actually heard it discussed as an issue about diversity, and marginalized communities in the programmer world who, may not have the flexibility or the privilege to be able to spend time working on open source. They get squeezed out of the job opportunities, because jobs are being offered only to people who have a large open-source resume.

Tim: 蒂姆:

Yeah, what would you say we do to help that issue?

Yeah, what would you say we do to help that issue?

David [36:00]: David [36:00] :

It’s a tough one, because on the one hand, an open-source resume is a great way to judge somebody’s programming skills — certainly much more effective than these whiteboard interviews. On the other hand, there are people who just do not have the resources — who might not be as fortunate or as resourceful as Ken to have found a job at a company where working in the open source is also part of his professional career, and part of what he’s getting paid for. It’s a very difficult challenge.

It's a tough one, because on the one hand, an open-source resume is a great way to judge somebody's programming skills — certainly much more effective than these whiteboard interviews. On the other hand, there are people who just do not have the resources — who might not be as fortunate or as resourceful as Ken to have found a job at a company where working in the open source is also part of his professional career, and part of what he's getting paid for. It's a very difficult challenge.

Tim: 蒂姆:

Yeah, I think about that often in terms of, I catch myself a lot looking at candidates and asking myself, “Well, I can’t find something on their GitHub profile. I can’t find a GitHub profile for them, or a CodePen,” or whatever, so I don’t think this person is a great programmer. I have to catch myself, and then I remember not everybody has the privilege to just go home and fool around on GitHub for an hour. Some people have to have dinner for their entire families, or maybe even work an extra job so they can make ends meet. I would say something that I know personally that I can do better is to catch myself before I am judging somebody for their lack of a GitHub profile.

Yeah, I think about that often in terms of, I catch myself a lot looking at candidates and asking myself, “Well, I can't find something on their GitHub profile. I can't find a GitHub profile for them, or a CodePen,” or whatever, so I don't think this person is a great programmer. I have to catch myself, and then I remember not everybody has the privilege to just go home and fool around on GitHub for an hour. Some people have to have dinner for their entire families, or maybe even work an extra job so they can make ends meet. I would say something that I know personally that I can do better is to catch myself before I am judging somebody for their lack of a GitHub profile.

David: 大卫:

Absolutely, and it’s something that we might want to address on a future show — maybe bring in an expert who can talk to us a little bit more about that.

Absolutely, and it's something that we might want to address on a future show — maybe bring in an expert who can talk to us a little bit more about that.

Tim: 蒂姆:

I think we most definitely should do that. Yeah, that’s a great suggestion. I think one of our next episodes should be pretty much all about that.

I think we most definitely should do that. Yeah, that's a great suggestion. I think one of our next episodes should be pretty much all about that.

David: 大卫:

I think we can do that.

I think we can do that.



Well, thank you so much for listening, everybody. We always enjoy getting to talk technology with all of you.

好,非常感谢大家的倾听。 我们总是喜欢与大家交谈技术。

Tim: 蒂姆:

We would also like to thank SitePoint.com, and our producers, Adam Roberts and Ophelie Lechat. Please feel free to send us your comments on Twitter — @versioningshow — and give us a rating on iTunes to let us know how we’re doing.

我们还要感谢SitePoint.com以及我们的制片人Adam Roberts和Ophelie Lechat。 请随时在Twitter( @versioningshow)上向我们发送您的评论,并在iTunes上给我们评分 ,让我们知道我们的情况。

David: 大卫:

We’ll see you next time, and we hope you enjoyed this version.

下次见,我们希望您喜欢这个版本。

翻译自: https://www.sitepoint.com/versioning-show-episode-7-with-ken-wheeler/

惠勒延迟选择实验

最新回复(0)