WEBVTT

NOTE
This file was generated by Descript 

00:00:00.510 --> 00:00:03.360
CJ: In this episode, Colin
and I talk about cogen and

00:00:03.360 --> 00:00:04.980
how we use Cogen at Stripe.

00:00:05.250 --> 00:00:07.950
We'll also mention a
conference talk at Ruby Conf.

00:00:08.039 --> 00:00:12.090
That already happens, so if you're curious
and you wanna see that, head over to the

00:00:12.090 --> 00:00:13.530
description and we'll have a link for you.

00:00:14.010 --> 00:00:14.490
Enjoy the show.

00:00:22.003 --> 00:00:23.083
Colin: Welcome to Build and Learn.

00:00:23.083 --> 00:00:24.093
My name is Colin.

00:00:24.193 --> 00:00:28.543
CJ: And I'm cj, and we weren't gonna
record today, but we're suddenly both free

00:00:29.513 --> 00:00:29.933
Colin: Yep.

00:00:31.303 --> 00:00:33.853
CJ: Yeah, Twitter was gonna
have a developer conference

00:00:33.858 --> 00:00:36.193
called chirp, but it's canceled.

00:00:36.343 --> 00:00:37.813
The entire conference is canceled.

00:00:38.398 --> 00:00:39.238
Colin: It is canceled.

00:00:39.238 --> 00:00:42.688
Yeah, we, I think we talked about it a
few episodes ago where we were pretty

00:00:42.688 --> 00:00:48.988
excited to see, uh, Twitter getting back
to its developer roots, and they kind

00:00:48.988 --> 00:00:53.038
of burned to the developer community a
few times over the last decade or more.

00:00:53.038 --> 00:00:57.598
And this was looking like a good
sign that that would be different.

00:00:57.658 --> 00:01:01.228
So if you're listening to this
in 2023, you already know about

00:01:01.228 --> 00:01:05.098
all this, but obviously Elon
bought Twitter what, in October?

00:01:05.788 --> 00:01:09.773
, I wouldn't have wanted to necessarily
be at that conference working at Twitter

00:01:09.773 --> 00:01:12.233
and having to answer questions, right?

00:01:12.233 --> 00:01:15.053
Like, imagine being a dev advocate, right?

00:01:16.138 --> 00:01:18.803
and being asked all these questions
that you don't have answers to.

00:01:19.958 --> 00:01:20.288
CJ: Right.

00:01:20.318 --> 00:01:24.038
I don't think there are any more
develop, like all of the people.

00:01:24.968 --> 00:01:27.563
at Twitter who were on the
developer advocacy team  that

00:01:27.563 --> 00:01:28.314
I was interacting with.

00:01:28.369 --> 00:01:30.799
I don't know any of them
that are still there.

00:01:30.949 --> 00:01:35.839
Like, uh, half of them or more
were laid off in the first round.

00:01:36.229 --> 00:01:40.039
Some of them quit shortly after,
and I think the rest took the.

00:01:41.804 --> 00:01:44.714
Opportunity to bail when Elon was
like, Hey, if you don't want to be

00:01:44.714 --> 00:01:48.674
here and grind it out, then like,
you can, here's the door , and they

00:01:48.719 --> 00:01:50.969
Colin: Yeah, he sent everyone
that email of, do You Like Me?

00:01:50.969 --> 00:01:51.659
Yes or no?

00:01:51.779 --> 00:01:52.139
Right.

00:01:54.134 --> 00:01:54.434
CJ: yeah.

00:01:54.824 --> 00:01:55.994
Circle yes or no.

00:01:56.279 --> 00:01:59.249
Colin: uh, so, so chaotic, I think.

00:01:59.279 --> 00:01:59.489
Yeah.

00:01:59.489 --> 00:02:05.069
Chris Mesina tweeted that it was like
97% of the, I don't know if it's,

00:02:05.459 --> 00:02:08.309
he said platform, so I don't know
if that means developer platform

00:02:08.309 --> 00:02:10.649
and in like even the developers.

00:02:11.514 --> 00:02:16.104
of the platform, including the developer,
obviously team are just not there anymore.

00:02:16.104 --> 00:02:19.534
So that's gonna be interesting
to see where it goes.

00:02:20.324 --> 00:02:20.684
CJ: Yeah.

00:02:20.684 --> 00:02:27.534
There's also just a ton of people going
out in like flames of glory , you know,

00:02:27.534 --> 00:02:34.114
like just calling out Elon on Twitter
for showing bad charts or using bad

00:02:34.114 --> 00:02:39.269
metrics or,  saying like, oh, I think
he said something like, oh, the A the

00:02:39.269 --> 00:02:42.599
app is slow in certain countries because
it's doing thousands of RPC calls.

00:02:42.659 --> 00:02:44.219
And then someone was like, not true.

00:02:44.219 --> 00:02:48.869
I've been working on this for like six
years and , you know, blah, blah, blah.

00:02:48.929 --> 00:02:51.449
And then, you know, five seconds
later that person's fired.

00:02:51.939 --> 00:02:55.149
Just today I was watching some tos
where people were like counting

00:02:55.149 --> 00:02:56.679
down until they got locked out.

00:02:56.739 --> 00:03:01.689
And then, you know, they had champagne
ready to go  when they got locked

00:03:01.689 --> 00:03:03.009
outta their laptops and stuff.

00:03:03.059 --> 00:03:06.539
Colin: I mean, even, uh, Justin
Jackson was sharing some tweets today

00:03:06.569 --> 00:03:10.409
about how, like there's been on some
news posts that came out this morning

00:03:10.409 --> 00:03:13.319
about how the building is locked
down again and no one can get in.

00:03:13.829 --> 00:03:16.949
And then he shared a tweet from
someone who used to run their access

00:03:16.949 --> 00:03:20.639
control and that Elon's calling him
back to help, like they're all locked

00:03:20.639 --> 00:03:23.729
out of the building and that he needs
help getting back into the building.

00:03:23.789 --> 00:03:23.879
It's

00:03:23.879 --> 00:03:26.009
like, oh man.

00:03:27.259 --> 00:03:27.569
, I don't know.

00:03:27.599 --> 00:03:31.019
He should have bought it and not
touched it, I think is what it's like.

00:03:31.319 --> 00:03:34.469
It's like a no make, don't make
any big decisions right after

00:03:34.469 --> 00:03:35.849
you make a big purchase decision.

00:03:35.849 --> 00:03:36.209
It's like

00:03:37.154 --> 00:03:37.634
CJ: Yeah.

00:03:37.904 --> 00:03:43.874
The way that I've been thinking about
it is that, He has started or made big

00:03:43.874 --> 00:03:48.314
influential moves on the cultures of Tesla
and SpaceX and all these other companies

00:03:48.674 --> 00:03:50.354
when they were really in their infancy.

00:03:50.384 --> 00:03:54.644
And so the people I know who
work at SpaceX or worked at

00:03:54.649 --> 00:03:58.874
SpaceX made the conscious
decision when they joined SpaceX.

00:03:59.104 --> 00:04:01.684
To sleep in their van in the parking
lot because they knew they were gonna

00:04:01.684 --> 00:04:03.364
have to work like 90 hours a week.

00:04:03.664 --> 00:04:06.094
But they did that because they
wanted to be part of like this

00:04:06.094 --> 00:04:06.934
thing that he was building.

00:04:07.384 --> 00:04:10.354
But on the other hand, there was like
all of these people at Twitter who I

00:04:10.359 --> 00:04:15.034
think were like really happy with the
quality of life and they chose Twitter

00:04:15.039 --> 00:04:20.524
for, the community and like all of these,
great work-life balance benefits and,

00:04:20.524 --> 00:04:21.964
working remotely and all this stuff.

00:04:21.994 --> 00:04:26.104
And then he comes in and shifts the
culture from the top down and you.

00:04:26.859 --> 00:04:31.274
, 80% of the people who worked
there didn't want to work in that

00:04:31.274 --> 00:04:34.514
environment, and so it just kind
of like blew up in his face a bit.

00:04:35.414 --> 00:04:35.744
But

00:04:35.939 --> 00:04:37.799
Colin: Well, and I think the
rhetoric right now is that

00:04:37.859 --> 00:04:38.999
they don't wanna work hard.

00:04:38.999 --> 00:04:40.609
And it's just a different culture.

00:04:40.609 --> 00:04:44.809
It's like there are definitely people
who got let go, who know how Very, very

00:04:44.809 --> 00:04:46.379
specific things inside of Twitter were.

00:04:47.089 --> 00:04:49.399
And now no one will know
how those things work.

00:04:49.909 --> 00:04:53.029
And sure, that might be bad
documentation or whatever, but like

00:04:53.029 --> 00:04:54.589
I'm looking at my Twitter right now.

00:04:54.889 --> 00:04:57.409
I've been on Twitter since March of 2007.

00:04:57.859 --> 00:05:01.549
There is more than 15 years
of culture that has already

00:05:01.554 --> 00:05:03.269
been developed,  at Twitter.

00:05:03.789 --> 00:05:05.799
If people have been
there fr since that time.

00:05:06.159 --> 00:05:09.119
Some people have been there only a
few years, but You could probably look

00:05:09.119 --> 00:05:12.189
around at all the tech layoffs and
realize that yeah, everyone probably

00:05:12.194 --> 00:05:14.279
overhired since the pandemic started.

00:05:15.914 --> 00:05:21.044
Just wholesale cutting half of your
team, your company because you bought

00:05:21.044 --> 00:05:25.334
something with a bunch of debt is
gonna have some waves for sure.

00:05:25.634 --> 00:05:28.064
And I think everyone's trying to
figure out like, how do you make money?

00:05:28.064 --> 00:05:30.584
And like we, we pay
for Twitter's api like.

00:05:30.604 --> 00:05:35.194
I don't think a lot of people know that
there is a paid offering for the a p I.

00:05:35.244 --> 00:05:38.784
And I think some people were like
making calls on Twitter for like, make

00:05:38.784 --> 00:05:42.324
the a p I fully open again and  let
us make as many calls as we want.

00:05:42.324 --> 00:05:46.434
And it's does anyone remember what
it was like when that was the case?

00:05:46.439 --> 00:05:48.354
Like fail whale was prevalent.

00:05:48.504 --> 00:05:50.514
It wasn't a reliable api.

00:05:50.514 --> 00:05:54.084
I, the guy who works, or probably
the team now that works on.

00:05:54.989 --> 00:06:00.239
Tweet bot, you know, I've followed him for
years and just watched like their issues.

00:06:00.239 --> 00:06:02.849
Cause they even were like limited
to the number of API keys.

00:06:02.849 --> 00:06:03.449
They were allowed.

00:06:04.049 --> 00:06:08.609
And so it's like when you buy Tweetbot,
you get one of our hundred thousand

00:06:08.759 --> 00:06:11.699
p i keys and only a hundred thousand
people can use our Twitter client.

00:06:11.704 --> 00:06:13.869
It's like in what world is that normal

00:06:14.449 --> 00:06:15.059
CJ: Mm-hmm.

00:06:15.119 --> 00:06:20.399
. Part of his thing early on was like,
there's too many bots on Twitter,

00:06:20.399 --> 00:06:24.269
and so I could see him arguing for
just shutting the whole API down.

00:06:24.269 --> 00:06:26.909
Like, you have to be a human
That's on the app that's tweeting

00:06:26.914 --> 00:06:28.284
and we're only gonna let that.

00:06:28.488 --> 00:06:31.338
Fly and not let people have API access.

00:06:31.338 --> 00:06:35.148
But gosh, I don't want
that to be the world.

00:06:35.178 --> 00:06:35.508
Colin: true.

00:06:35.748 --> 00:06:38.568
And that's something that I'm
paying attention to cuz we integrate

00:06:38.573 --> 00:06:40.788
heavily with Twitter at orbit, right?

00:06:40.788 --> 00:06:42.558
So I'm like, okay, what
does this mean for us?

00:06:42.563 --> 00:06:46.348
And some people are asking us
for Mastodon, integration now,

00:06:46.348 --> 00:06:47.098
and we're looking at that.

00:06:47.098 --> 00:06:51.358
But like some people, I still, I looked
at the API and it's pretty similar.

00:06:52.123 --> 00:06:55.138
but, and this will get us into our
topic today, but the, the tricky

00:06:55.138 --> 00:06:58.708
thing is it's just not a really
mature set of tools around it.

00:06:59.278 --> 00:07:02.558
And Mastodon servers are just
melting right now because people

00:07:02.558 --> 00:07:04.208
don't know how to host Mastodon.

00:07:04.208 --> 00:07:08.288
People are realizing that a centralized
service with a whole DevOps team,

00:07:08.288 --> 00:07:09.878
it turns out, is pretty important.

00:07:09.928 --> 00:07:12.488
Instead of a bunch of,  ma on fail whales,

00:07:12.908 --> 00:07:15.848
CJ: So you are, are you on
Macedon, like as a user?

00:07:16.298 --> 00:07:20.078
Colin: Yeah, I joined the Ruby
Social one, so ruby.social.

00:07:20.168 --> 00:07:24.638
Um, I like it, you know, it's a
little, it's definitely rough.

00:07:24.668 --> 00:07:26.438
You can tell it's an open source project.

00:07:26.528 --> 00:07:26.828
CJ: Yeah.

00:07:27.758 --> 00:07:30.788
.is it is it like implemented with Ruby?

00:07:30.788 --> 00:07:31.658
Is it the Rails app?

00:07:31.658 --> 00:07:32.018
Do you know?

00:07:32.018 --> 00:07:32.498
Like,

00:07:32.598 --> 00:07:33.528
Colin: I actually don't know.

00:07:33.858 --> 00:07:34.208
Um,

00:07:34.298 --> 00:07:37.598
CJ: Because there was someone
who posted in the Ruby social

00:07:37.598 --> 00:07:38.948
Mastodon main feed or whatever.

00:07:39.858 --> 00:07:42.143
also, I don't know what the
terms are, . I'm still trying

00:07:42.143 --> 00:07:43.073
to figure out what, like this

00:07:43.343 --> 00:07:44.543
Colin: Those toot toots,

00:07:44.783 --> 00:07:48.413
CJ: yeah, you gotta make some toots,
someone tooted and, uh, , their toot

00:07:48.418 --> 00:07:52.763
was about how like there's all these
issues on one of the master on repos

00:07:52.763 --> 00:07:56.093
and they were basically making a call
to action for all the rubus that were

00:07:56.093 --> 00:07:57.773
in ruby.social to help maintain it.

00:07:58.253 --> 00:08:00.713
I was like, is this thing
like implemented in Ruby?

00:08:00.713 --> 00:08:01.103
I don't know.

00:08:01.538 --> 00:08:04.868
Colin: Well, I think, uh, Mike from
Sidekick runs the Ruby Social one.

00:08:05.198 --> 00:08:08.768
Um, yeah, so if anyone knows
how to scale things, I think

00:08:08.768 --> 00:08:10.298
he's gonna be  pretty set there.

00:08:10.298 --> 00:08:12.248
But yeah, I'll have to check and see.

00:08:12.248 --> 00:08:12.998
It'd be interesting.

00:08:12.998 --> 00:08:16.598
Maybe we, we should do a, a chat
and maybe even we find someone

00:08:16.598 --> 00:08:19.838
who's more familiar with Mastodon to
talk about it in the next episode.

00:08:20.528 --> 00:08:22.608
Actually getting Mike on the
show would be really good too.

00:08:22.638 --> 00:08:25.338
Just talk about sidekick stuff eventually.

00:08:25.488 --> 00:08:28.878
But with all that said, like
there is an API for Mastodon.

00:08:29.118 --> 00:08:35.448
When we get into working with APIs, we
can work with those like raw and make API

00:08:35.448 --> 00:08:41.268
calls, but most of us are using SDKs and
you're actually gonna be doing a talk.

00:08:41.953 --> 00:08:45.613
I guess the talk will have happened
when this episode comes out, but, uh,

00:08:45.913 --> 00:08:49.993
it'll probably be released on YouTube a
little bit after this podcast comes out.

00:08:49.993 --> 00:08:55.153
So, um, let's dive into s TK
Generation and kind of what you're

00:08:55.153 --> 00:08:56.953
gonna be chatting about at Ruby Comps.

00:08:57.453 --> 00:08:57.693
CJ: Yeah.

00:08:57.693 --> 00:09:02.478
So a lot of times if you're
implementing an api, , you can

00:09:02.478 --> 00:09:09.018
have the API spit out an artifact
that has like the shape of the api.

00:09:09.558 --> 00:09:11.388
A lot of times it's
like the open API spec.

00:09:11.393 --> 00:09:13.968
Are you are, do you have
the open API spec for Orbit?

00:09:14.118 --> 00:09:14.538
Uh,

00:09:14.958 --> 00:09:20.628
Colin: Yeah, we use, uh, open api, which
I think is the same as swagger these days.

00:09:20.628 --> 00:09:20.898
Right.

00:09:20.898 --> 00:09:21.678
It's, yeah.

00:09:22.133 --> 00:09:22.608
CJ: Swagger.

00:09:22.608 --> 00:09:25.218
I think Swagger got like
renamed to open api.

00:09:25.588 --> 00:09:25.863
Colin: Exactly.

00:09:25.863 --> 00:09:26.193
Yeah.

00:09:27.223 --> 00:09:32.683
CJ: So it could be open API speck, or it
could be, I think jsun API is another one.

00:09:32.683 --> 00:09:37.993
And then, uh, or you could have
like G R P C proto buff, like your

00:09:37.993 --> 00:09:39.763
proto buff schema definitions.

00:09:39.763 --> 00:09:42.493
Could be like another artifact,
but basically you just want like,

00:09:43.303 --> 00:09:44.983
or even in, in GraphQL too, right?

00:09:44.988 --> 00:09:46.223
The GraphQL schema.

00:09:46.693 --> 00:09:49.813
All of these are versions of some.

00:09:51.463 --> 00:09:55.603
Sort of declarative thing that
gives you the shape of your api.

00:09:55.603 --> 00:09:58.543
And it's usually like, what are
the endpoints, what are all the

00:09:58.543 --> 00:10:01.633
different parameters it expects
what's required and not required.

00:10:02.083 --> 00:10:06.613
And what you can do is take that
spec and then run it through a tool

00:10:06.613 --> 00:10:08.833
to generate and spit out an sdk.

00:10:09.553 --> 00:10:15.083
And if we really wind back the clocks
to,  talking about like XML APIs.

00:10:15.443 --> 00:10:19.563
Then, I don't know, did you
ever have to work with those SDS

00:10:20.543 --> 00:10:21.623
Colin: I had to do.

00:10:22.703 --> 00:10:26.093
I had to do soap APIs with wisdom files.

00:10:26.123 --> 00:10:26.453
Yeah.

00:10:26.543 --> 00:10:27.563
CJ: Yes, yes.

00:10:27.568 --> 00:10:27.873
Yeah.

00:10:27.873 --> 00:10:29.753
So, uh, way back in the day.

00:10:30.633 --> 00:10:36.008
, this is like Prej, S o uh, a lot of APIs
were implemented with xml, and we had to

00:10:36.008 --> 00:10:41.428
do this at my VR with, some of the big
booking engines or like listing platforms.

00:10:41.908 --> 00:10:43.408
They, they didn't have JS O APIs.

00:10:43.408 --> 00:10:48.358
They had XML APIs, and you could
get an X S D, which is a XML schema

00:10:48.358 --> 00:10:51.658
definition, which is similar to an
open API spec or any of these things.

00:10:52.433 --> 00:10:56.788
but then there were tools that could
take this schema definition and generate

00:10:56.788 --> 00:11:01.288
bindings or an sdk, client library,
whatever, in a given programming language.

00:11:01.678 --> 00:11:05.128
So in that case, we were, you know,
taking x sd, converting it to Python.

00:11:05.758 --> 00:11:10.678
Um, and for the Stripe api we
spit out the open API spec.

00:11:11.128 --> 00:11:15.058
And then we have this really,
really badass tooling that takes

00:11:15.058 --> 00:11:19.828
the Open API spec and generates
all seven of our official support.

00:11:20.518 --> 00:11:23.188
Server languages like the SDKs
for all of those languages.

00:11:23.188 --> 00:11:27.988
So Ruby, Python, PHP,
node, go Java and.net.

00:11:28.018 --> 00:11:32.458
We have Stripe SDKs for all
of those languages and they're

00:11:32.458 --> 00:11:36.268
all now automatically generated
using the open API spec.

00:11:36.868 --> 00:11:41.848
And I like, I know that I've
used Orbit Ruby or some sort

00:11:41.853 --> 00:11:44.038
of Ruby clients for Orbit.

00:11:44.038 --> 00:11:47.428
Are those also generated or are
those main maintained by hand?

00:11:48.373 --> 00:11:52.243
Colin: You know, I think they
were written by hand and I would

00:11:52.243 --> 00:11:54.103
say they're not maintained, so

00:11:54.368 --> 00:11:55.378
CJ: Oh, they're not maintained at all.

00:11:55.603 --> 00:11:59.683
Colin: like, I haven't touched
them since I've been here.

00:12:00.403 --> 00:12:04.393
So, and yeah, the folks who built
them don't work here anymore.

00:12:04.453 --> 00:12:08.383
So I think this is one of those things
where, you know, I wrote down here like,

00:12:08.383 --> 00:12:10.813
what does SDK generation help to solve?

00:12:10.813 --> 00:12:13.783
Because the a API I has changed, right?

00:12:13.783 --> 00:12:16.573
And so we get to spit out at
this new artifact of a new

00:12:16.663 --> 00:12:18.433
spec, a new open API doc.

00:12:19.093 --> 00:12:23.028
And it would be really nice to have
that always be in sync right now.

00:12:23.028 --> 00:12:27.348
Once that changes, the docs need to be
updated and the SDKs need to be updated.

00:12:27.858 --> 00:12:30.258
And then you need to
communicate those SDK updates.

00:12:30.318 --> 00:12:35.268
You know, if it's a gem, if it's a MPM
module, those need to make it out as

00:12:35.273 --> 00:12:39.048
as version changes, you know, whether
they're breaking or non breaking changes.

00:12:39.558 --> 00:12:44.388
Do you think that most s STKs today are
done automatically, or do you think that

00:12:44.388 --> 00:12:45.918
a lot of people are still handwriting.

00:12:47.463 --> 00:12:47.753
CJ: I.

00:12:48.398 --> 00:12:51.618
. So there's a, there is an interesting
trade off when you're looking at Generat

00:12:51.618 --> 00:12:56.568
like automatic generation, and that is
like if you want your SDK to be readable,

00:12:57.048 --> 00:13:01.878
then using the automatic generation tools
don't really generate very readable code.

00:13:01.908 --> 00:13:05.748
And so if you just take like the open API
spec and you run it through the Swagger

00:13:05.753 --> 00:13:12.108
Code Gen or the Open API code cogen stuff,
it spits out like a giant, huge library.

00:13:13.098 --> 00:13:15.573
it's automatically generated,
but it's really tough to use.

00:13:16.083 --> 00:13:20.643
Um, and so your trade off is like, do
we want to use the automatic generation

00:13:20.643 --> 00:13:25.323
and have like a really tough to use tool
or do we wanna write our own or do we

00:13:25.323 --> 00:13:28.923
want to like build our own generation
tooling that does like a hybrid of

00:13:28.923 --> 00:13:32.293
both?, so that's  the tooling that I'm
excited to share and talk about is like

00:13:32.293 --> 00:13:37.363
this hybrid of, of both worlds where
we've, we've built this pipeline, but.

00:13:38.683 --> 00:13:42.524
The whole point of SDK generation
is to make sure that your s like

00:13:42.529 --> 00:13:45.373
all of your client libraries are
staying up to date with the api.

00:13:45.973 --> 00:13:48.973
And so, yeah, going back to the top of
the show, right, you're talking about

00:13:48.973 --> 00:13:54.943
how like, yeah, we might just make API
calls directly to the API using Curl

00:13:54.943 --> 00:13:56.293
or Postman or something like that.

00:13:56.703 --> 00:13:59.953
But when we're integrating that into
our applications, we're gonna be

00:13:59.953 --> 00:14:04.073
using Ruby code or JavaScript code
or whatever to make those API calls.

00:14:06.023 --> 00:14:11.853
One option is to write your own like
class that represents a client of

00:14:11.853 --> 00:14:17.403
the API and then use, HTP party, rest
client, whatever sort of built-in

00:14:17.403 --> 00:14:22.443
library there is for making HTP calls
or to use a library that is provided

00:14:22.443 --> 00:14:24.873
by the third party to integrate with.

00:14:24.873 --> 00:14:28.263
For instance, transistor, the host,
the podcast host that we have for this

00:14:28.263 --> 00:14:33.893
platform,  I found like an unofficial
community, Ruby Library for it.

00:14:33.893 --> 00:14:35.243
And I was like, ah, I don't think so.

00:14:35.903 --> 00:14:40.433
. And so, um,  I want to add a list of
all of our podcasts to my website.

00:14:40.643 --> 00:14:42.443
I was like, oh, I'll just
use the transistor API and

00:14:42.443 --> 00:14:43.873
you can like get an API key.

00:14:44.153 --> 00:14:50.213
And so I just built, I wrote a class,
very simple transistor RV like Ruby class.

00:14:51.783 --> 00:14:54.843
, has a couple of helper methods
on it that will just make the

00:14:54.843 --> 00:14:58.923
request to fetch all the episodes
and page and iterate over those.

00:14:59.313 --> 00:15:01.653
So that's the trade off between the
two is right, like you're gonna either

00:15:01.653 --> 00:15:08.403
have, um, no, no SDK and you're expect
your all developers to go and implement

00:15:08.403 --> 00:15:10.593
all of those helper methods themselves.

00:15:11.493 --> 00:15:15.543
Or you have an SDK that's
auto-generated by a really generic.

00:15:16.583 --> 00:15:21.333
Platform like swagger, cogen, you end
up with this massive, huge library

00:15:21.333 --> 00:15:22.653
that is like really hard to read.

00:15:22.953 --> 00:15:26.013
Or the third option is that you
build your own generation tooling.

00:15:26.493 --> 00:15:30.123
Colin: And when you say it's hard to read,
you're talking like, I mean now it's just

00:15:30.123 --> 00:15:33.813
as hard, like you're, you're having to
reference the docs all the time because

00:15:33.813 --> 00:15:35.703
it's not nece, it's machine readable.

00:15:35.703 --> 00:15:38.073
It's not necessarily like a, an
amazing developer experience.

00:15:38.718 --> 00:15:39.378
CJ: exactly.

00:15:39.378 --> 00:15:40.258
To make this more concrete.

00:15:40.993 --> 00:15:45.373
If you take the Open API artifacts that
are spit out for the Stripe API and you

00:15:45.373 --> 00:15:48.013
run it through swagger, cogen, one of the.

00:15:48.988 --> 00:15:52.768
Like wrapper classes it gives
you is 30,000 lines of Ruby code.

00:15:53.398 --> 00:15:58.138
And then for every single resource
in the API and all of its like sub

00:15:58.138 --> 00:16:03.328
resources, it will generate CL classes
and files and there's like 2,200 files.

00:16:03.718 --> 00:16:08.338
So it's like you're either reading through
this ridiculously massive  like file

00:16:08.338 --> 00:16:12.208
or like thousands of files to try to
figure out, you know, how do I construct

00:16:12.213 --> 00:16:15.628
an API call with the right classes and
the right methods and things like that.

00:16:15.628 --> 00:16:16.138
And so,

00:16:16.328 --> 00:16:16.573
Colin: right?

00:16:16.933 --> 00:16:20.923
Because you do also have to have like
docs for this new client library too.

00:16:20.983 --> 00:16:21.223
When.

00:16:21.548 --> 00:16:22.298
Could build that.

00:16:22.298 --> 00:16:22.538
Right?

00:16:22.538 --> 00:16:29.248
And Stripe is infamous for having very
good docs and,  very human readable, SDKs.

00:16:29.253 --> 00:16:32.848
And I think a lot of people think that to
get there, you have to have this huge docs

00:16:32.848 --> 00:16:37.048
team and this huge s STK team and that
you're gonna write everything bespoke.

00:16:37.048 --> 00:16:42.948
But you guys have kind of fallen in that
happy middle of generation plus  some

00:16:42.948 --> 00:16:47.298
hybrid, is that custom handwritten stuff
that's being done in the middle there?

00:16:47.948 --> 00:16:54.218
CJ: So, Yes, and for a long time, for
like seven plus years, we manually

00:16:54.718 --> 00:16:56.918
maintained and hand wrote all the SDKs.

00:16:57.308 --> 00:17:01.958
So when a new feature would land in the
api, there was a Slack notification and

00:17:01.963 --> 00:17:05.628
then, these volunteers would jump in and
start making prs to all of the different

00:17:05.633 --> 00:17:07.818
SDKs in publishing, publishing those.

00:17:07.818 --> 00:17:10.818
And that would take several
hours, sometimes a full day of.

00:17:11.598 --> 00:17:14.778
To add the features, especially to
Stripe, Java, like Java's just so

00:17:14.778 --> 00:17:18.798
verbose that you know, if you change
an eum, you've gotta go change and

00:17:18.798 --> 00:17:20.568
update like six files in Stripe, Java.

00:17:21.228 --> 00:17:23.628
And so we built this layer.

00:17:23.868 --> 00:17:26.868
It took two years to migrate all
the SDKs to, and the other thing

00:17:26.868 --> 00:17:30.398
was that we were trying to build the
generation so that it mirrored what

00:17:30.528 --> 00:17:32.418
the handwritten versions were before.

00:17:32.568 --> 00:17:35.748
So like you've gotta back
into your existing patterns.

00:17:36.258 --> 00:17:38.638
And so we built this f.

00:17:39.993 --> 00:17:45.543
Uh, this guy Alex Ratray, he runs
a company called stainless.dev that

00:17:45.543 --> 00:17:50.373
does this like SDK generation and
developer experience as a service now.

00:17:50.373 --> 00:17:52.083
So you can like hire stainless.dev.

00:17:52.653 --> 00:17:57.363
And, uh, he built like the first
versions of this tool that we use

00:17:57.363 --> 00:17:58.743
internally called Prettier Poet.

00:17:59.373 --> 00:18:03.243
And Prettier poet is a react
like framework where you.

00:18:04.063 --> 00:18:09.763
Components that are language specific,
and they give you things like method

00:18:09.763 --> 00:18:16.333
calls or, you know, literals or strings
or, uh, as like, you know, in instance,

00:18:16.703 --> 00:18:20.113
variable assignment or class definitions.

00:18:20.113 --> 00:18:23.233
So you can use these,
language specific ones.

00:18:23.233 --> 00:18:25.273
They also have like all
the tooling for comments.

00:18:25.753 --> 00:18:28.943
And then when you build Your
high level react component.

00:18:29.513 --> 00:18:32.753
You can use the open API spec as the data.

00:18:32.843 --> 00:18:34.613
That's kind of like
your original data tree.

00:18:34.613 --> 00:18:35.933
That's the input into that.

00:18:35.938 --> 00:18:37.553
And so you can generate all the classes.

00:18:37.553 --> 00:18:40.913
So in the Stripe api, there's
like customers and subscriptions

00:18:40.913 --> 00:18:42.273
and payment intents.

00:18:43.293 --> 00:18:45.063
Those are all defined
in the open API spec.

00:18:45.063 --> 00:18:48.843
You can like iterate overall the resources
in the open API spec and have those feed

00:18:48.843 --> 00:18:54.393
into this React component that is gonna be
like, oh, this is the resource component

00:18:54.723 --> 00:18:56.553
and it knows how to generate the class.

00:18:56.558 --> 00:18:59.193
And then it can use the spec to know
like what's the class name and what

00:18:59.198 --> 00:19:03.873
are all the methods and what are my,
what are the documentation strings

00:19:03.873 --> 00:19:06.723
that should be added to the top of the
class and to each of the methods and.

00:19:08.493 --> 00:19:11.958
What's really cool about this is that
like at first we did it just for SDK

00:19:11.958 --> 00:19:17.358
generation, but now we have like this
tooling that generates the Postman client.

00:19:17.358 --> 00:19:20.208
It generates the API reference.

00:19:20.448 --> 00:19:24.588
All of the code snippets that you see
in the docs we're generating like tons

00:19:24.588 --> 00:19:30.288
and tons of those with this like higher
order markdoc.dev component called

00:19:30.288 --> 00:19:34.908
cogen snippet, where you basically
say like, okay, this is a, an api.

00:19:35.223 --> 00:19:40.713
To v1/customers it's a post request and
here's the arguments, and that will spit

00:19:40.713 --> 00:19:42.543
out the code in all seven languages.

00:19:42.543 --> 00:19:45.393
It shows the code in curl, it shows
how to do it with Stripe cli, and

00:19:45.393 --> 00:19:47.133
that's like all autogenerated now.

00:19:47.493 --> 00:19:52.233
And before that was all like just string
and interpolation in erb files, so

00:19:52.893 --> 00:19:53.283
Colin: Wow.

00:19:53.403 --> 00:19:53.613
Yeah.

00:19:53.613 --> 00:19:57.033
I was gonna ask, because it sounds
very similar to Mark Docs, so you

00:19:57.033 --> 00:20:02.533
guys have Mark Docs and your SDKs
are being fed by this generation,

00:20:03.793 --> 00:20:06.153
if I'm, if I'm thinking
of the trees properly.

00:20:06.213 --> 00:20:06.513
Right.

00:20:06.513 --> 00:20:11.133
So you have your open API spec, which
then, feeds into prettier poet and then.

00:20:11.733 --> 00:20:17.283
Generates those, those artifacts,
fors, stk, STKs, and your docs.

00:20:18.008 --> 00:20:18.723
CJ: Yeah, exactly.

00:20:18.723 --> 00:20:23.133
And even things like, we have
a visual studio code extension.

00:20:23.133 --> 00:20:26.313
So if you install like the stripe
for VS code extension, then you get.

00:20:27.048 --> 00:20:28.188
Snippet completion.

00:20:28.188 --> 00:20:32.088
So you can type like stripe payment
intent, create and hit tab, and that

00:20:32.088 --> 00:20:34.218
will auto complete a snippet in vs code.

00:20:34.248 --> 00:20:36.228
Like that's also powered by this thing.

00:20:36.708 --> 00:20:40.548
And so, uh, I think even like the stripe
shell, so if you go to the documentation

00:20:40.548 --> 00:20:45.348
and you hit like tilde or whatever, it
pops open a little drawer at the bottom

00:20:45.348 --> 00:20:49.373
that lets you have this interactive shell
for making API calls directly in the docs.

00:20:49.883 --> 00:20:51.823
And all of that is backed by,

00:20:52.033 --> 00:20:52.543
Colin: Wait, this.

00:20:52.543 --> 00:20:54.193
is, this is in the docs that you

00:20:54.283 --> 00:20:57.823
CJ: Yeah, if you go to like
stripe.com/docs and then hit . Yeah.

00:20:57.823 --> 00:21:01.153
Hit like, you know, back tick
or whatever, it should pop open.

00:21:01.813 --> 00:21:05.363
Stripe Shell which is like a
browser-based version of the Stripe c l

00:21:05.558 --> 00:21:06.338
Colin: Oh, wow.

00:21:06.968 --> 00:21:07.178
Yeah.

00:21:09.788 --> 00:21:11.438
we're finding out all the secrets today.

00:21:12.008 --> 00:21:12.368
Yeah.

00:21:12.788 --> 00:21:17.288
The other one we just found, if you go to
the, uh, if you just go to customer.new

00:21:17.948 --> 00:21:18.878
or do you know about this one?

00:21:20.033 --> 00:21:20.363
CJ: No.

00:21:20.363 --> 00:21:21.233
What is customer not new?

00:21:21.458 --> 00:21:25.268
Colin: If you go to customer.new as
a, as a u r url, it launches into

00:21:25.268 --> 00:21:28.988
Stripe and tries to create a new
customer if you're logged into Stripe.

00:21:29.478 --> 00:21:32.418
Yeah, we've just found that cuz
we also, we have member new for

00:21:32.418 --> 00:21:36.468
Orbit, so if you just like even
make a bookmark for member.new.

00:21:37.123 --> 00:21:38.263
And click on it.

00:21:38.263 --> 00:21:41.863
It just launches a little screen to
add a new member to your workspace.

00:21:42.583 --> 00:21:46.213
But um, I think a lot of people are start,
there's like a whole list of all the

00:21:46.213 --> 00:21:47.893
ones that you can do around the web now.

00:21:47.943 --> 00:21:51.813
I'm sure there's like a notion,
page.new or something out there, but

00:21:52.658 --> 00:21:53.768
CJ: so I definitely knew.

00:21:53.798 --> 00:21:57.488
Okay, so invoice.new
works, subscription.new.

00:21:58.613 --> 00:21:59.333
Works.

00:21:59.393 --> 00:22:02.243
So there were a couple that I knew
about, I did not know about customer New

00:22:03.458 --> 00:22:07.538
. 
Colin: Yeah, it's whatever company gets
to the TLD before anyone else because

00:22:08.398 --> 00:22:12.208
Now no one else can do subscription.new,
only, only Stripe powers that.

00:22:12.208 --> 00:22:14.418
But yeah, fun little Easter
eggs for the internet.

00:22:14.418 --> 00:22:17.568
I'm trying to think if we have any
other ones for, but I'll have to share

00:22:17.568 --> 00:22:21.408
that console with, uh, with uh, Alex
who works on a lot of our Stripe stuff.

00:22:21.708 --> 00:22:25.818
And even the, I didn't know that there was
a VS code extension, you know, cause in

00:22:25.823 --> 00:22:29.838
my mind I was trying to think of like how
all this is really exciting when you think

00:22:29.838 --> 00:22:33.408
about even the open API spec teaching.

00:22:33.813 --> 00:22:35.973
GitHub co-pilot, right?

00:22:36.003 --> 00:22:39.783
Like, just being able to be like,
I don't want to go, always look at

00:22:39.783 --> 00:22:43.683
the docs for every little thing,
but like GitHub co-pilot or Stripe

00:22:43.953 --> 00:22:45.453
cli, or Stripe, you know, vs.

00:22:45.458 --> 00:22:49.413
Code extension helped me with
what I'm working on here.

00:22:49.513 --> 00:22:52.673
And when I've used s STKs,
like some SDKs are just as.

00:22:53.358 --> 00:22:59.148
Like, I would rather go just do curl
calls or like http party or something

00:22:59.148 --> 00:23:02.728
like that, because I know what I'm
doing., there are some amazing ones.

00:23:02.728 --> 00:23:07.793
I'm betting that the Discord one is
probably auto-generated, but what's

00:23:07.798 --> 00:23:10.823
really cool is that like once you
get the table stakes of just good

00:23:11.203 --> 00:23:16.143
s stk generation done, the discord,
client libraries also help you.

00:23:17.183 --> 00:23:19.163
Rate limiting like automatically.

00:23:19.853 --> 00:23:24.833
Um, and it's, so it's got a bunch of
like Texs and like backgrounding that

00:23:24.833 --> 00:23:28.673
happens to make sure that you're, like,
you're not writing the code yourself to

00:23:28.678 --> 00:23:31.343
make sure you're staying within those
rate limits, which is really nice.

00:23:31.863 --> 00:23:34.933
But you probably don't get to work
on stuff like that if you're having

00:23:34.933 --> 00:23:38.863
to hand write these things every
single time that the API changes.

00:23:38.953 --> 00:23:40.183
And then you get the drift.

00:23:40.238 --> 00:23:43.863
I mean honestly this conversation's
inspiring me to, go look at our Ruby.

00:23:43.863 --> 00:23:46.383
I think we have a Ruby one
and a JavaScript one, and

00:23:46.383 --> 00:23:47.343
I think that's probably it.

00:23:47.943 --> 00:23:51.663
Um, but I do know that the JavaScript
one, it's like very opinionated

00:23:51.663 --> 00:23:53.193
and I think that's the challenge.

00:23:53.198 --> 00:23:55.383
It's like whoever wrote
that one, that's how you.

00:23:56.388 --> 00:23:59.358
It's not necessarily how you might
write it or how I might write it.

00:23:59.358 --> 00:24:03.558
And so there's like that kind of
like an opinion about the developer

00:24:03.558 --> 00:24:07.713
experience instead of just saying taking
a customer object, if there's a class

00:24:07.718 --> 00:24:11.913
for it, and being able to like add an
invoice really easily and let it fill

00:24:11.913 --> 00:24:15.333
in all the parameters for customer and
do all that stuff behind the scenes.

00:24:15.338 --> 00:24:19.053
Or do you have to go build each
object by hand and then send it to the

00:24:19.053 --> 00:24:20.853
client in order to save those things?

00:24:21.258 --> 00:24:24.738
CJ: Right, and I think sometimes
what's interesting about building this.

00:24:24.818 --> 00:24:29.538
generation layer is say that you make
a choice early on when you're building

00:24:29.538 --> 00:24:34.818
the SDK that you want to have people
interact with the API through like

00:24:34.998 --> 00:24:37.278
class methods on some resource, right?

00:24:37.278 --> 00:24:44.118
So you have like Stripe::Customer.Create
and that takes in some a hash that will

00:24:44.118 --> 00:24:48.198
like pass those arguments to the api, but
later you decide that, oh, it's actually

00:24:48.198 --> 00:24:54.033
way better if instead of having these
class methods globally available, That we

00:24:54.033 --> 00:24:59.643
have a client where you can like new up
and say like, Stripe know, stripe.new, and

00:24:59.643 --> 00:25:05.193
then you call like stripe.customers.Create
And so what's crazy is like you can

00:25:05.193 --> 00:25:10.083
use the, these like generation layer to
implement both patterns and then you can

00:25:10.083 --> 00:25:14.073
slowly start migrating people over to
this new pattern or just enable both.

00:25:14.193 --> 00:25:15.423
Both like methods and.

00:25:17.103 --> 00:25:20.313
If you look right now, there's
definitely parts of the stripe docs

00:25:20.313 --> 00:25:24.403
that are still one foot in the old
world for like some of the SDKs,

00:25:24.963 --> 00:25:28.533
like php, where we had all of the.

00:25:29.768 --> 00:25:33.258
Documentation written as class
methods, but the API ref and all

00:25:33.258 --> 00:25:35.748
of the auto-generated snippets
are now migrated over to this

00:25:35.748 --> 00:25:37.488
like client and services pattern.

00:25:37.878 --> 00:25:40.098
And so that is definitely
one of the benefits.

00:25:40.098 --> 00:25:45.198
But yeah, if, if your original
authors  took like one approach that

00:25:45.198 --> 00:25:49.788
you disagree with and you don't wanna
break everyone, then it's ki it can

00:25:49.788 --> 00:25:56.178
be challenging to like, Release a new
pattern and have everyone upgrade or,

00:25:56.282 --> 00:25:56.672
Colin: yeah.

00:25:56.822 --> 00:25:57.662
just alias.

00:25:57.692 --> 00:25:58.622
Alias everything.

00:25:58.652 --> 00:25:58.832
Yeah.

00:25:59.102 --> 00:26:00.072
CJ: Yeah, exactly.

00:26:00.122 --> 00:26:03.302
Colin: I think one of the considerations
that I've heard with SDK generation

00:26:03.302 --> 00:26:06.277
is if you're not a rubus, for
example, and a Java person writes

00:26:06.282 --> 00:26:07.747
a Ruby client library, right?

00:26:07.752 --> 00:26:09.787
It's probably not gonna follow.

00:26:10.247 --> 00:26:11.477
Ruby conventions.

00:26:11.567 --> 00:26:14.987
And so like, this is something to consider
in your sstk generation, is that these

00:26:14.987 --> 00:26:19.407
tools probably should know a little
bit about the standards in Java look

00:26:19.407 --> 00:26:21.417
like this and Python looks like this.

00:26:21.847 --> 00:26:24.157
Even just variable naming
and stuff like that.

00:26:24.157 --> 00:26:28.087
Class names Camel Case, you know,
snake Case, all those kinds of

00:26:28.087 --> 00:26:31.047
things where you can tell they're
like, oh, a Java person wrote this.

00:26:31.047 --> 00:26:33.657
Or a JavaScript person type
script, whatever it looks like.

00:26:33.687 --> 00:26:35.167
I'm just trying to think
through like pros and cons here.

00:26:35.647 --> 00:26:39.477
It sounds like, you probably
have more contained like testing

00:26:39.957 --> 00:26:41.187
and continuous deployment

00:26:41.697 --> 00:26:45.747
and being able to have failures and tests
and all that kind of stuff along the way.

00:26:46.292 --> 00:26:46.682
CJ: totally.

00:26:46.682 --> 00:26:46.982
Yeah.

00:26:47.462 --> 00:26:52.282
So what's cool is that if you have
patterns built into the api, then

00:26:52.342 --> 00:26:55.342
you can test your generation layer
and be pretty confident that it's

00:26:55.342 --> 00:26:56.422
gonna spit out the right code.

00:26:56.422 --> 00:26:59.122
And if it's spitting out the wrong
code, then you can fix it at the

00:26:59.122 --> 00:27:03.112
generation layer and that will fix it
all, like in all the downstream places.

00:27:03.112 --> 00:27:06.442
So it fixes the docks and it
fixes the SDKs and it fixes

00:27:06.442 --> 00:27:07.822
kind of everything ideally.

00:27:09.957 --> 00:27:13.042
But yeah, it's, it's also important
I guess to mention that like we're

00:27:13.042 --> 00:27:19.942
taking the open API spec and by itself
using the spec was really challenging

00:27:19.972 --> 00:27:25.612
in order to go from like this giant
J s O object into all of these SDKs

00:27:25.617 --> 00:27:26.962
and client libraries and whatever.

00:27:27.082 --> 00:27:31.402
And so there is this like
intermediate step that we call,

00:27:31.402 --> 00:27:34.882
like compiling the open API spec
into this thing called Stripe type.

00:27:35.362 --> 00:27:39.622
And so I th we initially started with
Flow, but I think we're using Ty, uh,

00:27:39.652 --> 00:27:46.522
type script now, where we take the,
uh, the original j s o blob that came

00:27:46.522 --> 00:27:51.372
out of the open API spec, and then
we build all of these different like

00:27:51.372 --> 00:27:56.352
discriminated types for what the high
level resources should all look like.

00:27:56.712 --> 00:27:59.852
And then we use that as our
input into prettier poet and our

00:27:59.852 --> 00:28:01.472
input into all these docs tools.

00:28:01.922 --> 00:28:03.792
That way we have this much.

00:28:04.682 --> 00:28:09.332
More like strongly typed and wired up
tool because the, the Open API spec

00:28:09.332 --> 00:28:13.047
will actually give you back the resource
and here's the methods, but also

00:28:13.052 --> 00:28:15.357
like down here is in a separate area.

00:28:15.357 --> 00:28:19.617
Here's the responses, and you kind
of need to combine both of those in

00:28:19.622 --> 00:28:24.477
order to have all the information to
implement a strongly typed language.

00:28:25.317 --> 00:28:26.877
Go and see Sharp or whatever.

00:28:26.877 --> 00:28:30.277
And  there is that intermediate step and
if people are interested in,  learning

00:28:30.277 --> 00:28:35.687
more about that, Richard from our team did
a talk at Strange Loop last year, and so

00:28:35.687 --> 00:28:37.577
we'll put a link to that, uh, on YouTube.

00:28:37.582 --> 00:28:40.587
And it's super interesting
to watch, how that evolved.

00:28:40.767 --> 00:28:43.887
But yeah, when you were, when you were
talking about how, like, like snake

00:28:43.887 --> 00:28:47.547
case versus Camel case versus whatever,
have you ever used a Ruby motion?

00:28:47.757 --> 00:28:48.687
Ruby Motion, like.

00:28:48.907 --> 00:28:49.327
Colin: I'm.

00:28:49.762 --> 00:28:55.252
CJ: Okay, so there was, I think,  20
12, 20 13 or something, you could use

00:28:55.252 --> 00:28:59.932
Ruby to implement like iOS apps and
it had like some tooling to spit out.

00:28:59.992 --> 00:29:02.872
I, it must have been like objective C
or something like this, but it was so

00:29:02.872 --> 00:29:06.712
funny because the class ne like the
class names would be like, you know,

00:29:06.802 --> 00:29:09.922
application on a knit with whatever.

00:29:10.282 --> 00:29:13.132
You know, and completion block
or whatever, , like kind of

00:29:13.132 --> 00:29:16.792
the apple, the apple like, uh,
objective seed name for the method.

00:29:16.792 --> 00:29:19.672
But it was just like in Ruby, so
it was like deaf  and then like

00:29:19.672 --> 00:29:22.352
this 85 character  method name.

00:29:22.692 --> 00:29:26.432
But I think probably, uh, everyone
who's been around for a while has

00:29:26.462 --> 00:29:29.852
encountered some SDK where you're
like, this is not, this was not like

00:29:29.882 --> 00:29:34.112
implemented by Rubus based on all the
different weird names and stuff that are.

00:29:35.522 --> 00:29:38.252
Colin: But I, what I like is
that everything is then in code.

00:29:38.432 --> 00:29:41.642
You can commit, you can
add to a change log.

00:29:41.642 --> 00:29:44.192
The change log goes out to
all the different s STKs.

00:29:44.402 --> 00:29:47.402
So does that mean that you guys
release, when you release an

00:29:47.402 --> 00:29:50.402
update to one s stk, you always
release an update to all of them?

00:29:50.402 --> 00:29:54.032
Or is there some like, yeah, so there's
not really like, oh, we're only gonna

00:29:54.032 --> 00:29:56.552
bump one because it affects all of them.

00:29:57.137 --> 00:29:59.987
CJ: Yeah, so we will release.

00:30:00.527 --> 00:30:05.957
So there are some changes that only impact
the strongly typed languages because we do

00:30:05.957 --> 00:30:07.727
use some meta programming for some things.

00:30:07.727 --> 00:30:12.257
And so like if there is a change
to an eum, like there's already an

00:30:12.262 --> 00:30:16.997
existing eum and we're just adding
like a new value for that enum or

00:30:16.997 --> 00:30:19.217
something, then it only needs to change.

00:30:20.067 --> 00:30:26.247
Java go.net and the type definitions
for Stripe node, but it doesn't need

00:30:26.247 --> 00:30:30.717
to change Ruby or Python or PHP because
those are all just gonna say like, ah, you

00:30:30.717 --> 00:30:32.157
give me a string, you give me a string.

00:30:32.157 --> 00:30:35.062
It must work . Because they're not
like checking types or anything,

00:30:35.392 --> 00:30:38.692
As soon as a feature is generally
available, it kicks off this

00:30:38.692 --> 00:30:40.612
domino chain that is pretty wild.

00:30:40.612 --> 00:30:44.602
Like it will automatically generate
like all the internal versions

00:30:44.602 --> 00:30:48.112
of it and tests and snapshot
tests and like all of this stuff.

00:30:48.532 --> 00:30:51.022
And then it will also kick
off the Slack message.

00:30:51.022 --> 00:30:54.142
And then the S STKs team goes
and runs like generate, generate,

00:30:54.142 --> 00:30:55.882
generate, generate on all the SDKs.

00:30:55.882 --> 00:30:58.522
And that all makes prs and
those prs get reviewed.

00:30:58.527 --> 00:31:01.522
And once those are merged, those
all get deployed out to like,

00:31:01.522 --> 00:31:03.022
you know, Ruby Gems and npm.

00:31:03.592 --> 00:31:05.032
Maven and Gradle and whatever.

00:31:05.442 --> 00:31:09.142
It's  interesting to be the person
that's gonna tick the box that says

00:31:09.142 --> 00:31:10.342
this is generally available now.

00:31:10.347 --> 00:31:12.322
And it's like, you can't
take that back very easily.

00:31:12.417 --> 00:31:15.207
Colin: Yeah, I was thinking like as
a small company or a smaller company,

00:31:15.207 --> 00:31:17.847
it's like, whew, we're gonna be running
a lot of, we're gonna run a lot of

00:31:17.847 --> 00:31:20.907
servers and spend a lot of money right
now when we took this box and a lot of

00:31:21.387 --> 00:31:25.407
prs and CDs are gonna fire up and you're
gonna get a bunch of servers running

00:31:25.407 --> 00:31:29.967
a bunch of code and now we got a bunch
of PRS to review and yeah, it's pretty

00:31:30.042 --> 00:31:35.352
CJ: Yeah, that all that said, like
I think it is really valuable and

00:31:35.352 --> 00:31:41.562
important to have features immediately
available in the SDKs because that

00:31:41.562 --> 00:31:46.122
is like the main way that devs are
using and feeling stripe, right?

00:31:46.122 --> 00:31:50.652
They're like, Their first impression
is, okay, I installed Stripe,

00:31:50.652 --> 00:31:53.082
Ruby, and then I tried to make a
customer or something like that.

00:31:53.082 --> 00:31:59.015
Like usually they're not, interacting
with the Stripe API directly.

00:31:59.475 --> 00:32:03.835
The actual numbers of people who
. Are using the Stripe API directly

00:32:03.840 --> 00:32:05.985
through official SDKs is massive.

00:32:05.985 --> 00:32:08.925
Like, it's surprising how many
people use the SDKs instead

00:32:08.925 --> 00:32:11.085
of just making raw requests.

00:32:11.475 --> 00:32:14.445
Colin: Well, I mean, with Stripe
there's so many requests that you

00:32:14.445 --> 00:32:15.705
need to chain together, right?

00:32:15.705 --> 00:32:17.085
To do some things.

00:32:17.505 --> 00:32:19.455
So I feel like that one
makes a lot of sense.

00:32:19.460 --> 00:32:22.905
Cause a lot of people aren't used
to, you know, carrying around all the

00:32:22.905 --> 00:32:25.395
responses and like, let's make this call.

00:32:25.395 --> 00:32:28.875
Like I've done the, like, you know,
do the full process of checking

00:32:28.875 --> 00:32:30.575
somebody out in Postman, right?

00:32:30.575 --> 00:32:34.365
And it's like, okay, it's good to know
how it works, but man, a library really.

00:32:35.025 --> 00:32:36.585
A lot more sense for this one, right?

00:32:36.915 --> 00:32:40.395
With Orbit, it's like, okay, sending
an activity is just one call.

00:32:41.265 --> 00:32:45.855
Now talking and pulling data outta orbit
requires a lot of chaining of APIs,

00:32:45.855 --> 00:32:47.805
calls to get IDs and stuff like that.

00:32:47.810 --> 00:32:50.715
And some of the things we're thinking
about is like, how do we, I really like

00:32:50.715 --> 00:32:53.025
when APIs have like the side loading.

00:32:53.295 --> 00:32:57.015
I think you guys have that with yours
where you can say like, This is an id,

00:32:57.015 --> 00:32:58.665
but I want it to be the full object.

00:32:58.665 --> 00:32:59.955
I don't want the ID of it.

00:32:59.955 --> 00:33:03.735
I want the customer with the
invoice attached and those kinds of

00:33:03.735 --> 00:33:04.935
things I'd really like us to have.

00:33:04.935 --> 00:33:08.475
Cause right now it's like, here's
an organization id, you go get the

00:33:08.475 --> 00:33:11.805
organization that it's attached to
and make another call when we already

00:33:11.805 --> 00:33:13.305
know who that is and all that.

00:33:13.310 --> 00:33:15.950
I think the thing that we're not talking
about here that we should probably talk

00:33:15.950 --> 00:33:20.410
about in a future episode is that like,
This assumes you have an open API spec and

00:33:20.410 --> 00:33:22.690
that you have like a well designed api.

00:33:22.690 --> 00:33:24.550
Like this isn't designing
your API for you.

00:33:24.550 --> 00:33:27.490
This is just the tooling around your api.

00:33:27.495 --> 00:33:33.160
And you know, I've been thinking of what
RV two API I looks like so that we can

00:33:33.160 --> 00:33:39.850
get a, a different API spec cuz our a
p is a J S O N api and it turns out J

00:33:39.850 --> 00:33:44.110
S O API is really good for like machine
to machine computers understand it.

00:33:44.110 --> 00:33:45.460
I mean it's most of these right?

00:33:45.460 --> 00:33:46.630
Like a soap api.

00:33:47.300 --> 00:33:51.590
Has a wisdom, like you were
talking about these X S D bindings,

00:33:51.680 --> 00:33:53.090
um, all those kinds of things.

00:33:53.090 --> 00:33:58.100
It's like teaches the computer what
it can call, but does not necessarily

00:33:58.100 --> 00:34:02.785
always give the developer like a fun,
light bulb experience of sending a, an

00:34:02.785 --> 00:34:06.595
SMS with Twilio or sending an email with
SendGrid or whatever those things are.

00:34:06.595 --> 00:34:08.245
It's like it should be fun.

00:34:08.245 --> 00:34:10.405
And I, you know, I, I've
always thought of APIs.

00:34:11.095 --> 00:34:14.485
Turning on a light bulb across
the world, right, is it's just

00:34:14.485 --> 00:34:16.615
fun to have that as a superpower.

00:34:16.615 --> 00:34:21.175
And now we can charge a customer
and stripe or, you know, send an

00:34:21.175 --> 00:34:24.385
activity to segment and have it
populate everywhere we need it.

00:34:25.105 --> 00:34:28.735
CJ: So I was curious and I, I jumped
in, I did write a couple of orbit

00:34:29.275 --> 00:34:35.935
integrations, like one for piping in
some dev.to blog post activity, and

00:34:35.935 --> 00:34:37.495
another one for piping in YouTube.

00:34:38.360 --> 00:34:41.056
and I was looking at like,
oh, did I just hit the a p I

00:34:41.526 --> 00:34:45.316
directly or did I use the S D K?

00:34:45.346 --> 00:34:48.736
And in one of them I used the, the
Orbit s d K, the other one I didn't

00:34:49.696 --> 00:34:55.216
So yeah, I'm using Orbit activities
request and then passing in just

00:34:55.216 --> 00:34:57.886
like a giant blob of arguments
and the body and everything.

00:34:58.521 --> 00:34:58.761
Colin: Mm-hmm.

00:34:58.936 --> 00:35:02.956
CJ: And then in the other one, I'm
using REST client to just hit, uh,

00:35:03.886 --> 00:35:06.616
like orbit.love/api v1 or whatever.

00:35:06.631 --> 00:35:07.051
Colin: Nice.

00:35:07.801 --> 00:35:08.101
Yeah.

00:35:08.101 --> 00:35:11.371
I mean, it's something that we all have to
make decisions when we, we actually have

00:35:11.371 --> 00:35:15.581
our own Orbi HTTP client now, in Ruby and.

00:35:16.451 --> 00:35:17.771
I think it'll be interesting.

00:35:17.771 --> 00:35:18.761
I'll have to see if.

00:35:19.556 --> 00:35:22.826
Coworker Steve has any interest
in eventually opening that up.

00:35:22.826 --> 00:35:26.036
But it has a lot of that rate
limiting stuff built into

00:35:26.036 --> 00:35:27.416
it like we had with Discord.

00:35:27.956 --> 00:35:32.876
We sometimes will use official SDKs
for our integrations, but sometimes,

00:35:32.876 --> 00:35:38.126
like if our API is only going to
ingest data and never create data,

00:35:38.586 --> 00:35:42.756
some APIs don't give you API keys
that are read only, things like that.

00:35:42.756 --> 00:35:44.016
So like we're like, we only.

00:35:44.841 --> 00:35:46.461
The endpoints that get the data.

00:35:46.461 --> 00:35:51.711
We do not want to even have a
method that lets us delete or

00:35:51.711 --> 00:35:53.361
create or any of those things.

00:35:53.811 --> 00:35:59.091
Um, but also just sometimes like, just
being able to standardize, re responses,

00:35:59.421 --> 00:36:03.231
standardize what happens after, cuz
every sdk like we're talking about here,

00:36:03.591 --> 00:36:07.791
the experience, the opinions of the
developer team that put together the sdk.

00:36:07.791 --> 00:36:12.396
So like, Because of how we built
out our newer integrations.

00:36:12.726 --> 00:36:16.536
They almost all use that Orbit
HTTP client, which I think is

00:36:16.536 --> 00:36:17.826
a wrapper around rest client.

00:36:17.826 --> 00:36:21.396
But there's just like a bunch of really
nice helpers and it's more declarative.

00:36:21.396 --> 00:36:25.356
So you can just say these are the
end points and we're not rewriting.

00:36:25.361 --> 00:36:27.546
Cause that's like the challenge
when you do a lot of integrations

00:36:27.546 --> 00:36:29.076
is that you're doing the same thing.

00:36:29.666 --> 00:36:33.846
And translating it to every API , and
being able to have some standards

00:36:33.846 --> 00:36:36.846
once the response comes back,
we know what it looks like every

00:36:36.846 --> 00:36:38.586
single time, which is really nice,

00:36:38.636 --> 00:36:42.486
CJ: So this is the client that you're
using to integrate against other

00:36:42.486 --> 00:36:44.226
third parties, not against the orbit?

00:36:44.226 --> 00:36:44.466
Right.

00:36:44.466 --> 00:36:44.736
Okay.

00:36:44.736 --> 00:36:51.981
And then are, gosh, I, I almost wonder
if it's possible to like, Take the third

00:36:51.981 --> 00:36:55.221
parties and see like, oh, do all of
them have open API specs or something

00:36:55.221 --> 00:36:57.321
like that, that you could then use to

00:36:57.321 --> 00:36:58.341
build that?

00:36:58.346 --> 00:36:58.851
Like, yeah,

00:36:58.851 --> 00:37:02.601
the, so like you have your H C D B
client, and then you could build like that

00:37:02.601 --> 00:37:05.901
middle layer that we've talked so much
about, which is like the adapter layer.

00:37:06.441 --> 00:37:12.081
And I, it sounded like you had
a pretty cool, uh, like pipeline

00:37:12.316 --> 00:37:12.926
Colin: Mm-hmm.

00:37:13.191 --> 00:37:13.611
CJ: Right.

00:37:13.731 --> 00:37:14.091
But.

00:37:15.111 --> 00:37:15.261
Colin: yeah.

00:37:15.261 --> 00:37:20.361
Each integration essentially ends up
with its own like Stripe client for

00:37:20.361 --> 00:37:23.061
example, that uses the Orbit HTTP client.

00:37:23.061 --> 00:37:27.491
And it's just the methods we need
and because everything is built on

00:37:27.491 --> 00:37:30.521
that client, we don't have to go
implement everything all over again.

00:37:30.521 --> 00:37:35.291
It's just really like, is to get, what's
the endpoint slash customers or whatever.

00:37:35.418 --> 00:37:39.588
Obviously once you release something
as like a public gem or whatever, now

00:37:39.588 --> 00:37:44.148
you comes with a burden of supporting
it and documenting it and taking issues

00:37:44.148 --> 00:37:45.708
and prs and all that kind of stuff.

00:37:45.708 --> 00:37:49.248
So do you, you guys, I'm assuming,
don't take PRS necessarily

00:37:49.248 --> 00:37:50.988
against these SDKs then, right?

00:37:52.053 --> 00:37:55.653
CJ: So there are parts of
them that are not generated,

00:37:55.773 --> 00:37:57.693
and we will take prs on that.

00:37:57.698 --> 00:37:59.853
It's kind of like, I, I refer
to that as like the core.

00:37:59.853 --> 00:38:05.043
So if it's, if it is that sort of,
um, item potency or retries layer or

00:38:05.043 --> 00:38:10.083
interacting with, you know, SSL or, um,
the patterns, like, oh, is this a client?

00:38:10.413 --> 00:38:12.483
Versus client services or
class method or whatever.

00:38:12.573 --> 00:38:14.913
We will take PRS to modify that core.

00:38:15.433 --> 00:38:19.073
But  all of the pieces that are boiler
plate, that mirror the api, those are

00:38:19.073 --> 00:38:20.303
all generated and it wouldn't make

00:38:20.303 --> 00:38:21.563
sense for anyone to make a PR

00:38:22.403 --> 00:38:25.673
Colin: But they can record an issue so
you guys can go check it out and see like,

00:38:25.703 --> 00:38:27.233
oh yeah, that's actually not correct,

00:38:27.773 --> 00:38:28.403
CJ: Exactly.

00:38:28.433 --> 00:38:32.153
And I would love to see us
actually move the generation code

00:38:32.153 --> 00:38:33.923
into the, into the open source.

00:38:34.688 --> 00:38:35.408
Libraries.

00:38:35.408 --> 00:38:37.568
The generation code right
now is all private sourced.

00:38:37.988 --> 00:38:42.954
And I was looking at,   AW s gem, I think
this might be the most popular Ruby gem

00:38:43.404 --> 00:38:44.784
by downloads or something like that.

00:38:45.294 --> 00:38:49.284
Uh, and they also generate this client.

00:38:49.644 --> 00:38:52.734
But they're doing it in a
generator that's open source and

00:38:52.734 --> 00:38:55.234
it's like part of the library.

00:38:55.324 --> 00:38:56.854
And it was interesting to look at.

00:38:56.854 --> 00:38:59.974
They have basically these giant
mustache templates and then they

00:38:59.974 --> 00:39:04.654
iterate over some input, some input
that's like similar to open API spec.

00:39:04.714 --> 00:39:07.264
They don't have this
intermediate stripe type.

00:39:07.424 --> 00:39:08.714
Style compiler thing.

00:39:08.714 --> 00:39:14.414
But, uh, I do love to see the generator
there because as an open source

00:39:14.414 --> 00:39:17.564
contributor, you could make a change to
the generator that's like, oh, it would

00:39:17.564 --> 00:39:22.184
be better if it was like this, or it'd
be more perf like performant if we use, I

00:39:22.184 --> 00:39:24.674
don't know, yield instead of block.call.

00:39:24.704 --> 00:39:27.584
You know, I don't know, like
the actual, you know, Ruby,

00:39:27.644 --> 00:39:29.204
whatever, magic stuff, but.

00:39:29.644 --> 00:39:33.484
Colin: And someone might learn from
this, uh, you know, AW S one and start

00:39:33.484 --> 00:39:35.584
generating their own SDKs for their own.

00:39:35.584 --> 00:39:38.284
Like, we, we would just end up
with better SDKs all around.

00:39:38.284 --> 00:39:38.524
Right?

00:39:38.524 --> 00:39:43.354
It's like putting it out there so that
more people do this as a, as a, as a norm.

00:39:43.354 --> 00:39:44.794
Instead of it being like, you do what

00:39:45.499 --> 00:39:45.799
CJ: Yeah.

00:39:46.759 --> 00:39:51.079
, it's super hard to explain all
of the benefits of Prettier poet

00:39:51.079 --> 00:39:53.239
in like the way that it looks
and feels and the shape of it.

00:39:53.239 --> 00:39:56.869
So, . I'm hopeful that, uh, if this
is interesting to you or you're

00:39:56.869 --> 00:39:59.839
inspired, you go, he head over and
like check out the talk on YouTube,

00:40:00.269 --> 00:40:00.659
Colin: Nice

00:40:00.719 --> 00:40:02.339
CJ: there will be like
code examples and such.

00:40:03.149 --> 00:40:04.629
Colin: is Prettier poet open.

00:40:05.309 --> 00:40:09.059
CJ: Prettier poet is not open and that's
another thing that I'm like hopeful

00:40:09.059 --> 00:40:10.709
that we will eventually open source.

00:40:11.159 --> 00:40:11.304
Colin: Yeah.

00:40:11.724 --> 00:40:12.174
So you're

00:40:12.174 --> 00:40:12.954
you're here in Nevada.

00:40:13.044 --> 00:40:16.314
Here first, you know, or if you're
at Ruby Comp, you'll, you'll get

00:40:16.344 --> 00:40:17.544
to hear some of this as well.

00:40:17.784 --> 00:40:20.694
That's, uh, Ruby Comp is
the one that's in Texas.

00:40:20.724 --> 00:40:20.934
Is that

00:40:21.009 --> 00:40:21.579
CJ: Yes.

00:40:21.699 --> 00:40:25.869
I'm gonna go to the, yeah, Ruby Comp
Texas, because the Ruby Comp Mini, that

00:40:25.869 --> 00:40:28.689
was just in Rhode Island right down
the street, was gonna be the same time

00:40:28.689 --> 00:40:30.549
as the develop like chirp developer

00:40:30.549 --> 00:40:31.659
conference that we just missed.

00:40:31.659 --> 00:40:32.019
So

00:40:32.079 --> 00:40:32.829
Colin: Thanks Elon.

00:40:32.859 --> 00:40:33.459
Thanks Elon.

00:40:35.319 --> 00:40:35.709
Awesome.

00:40:35.709 --> 00:40:38.529
Well, I think we're at time for
today, so it's awesome to kind of

00:40:38.529 --> 00:40:41.409
dive into SDKs and all the stuff
you guys are doing at Stripe.

00:40:41.919 --> 00:40:45.579
I'm definitely gonna go take a, take
a peek at our SDKs after this and

00:40:45.579 --> 00:40:47.289
think about what we might need to do.

00:40:47.749 --> 00:40:50.319
you said you wrote them
for seven years, were not.

00:40:50.889 --> 00:40:53.919
At that point, like we're probably
gonna be handwriting ours for a while,

00:40:53.919 --> 00:40:57.699
but at least getting some eyes on our s
STKs and just thinking about how we're

00:40:57.699 --> 00:40:59.199
doing that would be, would be good.

00:40:59.649 --> 00:41:00.319
CJ: totally.

00:41:00.779 --> 00:41:04.439
The show notes for this episode
are available@buildandlearn.dev.

00:41:04.769 --> 00:41:06.269
That wraps it for this episode.

00:41:06.269 --> 00:41:06.839
Thanks everyone.

00:41:07.449 --> 00:41:08.029
Colin: See ya.