spotifyovercastrssapple-podcasts

Elm and ADD

We discuss how Elm is a powerful tool for people with ADD, and how lessons learned from ADD can benefit people who don't have ADD.
October 24, 2022
#68

Transcript

[00:00:00]
Hello Jeroen. Hello Dillon. And what are we talking about today? Today we're talking about ADD, which is an interesting topic, I think. So you came by to my place a few months ago and asked you like, can you convince my girlfriend to learn Elm?
[00:00:20]
Or help explain why I'm so enthusiastic about it. Who for context is she's a data scientist and loves Python? Yeah, well, she loves data science, not Python. But she likes it. Because she hasn't learned, she hasn't discovered Elm enough yet.
[00:00:37]
If someone would like to work on making data science available to Elm, then I would finally be able to convince her to use it. Otherwise, it's very hard. That's fair.
[00:00:50]
So the way that you chose to explain it to her, and which I would like to somewhat re simulate, is that you mentioned the ADD approach, or your way of working with code. So maybe let's start with what is ADD.
[00:01:07]
Right. And maybe before that, we should say I have ADD. And I think it's worth pointing out I am diagnosed with ADD. I am not trained psychiatric professional. So I'm not. So we're not, you know, I can share my experiences and what's what it's been like for me, writing code with ADD,
[00:01:26]
writing Elm code with ADD, how I've been able to manage that. I don't personally use medication, I know some for some people has been helpful. But I've done a lot of things to help manage my ADD. And Elm has been really compelling for me with ADD. So with that said, what is ADD?
[00:01:44]
Again, speaking from my layperson's experience with ADD, I think a lot of it has to do with your working memory. So you know, if you if you ask somebody, you know, hey, remember these, the sequence of numbers. Now let's have a conversation. Sometimes that's kind of what it feels like working with ADD when you're holding a lot in your head.
[00:02:05]
Like you feel that weight of these things that you want to make sure you're not forgetting. And there's like a, there's a there's a weight to the burden of the things you have to hold in your head. So a lot of it is related to like, the executive part of the brain. So managing time.
[00:02:23]
So I think it's hard for everyone to remember things and to keep them in your head. If you ask me, can you keep these 1000 numbers in your head right now? It's going to be very hard for me. But from what I got from your explanation from when you came by, is that the number of items that I can keep in my head is higher than yours, or at least it's going to cost me less effort to keep those in my mind than it will for you.
[00:02:51]
Right. Yes. I'm not sure if other people without ADD have this experience. But I can say for for me as someone with ADD, when you when you go to the grocery store, and you're trying to remember the list of things that you wanted to buy, you're really thinking like, am I going to forget something again, right? Because your brain just won't do it. So eventually, you learn to take a list with you write things down, as you think of things, put them there, make sure you get you get the right number of items.
[00:03:20]
Make sure you get you have everything you need to get on there. But then even so, if you're walking around, you've you've got your list, just going and making sure that you're getting everything on the list, you you keep looking at the list to make sure you have everything right. So yeah, now if you have a way to cross things off of the list and, and say, okay, this has been accounted for, then your brain can let go of it. So really, I think it's very important.
[00:03:46]
At least it has been for me to offload work from from your brain and into external systems. Because as people with ADD, it's just we don't have the ability to juggle as many things in our working memory. So we have to, you know, our RAM is not as large. So we have to write things to an external disk more often and and swap things out there. But if you get really good at using external systems.
[00:04:14]
Now, and this is this is one of the things I want to kind of address here too, for for anybody listening who, who doesn't have ADD or doesn't believe they have ADD, you know, anybody could have undiagnosed ADD, but is this relevant? So I contend that my ADD has taught me a lot of skills that are valuable for people who don't have ADD. And the analogy that I've used is that it's like a canary in the coal mine.
[00:04:43]
So, you know, back back in the day, miners would, who would be going down deep underground, you're drilling in these mountains, and sometimes there are toxic gases that come out, and they can be deadly. And so they would bring canaries. And why canaries? Because there are certain gases that don't emit a smell like methane, maybe doesn't have a sense that we can detect.
[00:05:07]
But you bring a canary down. And if the canary dies, you'd better get out of there because you don't realize that something bad is happening to you that you're being hurt, because you don't feel it. And I believe that my ADD is my canary. I know it's a very morbid analogy.
[00:05:25]
It is. I'm a little bit shocked here. I'm like, okay, it's it's a smart system. But also like there must be better ways to do it.
[00:05:34]
It's, it's pretty dark when you peel back the canary in the coal mine. But, you know, another way I think of it is, is nerves. If you, you know, if you were had the ability to prevent a child from from feeling any sort of pain being hurt, if they fall or something, it would be tempting to do that.
[00:05:54]
But then they wouldn't learn to protect themselves. When you feel pain, it teaches you in this very tight feedback loop, what not to do to exist safely as a human. So I believe that my limited, you know, cognitive like workspace is an early detection system and early warning system that lets me know when I'm placing too much burden in my working memory.
[00:06:18]
And other people lack that early detection system, which means they can get by without learning these techniques for delegating things to external systems and having systematic processes for working with things that allow them to do higher level tasks, allow them to do things with leverage because external systems let you leverage things to do more complicated tasks than you're capable of doing on your own, right?
[00:06:46]
It's like a like a pulley or these different mechanisms for physical leverage. Like if you if you're just really strong and you say, I'm just going to be strong and I can lift anything I want and you don't bother setting up pulleys or getting the materials to do so.
[00:07:02]
Well, that'll only get you so far. Maybe maybe there's somebody who's less strong and they come in and they're, you know, helping to ship cargo and move heavy items. And you know what? They're lifting heavier items because they figured out how to use pulleys to do that.
[00:07:18]
Are you saying that Schwarzenegger would not be a good engineer? Is that what you're saying?
[00:07:22]
Possibly. Possibly.
[00:07:24]
I can do it!
[00:07:25]
Necessity is the mother of invention. And so I can say at least for me, I do believe that and hope that these experiences are relevant for other people who don't have ADD because I think that they've taught me a lot of valuable skills that I've been forced to learn and approach in a very systematic way.
[00:07:45]
I believe people without ADD are not forced to do that. And so they're missing out on these really useful approaches.
[00:07:53]
Yeah, I'm curious when you say that you feel the weight, how does it feel for you? Do you get tired? Do you feel like you get a headache? Things like that?
[00:08:05]
That's a good question.
[00:08:07]
And also how quickly do you notice it?
[00:08:09]
Probably a haze and there's a little bit of avoidance. One of the big things I notice with my experience with ADD is that if something is not well defined, it repels me. So it's very important to give things clear definitions.
[00:08:31]
What do you mean it repels you?
[00:08:33]
I just want to avoid it. I don't want to look at it. If it's like, oh, I have to do something about this, but what do I have to do about it? Then I just want to be away from that thing.
[00:08:42]
Right. Yeah, I can relate to that.
[00:08:44]
Yeah, I guess everybody can to some extent. But with ADD, I mean, it's the kind of thing like and the way I think the way that people with ADD prioritize things is different than people without ADD.
[00:08:57]
You can't just brute force will yourself to put importance on something. If something isn't clearly defined and actionable, it's very hard to take action on it.
[00:09:10]
So we'll get into some of the ways that that relates to Elm. I mean, maybe we can kind of jump into that now. So I think like a few areas I wanted to address are like, first, how does Elm help somebody with ADD?
[00:09:28]
Because in my experience, it's been that's been really interesting. And then the second thing I wanted to get into is how do we make better use of Elm in order to leverage Elm for people with ADD or for people without ADD who want to have more leverage like that person who's not Arnold Schwarzenegger, but they know how to use a pulley.
[00:09:49]
They're only moderately muscular. I can only lift like 200 pounds, which I have no clue whether that's a lot or not.
[00:10:02]
Hmm. Sounds like a lot. I don't know.
[00:10:06]
Yeah, I think it sounds like a lot. Let's just say I can't count pounds.
[00:10:14]
Too much to hold in your working memory.
[00:10:17]
Yeah. So I know that's one thing that you've talked a lot about is following the compiler. I mean, I think that a lot of people like to do this in the Elm community, where you would just make a change and then follow the compiler errors.
[00:10:34]
And that is very relaxing in the sense that whatever you need to do, or most of the things you need to do, depending on how the changes made, the compiler will let you know.
[00:10:48]
So you don't have to keep things in your head about, oh, I need to remember to change this file, this file, this function call to rename this thing and to do plenty of other things.
[00:10:59]
You can just let the compiler let you know, do this, do that, and now it's all good. And then it compiles and it works.
[00:11:07]
Right. Exactly. And I talked about the importance of external systems for someone with ADD as sort of like a supplement or replacement for your working memory.
[00:11:19]
And in a sense, a compiler acts as that, especially a compiler you can truly trust.
[00:11:24]
Yeah.
[00:11:24]
And this is a very important point. So I talked about the Getting Things Done methodology. It's a book by David Allen in our productivity episode.
[00:11:36]
In fact, I talked about a lot of things that have been tools that have helped me navigate my ADD in that episode.
[00:11:43]
But I've been practicing this Getting Things Done philosophy for many, many years, and it's helped me a lot.
[00:11:50]
And I mean, one of the big ideas is to get things out of your head. And he has this concept that so he gives this example about like actionable items where he says, let's say you have like a stack of magazines.
[00:12:06]
That's not necessarily pulling at you. It's not that important.
[00:12:10]
But if you take that stack of magazines and now you put a bill that you need to pay, an urgent bill in the middle of those magazines, suddenly that entire big stack of magazines that was just noise that didn't bother you.
[00:12:25]
Now suddenly that whole stack is, oh, is there something I'm missing in there?
[00:12:28]
Yeah.
[00:12:29]
You've now tainted every single item in that pile because it's now suspect because you have no way to clearly separate out the actionable thing from the unactionable.
[00:12:40]
Imagine that it's not just one urgent bill, but it's several. So now you've got all these piles of things that aren't clearly separated between what needs action and what doesn't need action.
[00:12:50]
So you're going to go through all those magazines and they're not going to be just distracting at all.
[00:12:55]
Right.
[00:12:57]
Yeah. And there's like maybe there's something you wanted to pick out for an upcoming trip.
[00:13:05]
You wanted to glean something from a magazine and write it down, but it's kind of optional.
[00:13:10]
And then there's this other thing that's urgent.
[00:13:12]
And now suddenly everything goes into that same category of urgency or of becoming blind to it.
[00:13:19]
It's just unmanageable.
[00:13:20]
And so that's kind of how I feel with type systems that give me partial guarantees.
[00:13:27]
I feel like, OK, well, I can partially trust it, but I can't fully trust it.
[00:13:33]
And now my brain has to keep looping over to make sure I'm not missing something.
[00:13:38]
If I can 100 percent trust a guarantee, then it's out of sight, out of mind completely.
[00:13:43]
I can turn it off and my brain doesn't have to loop over it.
[00:13:46]
And so to me, there's a qualitative difference between partial and total guarantees.
[00:13:52]
Yeah, I'm guessing there's also I imagine that the way that you write Elm code will also differ because basically what you're saying is I want the types to help me out.
[00:14:04]
Right. I'm writing types so that the competitor helps me out.
[00:14:08]
And whenever I add a message variant, then the competitor will tell me, hey, you need to do this.
[00:14:14]
But you can still write Elm code in a way that the competitor won't help you.
[00:14:18]
For instance, if your message is just an Avis two strings, it's not exactly it's not idiomatic Elm code for good reasons.
[00:14:28]
But there are ways to write code in a way that will be more dynamic in a way or less statically analyzable and that the competitor won't help you, that Elm review won't help you with.
[00:14:41]
Yes, exactly.
[00:14:43]
Exactly. So, for example, like if you take parse, don't validate again, we see our parse, don't validate episode.
[00:14:50]
But for me, parse, don't validate is gold because it means you take you've reduced down the possibility space and the compiler knows that.
[00:15:00]
So instead of having to keep track of what are the possibilities in your head, you've delegated that to an external system.
[00:15:09]
So when you parse, don't validate, you're narrowing down the types to be more and more precise, more and more constrained.
[00:15:16]
There are fewer possibilities as you drill down.
[00:15:19]
And now suddenly you're in this space. And what can this be?
[00:15:22]
Well, it's one of these two things. And now you can manage that.
[00:15:25]
It's not repelling you. It's pulling you in to work with it because you're not worried that you're going to be forgetting something.
[00:15:31]
So, and yeah, I often find myself like, you know, building techniques in external systems and processes to manage ADD.
[00:15:41]
For example, like I know if I'm out somewhere and I have, you know, I have my jacket that I put somewhere or I have something on a trip that I need to remember to pack with me.
[00:15:54]
I know that I'm not going to remember when I need to bring that item with me.
[00:15:59]
So I put my keys with it because that is a guarantee that I cannot get farther than my car if I don't have that item, if I'm not reminded at the appropriate time.
[00:16:12]
And so that systematic approach, you know, as you said, like the Elm compiler gives you a tool for that and you can use that tool even more effectively to double down on that idea.
[00:16:27]
And so to me, that's what it feels like to effectively use types. I mean, think of like a case expression.
[00:16:33]
And if you do like a catchall, you lose that reminder at the appropriate time that you'll be reminded of something.
[00:16:41]
Well, where does that go? Now that goes in your head. Now your head is responsible for remembering at the appropriate time to do that.
[00:16:47]
That doesn't work for somebody with ADD.
[00:16:49]
But when you build in this alarm that's going to remind you at the appropriate time what to do, you can let go of it because you've put in an external system.
[00:16:59]
One nice thing with external systems is that you can share them, right?
[00:17:04]
You can write your code in a way that the compiler will help you.
[00:17:08]
You can't share that knowledge about, hey, if you ever do this, then you will need to do this as well.
[00:17:16]
That is possible, but harder.
[00:17:18]
Yes, absolutely. I totally agree.
[00:17:22]
Yeah, imagine like, actually, I remember briefly, I did some Rails development and for a brief period,
[00:17:31]
I worked at this Rails company before bundlers were a thing.
[00:17:36]
But bundler in Ruby being the package management system.
[00:17:41]
Okay.
[00:17:42]
Not like a JavaScript bundler.
[00:17:44]
Well, that's not confusing.
[00:17:45]
Yeah, sorry. It's a little bit ambiguous, but that was very chaotic because you say, well, it works on my machine.
[00:17:54]
Well, what version of this gem do you have installed this library?
[00:17:58]
Do you have installed on your machine?
[00:17:59]
Oh, it's at this version.
[00:18:01]
That felt so chaotic, especially as somebody with ADD.
[00:18:05]
There's all this implicit context and things are not in a repeatable automated external system.
[00:18:13]
So you have to have it in your head. You have to have it as this thing.
[00:18:16]
Every time you're thinking about something's going wrong, now you have to think,
[00:18:20]
well, am I just on the wrong version of this gem? Did I forget to update?
[00:18:24]
Do I have to do it?
[00:18:25]
Now that's another thing in your mental checklist that you have to run through every single time.
[00:18:29]
But when you have a repeatable, deterministic, externalized, automated process,
[00:18:36]
those are all ways of externalizing things so your mental checklist doesn't have to think about it.
[00:18:42]
And that's the case for your whole team.
[00:18:44]
And your whole team knows that they're on the same page and doing the same thing
[00:18:48]
and don't have to think about that space.
[00:18:50]
So for somebody with ADD, eliminating certain areas from things that you have to have on your mental checklist is huge.
[00:18:58]
But again, I contend Canary in the Coal Mine that this is a lesson that I'm able to give people
[00:19:05]
because I'm forced to learn this lesson, but other people, I believe, benefit from it.
[00:19:10]
How does debugging work for you? I feel like that would be a mess because you need to keep so many things in your mind
[00:19:18]
because you're discovering things, because you're exploring ideas, ways that the bug could have been introduced.
[00:19:25]
So I think you need to be very organized, right?
[00:19:27]
But organization and explorations are things that are hard to combine, in my opinion.
[00:19:35]
Yeah, that's a good question. I think it's probably forced me to be more systematic about approaching debugging,
[00:19:43]
but I think we can be very systematic about debugging.
[00:19:47]
I think it's very easy to get in the habit of not having a clear intention with debugging steps
[00:19:55]
and not looking at what is the search space that I'm debugging and how do I systematically reduce that search space?
[00:20:02]
How do I do a binary search through that where I'm slicing off as much search space as possible on each step?
[00:20:09]
So being required to be a little more deliberate about those things in a way,
[00:20:15]
maybe it's more natural for me because I have to approach things in a systematic way.
[00:20:22]
It reminds me of the Scaling LMAPS talk that Richie Feldman did,
[00:20:26]
where you can say, well, these functions will only look at these pieces of data,
[00:20:32]
so whatever else will not impact my code.
[00:20:36]
So this function can only do this, it can only return this,
[00:20:40]
so you can eliminate a lot of things and don't have to think about those.
[00:20:45]
Yes, exactly. And Elm is huge for that.
[00:20:49]
And I definitely find myself quite often trying to externalize the process,
[00:20:56]
so you can externalize debugging with notes, comments in your code that point out the places you need to search through,
[00:21:05]
tests, and narrowing down your search space using tests.
[00:21:10]
Also, if you think about an externalized system and also this leverage effect, unit tests.
[00:21:17]
Unit tests allow you to split work into two parts.
[00:21:22]
So the same amount of work, discovering the problem in a repeatable way and fixing the problem.
[00:21:29]
Now you break that into two steps. You're not fixing the problem right now, you're only discovering it,
[00:21:34]
you're only reproducing it. And then once you've reproduced it, you're no longer focused on reproducing it.
[00:21:40]
That part's done, it's externalized, now you are solving it or exploring how to solve it.
[00:21:47]
So unit testing is absolutely huge for people with ADD, but again,
[00:21:53]
I believe that it's extremely beneficial for teams and my ADD has allowed me to feel the pain of holding things in my head.
[00:22:03]
You can imagine, if you have a project and something breaks, you fix it, another thing breaks, you fix it,
[00:22:12]
another thing breaks, you fix it, the same thing breaks, oops, you fix it again.
[00:22:16]
If you have a robust test suite, you don't need to be somebody with ADD to benefit from having a test
[00:22:23]
that captured that thing that was broken and it stays fixed.
[00:22:27]
But it's extremely powerful leverage for someone with ADD.
[00:22:32]
So another thing about Elm that is huge for me with ADD that really...
[00:22:39]
So the thing with Elm, my experience discovering Elm, it really just clicked with me.
[00:22:46]
I became very interested in functional programming and when I discovered Elm and got into it,
[00:22:53]
it really worked for my brain and it really made sense.
[00:22:57]
So in my Rails development days, I felt very uncomfortable with the amount of magic in Rails apps.
[00:23:05]
It was very painful to work with because again, it felt like standing at a grocery store without my shopping list
[00:23:12]
written down and without remembering like, wait, did I...
[00:23:15]
Okay, I did get that thing, so am I done with that?
[00:23:18]
And looping over and over and over in my head.
[00:23:21]
That's what it felt like working with Rails magic because...
[00:23:24]
Do you have an example of Rails magic?
[00:23:26]
Yeah, just having... So Rails has this thing called method missing which allows you to invoke something
[00:23:34]
when a method is not defined, it calls method missing with the name and the arguments that it...
[00:23:40]
Something was attempted to be invoked with.
[00:23:43]
It didn't exist, but it says, well, here's your last chance.
[00:23:46]
You want to run some code.
[00:23:48]
All right.
[00:23:49]
A lot of the Rails APIs use these things.
[00:23:52]
So you have like path for users, like path underscore four underscore users,
[00:23:57]
and that would link to users.
[00:23:59]
But now that's an implicit thing that's just in the global namespace.
[00:24:02]
You just call this thing with this convention, no parameters passed to it, and it just exists.
[00:24:10]
Where does it come from?
[00:24:11]
How do you look it up?
[00:24:12]
Well, you have to either just know that it exists or find the right place in the documentation
[00:24:18]
or it's very untraceable.
[00:24:19]
And that experience for me with ADD was very painful because you have to internalize all of those details.
[00:24:27]
You have to hold them in your head constantly.
[00:24:29]
If something is externalized, you have auto completion for it.
[00:24:33]
There's a clear traceable place where it comes from and how it's used and what are the possible ways to use it.
[00:24:39]
And these are the types that it works for.
[00:24:41]
And you can't overload a method with five different ways to call it that have subtly different behaviors
[00:24:47]
based on what you pass in.
[00:24:50]
But wouldn't these be things that you would learn?
[00:24:53]
Like, oh, well, path underscore user.
[00:24:56]
At some point, you get used to the convention and you learn that it will link to the user.
[00:25:02]
Doesn't that get automatic in some way in your brain at some point?
[00:25:07]
Not really.
[00:25:08]
Like, for me, you learn it and you know it, but it takes mental effort to pull that out.
[00:25:15]
And so like with Elm, it's inputs to outputs.
[00:25:20]
And with Rails, there are all these different ways to solve a problem,
[00:25:26]
all these things you can do with, you know, global state and all of these,
[00:25:32]
like things in the framework are really designed to be very fluent for people
[00:25:38]
who learn all of these things and hold all this knowledge in their heads.
[00:25:42]
And it's just dependent on building up an internalized system, which I mean, sure,
[00:25:49]
like people with ADD can learn things and they can build up an internal mental model of things
[00:25:55]
and that doesn't necessarily take up their working memory,
[00:25:58]
but it's just a lot of implicit knowledge and also a lot of different ways
[00:26:02]
you could do things that you have to consider.
[00:26:04]
Is it approaching this problem this one way?
[00:26:06]
Is it doing this other way?
[00:26:07]
There's this implicit thing that could be affecting state or causing subtle behavior changes here.
[00:26:12]
And I mean, even if you're the most experienced Rails developer in the world,
[00:26:18]
you're going to Google things.
[00:26:19]
You're going to Google things a lot and you're not going to remember every subtle variation
[00:26:26]
of parameter types that you can pass to something in the subtle behavior differences between them.
[00:26:31]
It's designed to be like very fluent to write.
[00:26:33]
If you have this specific knowledge, you can fly through it.
[00:26:37]
But then when you're trying to make sense of what's happening,
[00:26:41]
now suddenly all those things have to be running through your brain
[00:26:45]
and you have to build up this picture of what's happening as opposed to these are the inputs,
[00:26:50]
these are the outputs.
[00:26:52]
With Elm, if you narrow down the problem in some Elm code,
[00:26:58]
you can narrow it down like is there some state problem,
[00:27:04]
is there some UI problem, is there some function that's computing the wrong value.
[00:27:09]
And you're going to eventually narrow it down to inputs and outputs or incorrect state changes.
[00:27:16]
So it's just much more constrained and much easier to externalize.
[00:27:22]
In Elm, there's a lot of things that you don't have to care about because they will not be a problem.
[00:27:27]
For instance, the fact that you don't have side effects that grants you referential transparency.
[00:27:34]
If you compute a value, then the value is the same as calling the function itself.
[00:27:40]
So you can change the two.
[00:27:43]
That can maybe make your processing data in your head a bit simpler.
[00:27:49]
But also because you don't have side effects, the order of things doesn't matter.
[00:27:54]
So you can evaluate this expression in isolation,
[00:27:59]
you can evaluate another expression next to it in isolation.
[00:28:03]
You don't have to care about, well, first I execute this thing,
[00:28:07]
that creates a global state that is like this, and then I have this state, this computation,
[00:28:13]
and now my global state is in this way, what has changed between the two, all those things.
[00:28:18]
So you can view those in isolation and then see how they are used.
[00:28:23]
Right. Exactly.
[00:28:25]
If you think about imperative versus declarative through the lens of working memory,
[00:28:32]
imperative is, you know, create a list, add this item to the list, set this flag,
[00:28:39]
oh, is this flag true? Okay, then add this item to this list.
[00:28:42]
Otherwise, add this to the list, then do this, then do this, then do this.
[00:28:46]
And to process what is happening in imperative code,
[00:28:50]
which always felt very uncomfortable for,
[00:28:54]
it required a lot of looping over things to make sure I wasn't missing a detail
[00:29:01]
in my Ruby on Rails days, to, you know, just imperatively adding something
[00:29:07]
to a list with the shovel operator and things like that.
[00:29:10]
The what? The shovel operator?
[00:29:12]
Yeah. And there are a lot of special operators and things in Ruby,
[00:29:17]
and you have to remember all of the subtleties of the different things it does
[00:29:21]
and when you're not supposed to use this because it has subtly different behavior
[00:29:25]
and what, you know, if behaves this way with these falsy values and things like that.
[00:29:31]
It's just a lot of stuff to hold in your head.
[00:29:34]
And yes, you learn them and internalize them to a certain extent,
[00:29:36]
but you're still processing that when you're thinking about where a problem could be.
[00:29:40]
Is a for loop, especially like the C style for loop,
[00:29:44]
a lot easier for you to understand or to read, I guess, than list.map?
[00:29:50]
No. Other way around.
[00:29:52]
There's a declarative. Yeah, map is easier.
[00:29:55]
Okay.
[00:29:56]
By far. And that was my gateway drug to functional programming
[00:30:00]
and to Elm was the innumerable methods in Rails and Ruby
[00:30:06]
where you can map and filter on lists.
[00:30:10]
I loved that pipeline style of processing data because it's this declarative thing
[00:30:16]
that let me look at things and say, okay, given a list with these things
[00:30:20]
in a high level thing, then call, you know, process the list in this way.
[00:30:25]
It's just much more declarative and you can chunk things where you're saying,
[00:30:30]
okay, if I understand this, if I take it at its word that this function
[00:30:35]
is doing this thing, then I can read it this way.
[00:30:38]
Instead of this imperative thing where you really have to create
[00:30:42]
this state machine in your head that's able to like execute this code
[00:30:46]
and now you're holding all this stuff in your working memory.
[00:30:49]
So declarative programming and especially with immutability
[00:30:53]
and without implicit states and things like that is amazing for people with ADD.
[00:30:59]
But I do tend to think that it's just a very manageable way
[00:31:04]
to write code for anybody.
[00:31:05]
But you can double down on that by being more declarative
[00:31:09]
and creating nice high level abstractions that describe what things are doing.
[00:31:14]
You can write Elm in a more imperative style or a more declarative style.
[00:31:19]
Joelle has talked on some of our past episodes about this idea
[00:31:26]
of extracting the let variables for conditions in a conditional.
[00:31:34]
So you can have high level names for them instead of just having like
[00:31:38]
direct code in your if conditions and having things at the same level
[00:31:43]
of abstraction where you have like, you know, if variable then function call
[00:31:50]
else if variable then function call.
[00:31:53]
And now you read that at one level of abstraction where everything
[00:31:58]
flows at a very high level and if you want to dive into more detail, you can.
[00:32:03]
That means less to hold in your working memory.
[00:32:06]
So that is a very powerful technique for people with ADD
[00:32:10]
and that's a way you can double down on that style with the way you write your Elm code.
[00:32:16]
One thing that I'm wondering about is that Elm has a lot of boilerplates, right?
[00:32:20]
Compared to other languages.
[00:32:22]
Is that harder for you to understand than magic that would prevent that boilerplate?
[00:32:29]
Because it's a lot of code, it's dumb code, right? Very often.
[00:32:34]
But it is still code that you need to read and to get into your mind.
[00:32:38]
Yeah.
[00:32:39]
Do you think that is easier or harder to understand than something that abstracts it?
[00:32:44]
Like code generation or macros or magic?
[00:32:47]
That's a good question.
[00:32:48]
Well, I think magic can change the mental model and require exceptions
[00:32:55]
in the way you think about something.
[00:32:57]
Whereas Elm, it's like, yeah, there's a JSON decoder somewhere
[00:33:02]
that is doing something with a lot of code, you know.
[00:33:06]
But it doesn't break my mental model about what's happening.
[00:33:10]
There's something that takes this data type and turns it into this other data type
[00:33:15]
and that's what everything is.
[00:33:17]
And so, you know, it doesn't break my mental model and add things to hold in there.
[00:33:22]
There's like a very simple set of core primitives that we have to work with
[00:33:27]
and everything follows the same simple set of rules.
[00:33:31]
So, like, for example, I find it very uncomfortable to work with code
[00:33:39]
that might throw an exception.
[00:33:41]
It's just like extremely anxiety inducing, like, you know, working with JavaScript code,
[00:33:47]
which I do a fair amount, like, you know, working on like Elm pages and things like that.
[00:33:52]
There's plenty of, you know, as you know, when you love Elm enough,
[00:33:57]
you often sacrifice yourself to write JavaScript for people to enjoy Elm more.
[00:34:03]
And when there's like, oh, does this code throw an exception or not, right?
[00:34:08]
That's like a subtle exception, you know, like a literal exception
[00:34:13]
to the mental model of this code from top to bottom, runs through and executes these things.
[00:34:20]
Unless something throws an exception, then that could stop the flow of execution
[00:34:26]
unless something catches it above the calling point and that could change the flow there.
[00:34:32]
So, when it's just like, hey, this thing returns a data type,
[00:34:36]
you can do, you know, you can do pattern matching and case expressions on data types
[00:34:42]
and do code flow based on that data type.
[00:34:45]
But at the end of the day, it does return this data type and the calling function
[00:34:51]
does receive that data type and can choose to do something based on the data type it receives.
[00:34:56]
It's one flow, it's one mental model, and it's not these, I mean, to me, like,
[00:35:02]
exceptions feel very much like go to statements in the sense that suddenly it breaks the mental model
[00:35:09]
of the flow of your code and introduces a new paradigm to them.
[00:35:13]
And to some extent, there are, just a go to, a conditional go to, like only go to if you have an error.
[00:35:21]
Exactly, exactly, which is in a way like more complicated to think about.
[00:35:25]
And then you have to have the context of like, well, what does, like, does it go to this place?
[00:35:30]
Because is it being handled elsewhere or not?
[00:35:34]
If there's an exception at this line, then what is the global state?
[00:35:37]
And if I throw an exception on this line, is the state different?
[00:35:40]
Exactly, right?
[00:35:42]
And so, like, I mean, you don't have ADD, but you feel the pain, right?
[00:35:46]
Oh, yeah, yeah, absolutely.
[00:35:47]
It's not just me, like, it's painful.
[00:35:49]
But for somebody with ADD, you really feel that.
[00:35:52]
And so Elm is incredible for that reason.
[00:35:54]
So there's a lot of things that I find like easier to read, easier to understand,
[00:35:59]
and I feel like they often complement your, an ADD person's mind.
[00:36:05]
But it's hard for me to understand where lies the line between this is easier
[00:36:12]
and this is less things to hold in your head.
[00:36:15]
Yep.
[00:36:16]
Right.
[00:36:17]
That's what I'm trying to figure out with this conversation.
[00:36:20]
Yeah.
[00:36:21]
So you said that there's a lot of less things in Elm, right?
[00:36:24]
There's inputs and outputs, and from there on, you basically have the same things over and over again.
[00:36:31]
And that's partially due to Elm's design, no side effects, immutability all the way.
[00:36:36]
But also, Elm is a very simple language, right?
[00:36:39]
There are few things, few constructs.
[00:36:43]
You only have, if you want branching, you only have if,
[00:36:47]
you only have case expressions and function calls, recursion.
[00:36:53]
That's pretty much it, right?
[00:36:55]
Does the fact that Elm is a very simple language make it easier?
[00:36:59]
Yes.
[00:37:00]
Or is it just, well, it's easier, but it doesn't reduce the number of things in my head?
[00:37:05]
No, it's both.
[00:37:07]
I mean, it's easier because there are, I mean, it's like that checklist at the grocery store.
[00:37:13]
You're standing there with the checklist, and it's a lot of effort to keep looping over things
[00:37:18]
because you know you might miss something, you might forget a detail.
[00:37:21]
You're looking at your list and trying to figure out which ones do I have already taken.
[00:37:27]
And every time you look at one item, you look in your baskets,
[00:37:31]
and you say, okay, I have it, and the next one.
[00:37:34]
Exactly.
[00:37:35]
And in other languages, you would have four baskets to look into instead of one.
[00:37:40]
Right.
[00:37:41]
And even better, if you have like a list on your phone,
[00:37:44]
and as you check things off, you know, I check this off, it goes out of my list,
[00:37:49]
I'm no longer looking at it, I know it's in my basket.
[00:37:53]
And when there's nothing left on the list that's visible,
[00:37:55]
then I go pay for it, and I'm good, and I know I didn't miss something up.
[00:37:59]
You've externalized that process, and that's what it feels like with Elm.
[00:38:03]
But, you know, you, so like there are fewer language features to think about.
[00:38:10]
Is there some exception to this rule?
[00:38:12]
There's less state, there's less, you know, like an if takes a Boolean,
[00:38:17]
and a type is explicit about, you know, it's a tagged union type.
[00:38:22]
It can't be any type, you can't cast it, it can't break the rules.
[00:38:26]
You, you know, you have, you have just a much more constrained system.
[00:38:31]
You don't, you don't have to worry about using double equals or triple equals.
[00:38:35]
You don't have to worry about, and even just like the design
[00:38:39]
of the standard APIs and all these things.
[00:38:41]
And it's really like, I was just, I was just working on something in Elm pages
[00:38:46]
with the v3 API for managing cookies.
[00:38:50]
And there, so there's this, there's this flag you can set on a cookie for HTTP only.
[00:38:57]
If a cookie is HTTP only, then it can't be read through JavaScript,
[00:39:02]
which is a potential attack vector that you remove.
[00:39:05]
So if you can only manage reading state on the server side,
[00:39:09]
then you can reduce a vector there.
[00:39:13]
So I made a tweak where, like in the browser platform, it's an opt in flag.
[00:39:19]
You, if you add HTTP only, then it won't be visible in JavaScript.
[00:39:24]
If you do document.cookies, but I made it in, in the Elm pages API,
[00:39:29]
I made it opt out.
[00:39:30]
So by default, the initial settings for, for creating a cookie is HTTP only.
[00:39:38]
And then you can set a flag and you say exposed to JavaScript.
[00:39:42]
And so if you think about the workflow, somebody is going to be creating cookie
[00:39:46]
options if they're intending to use it from JavaScript, then they're, you know,
[00:39:50]
and they haven't used that API or forgot how it works.
[00:39:53]
They're going to run their code.
[00:39:55]
They're going to try accessing in JavaScript.
[00:39:57]
It's not going to work.
[00:39:58]
Then they're going to look at the docs for that and say, did I do something wrong?
[00:40:02]
And then they're going to see opt in to JavaScript.
[00:40:04]
So that's just a subtle design choice that makes it safe by default and sane
[00:40:10]
by default, and that I think is an undervalued, underappreciated aspect of,
[00:40:17]
of Elm is how sane and well thought out the core APIs are and the package ecosystem.
[00:40:23]
There's so much love that's put in by package and framework authors to making
[00:40:29]
these subtle design decisions that make it more intuitive to do the right thing
[00:40:33]
and constrain the space to be a valid space to make impossible states,
[00:40:38]
impossible states, impossible to, to just make it safer and saner to work with.
[00:40:42]
And that makes a huge difference because suddenly that's, you know, that's not this
[00:40:48]
like PTSD experience where you're like, okay, I've been bitten by this operator
[00:40:53]
before.
[00:40:54]
I forgot to use triple equals here and, and you just have to constantly
[00:40:57]
hold that in your head.
[00:40:58]
So is condition something that gets easier with programming experience?
[00:41:03]
For instance, do you get less distracted by things that you have become familiar
[00:41:07]
with, like for instance, the some pieces of magic in language or even just the
[00:41:12]
syntax of a language, right?
[00:41:14]
I think a very clean mental model is just qualitatively different.
[00:41:19]
Like you, there are certain models of programming that require you to hold more
[00:41:24]
in your head, and I think you can design your code in a way that it requires you
[00:41:28]
to hold less in your head as well.
[00:41:30]
And, and, you know, for example, I think opaque types are huge for reducing what
[00:41:35]
you hold in your head.
[00:41:36]
So you, I mean, if you think about, so, so I've mentioned the getting things done
[00:41:41]
philosophy, and I think it's really at its core.
[00:41:45]
The idea of the getting things done philosophy is get it out of your head and
[00:41:50]
into a trusted system.
[00:41:52]
That is like the whole that that's it.
[00:41:54]
If you understand that you understand the philosophy.
[00:41:57]
So the idea is like your brain will keep bugging you about something.
[00:42:02]
If you have something you're like, oh, I have to buy batteries.
[00:42:05]
Your brain is going to keep remembering that, but not at a convenient time.
[00:42:10]
It's going to remind you in the middle of the night when you're, you can't do
[00:42:14]
anything about it.
[00:42:15]
But if you have your grocery list, now, if you have a grocery list and it's
[00:42:19]
shoved off in a corner, it's shoved off in your pile of magazines, that's not
[00:42:22]
a trusted system.
[00:42:23]
A trusted system is a system, you know, will present you with the appropriate
[00:42:28]
thing at the appropriate time.
[00:42:29]
And so if you have a trusted system, you have a grocery list and you trust
[00:42:34]
yourself to see that at the appropriate time when you're at the grocery store
[00:42:39]
and can buy batteries.
[00:42:40]
It's trusted because the habits you build that that is your system.
[00:42:44]
You go to the grocery store and you use that list.
[00:42:47]
So you trust that you will get there.
[00:42:49]
Now, in the middle of the night, your brain isn't going to remind you of
[00:42:52]
that.
[00:42:53]
It's going to let go of that.
[00:42:54]
So you get it out of your head and into a trusted system.
[00:42:57]
And to me, that is what the Elm compiler allows me to do.
[00:43:02]
And that is what opaque types allow me to do even more.
[00:43:05]
If I can have an opaque type and I say, OK, well, this is a username.
[00:43:08]
Well, is this a valid, is this string a valid username?
[00:43:11]
Did I remember to to check that it's valid?
[00:43:14]
Am I going to be presenting this thing in the wrong place and pretending it
[00:43:20]
or is it an empty string or is it a guest logger or whatever it is?
[00:43:23]
Opaque types allow you to put it into an externalized trusted system.
[00:43:28]
And to me, that is the power of opaque types.
[00:43:31]
It reduces the space where you have to think about something and where you
[00:43:36]
don't have to think about something.
[00:43:37]
It's putting the urgent items in the stack of magazines versus having it
[00:43:43]
in a trusted system where these are the things you know you need to be
[00:43:46]
focused on and need your attention right now and everything else does not
[00:43:51]
urgently require your attention.
[00:43:54]
Now onto a topic that I don't care at all, linting.
[00:43:58]
Yeah.
[00:44:00]
So a lot of linters one way or another through code formatting, code linting,
[00:44:05]
code style linting or enforcing code style rules, they basically try to
[00:44:11]
make your code consistent, right?
[00:44:13]
Yeah.
[00:44:14]
And I feel like that would probably help you, right?
[00:44:17]
Yeah.
[00:44:18]
Because you get less unexpected code constructs and you can go from one
[00:44:25]
pattern that you know to another pattern that you know because it's the same.
[00:44:28]
So do you try to have some pretty exhaustive linting rules when you code
[00:44:35]
usually?
[00:44:36]
Yeah, I mean, definitely.
[00:44:38]
Having the no unused Elm review checks are amazing for that.
[00:44:44]
I mean, just for one thing, just for the process of tidying up your code,
[00:44:50]
it's really nice to have that, you know, helping you do that, to have that
[00:44:55]
assistant to help you.
[00:44:56]
That's one less thing to have to be cognizant of.
[00:44:59]
So you don't have to have that in your mental checklist.
[00:45:02]
Oh, make sure if I delete some, if I stop using something, I have to be
[00:45:06]
thinking about am I removing it?
[00:45:07]
But also, if you trust that there is a tool that at every small step is
[00:45:15]
removing unused code, that's another thing that simplifies the mental model
[00:45:20]
of how you reason about your code because, oh, there's this bug.
[00:45:23]
Well, here's this function that looks like it could be suspicious.
[00:45:27]
Is it getting called anywhere?
[00:45:29]
You don't have to ask that question.
[00:45:30]
That's one less question you have to ask.
[00:45:32]
And this is a very cumulative effect.
[00:45:34]
So something that seems like a tiny cognitive load adds up over time.
[00:45:40]
And again, you know, I think these, you know, ADD gives you more nerves
[00:45:46]
for sensing that cognitive load and any everything helps.
[00:45:50]
It's cumulative.
[00:45:51]
And the more you can reduce that, I mean, we all have a small working
[00:45:56]
space in our minds.
[00:45:57]
That's just a fact of the human mind.
[00:46:01]
And I believe we're all more powerful when leveraging external systems.
[00:46:07]
That's one of our superpowers as humans.
[00:46:10]
And so using that makes us stronger.
[00:46:14]
And yeah, a linting tool, Elm Review, is an external tool.
[00:46:19]
It's an additional tool that removes some of those things from our
[00:46:24]
working memory and holding it in our head into a trusted system.
[00:46:27]
Now, that said, yes, it's trusted.
[00:46:29]
Trusted system, it's only as trusted as you make it through automation
[00:46:36]
and a consistent workflow.
[00:46:38]
So, for example, like to me, I would say that a code formatter, a linter
[00:46:44]
Elm Review that is applied in a non systematic, non automated way.
[00:46:50]
It doesn't run in CI.
[00:46:52]
It's run occasionally.
[00:46:53]
But like, there's not really a quick feedback mechanism or anything
[00:46:57]
that's like sometimes it just doesn't get called and there's just,
[00:47:00]
oh, this code didn't get formatted.
[00:47:02]
And then somebody goes on this code base and saves it.
[00:47:05]
And there's this diff that has all these changes or something.
[00:47:07]
That is not a trusted system.
[00:47:09]
It's not a system at all.
[00:47:11]
It is trusted.
[00:47:13]
If you remember that you have to run it.
[00:47:15]
Exactly.
[00:47:18]
Exactly.
[00:47:19]
So if you're requiring your brain to be the trusted system, then that
[00:47:24]
is not ADD friendly.
[00:47:25]
I think it's not brain friendly in general, personally.
[00:47:28]
And not seem friendly as well.
[00:47:31]
Exactly.
[00:47:32]
Exactly.
[00:47:33]
So I think it's crucial that you have your source of truth and that
[00:47:38]
that be your trusted system.
[00:47:39]
And also the more you can make things actionable.
[00:47:44]
So again, like getting things done, getting things done, if anybody
[00:47:49]
listening has ADD and has not read getting things done, there are
[00:47:53]
definitely some details about managing paper based systems.
[00:47:57]
I think there's an updated version that's like a little less paper
[00:48:00]
based, but there's so much gold in just how to think about working
[00:48:04]
with your brain.
[00:48:05]
So what about code style?
[00:48:08]
So Elm Review is not very keen on code style rules because we have
[00:48:14]
Elm formats.
[00:48:15]
But recently, like someone realizing that there's difference between
[00:48:19]
code style and code layouts.
[00:48:21]
Yeah, code organization.
[00:48:24]
Yeah, which functions to use versus how is this curly brace positions
[00:48:31]
compared to something else.
[00:48:34]
Yeah.
[00:48:35]
So a lot of lenders have a lot of rules on how to enforce code style
[00:48:40]
and code formatting.
[00:48:42]
Does that part, is that part useful as well?
[00:48:45]
Yeah, I mean, it's one less thing to be thinking about, to be juggling
[00:48:50]
in your head.
[00:48:51]
I remember, again, in my Ruby on Rails days, I'm sure this has
[00:48:55]
changed with automated formatters now, but I remember spending a lot
[00:48:59]
of time in code reviews talking about subtle style changes.
[00:49:03]
It's just more to think about and more distractions.
[00:49:07]
So yeah, the more you can build those things in to be things that
[00:49:11]
are automated and taken care of for you, it's going to be more
[00:49:15]
manageable.
[00:49:15]
So like automation is huge and it's getting things done has this
[00:49:21]
concept of amorphous blobs of undoability, they call it.
[00:49:25]
And I love that phrase.
[00:49:27]
Say it again.
[00:49:28]
Amorphous blobs of undoability.
[00:49:30]
Actually, we talked about this briefly on our productivity episode.
[00:49:34]
The idea is that if something is not clearly defined in an actionable
[00:49:38]
way, it will repel you.
[00:49:40]
And that's very true for me with my ADD.
[00:49:42]
So if you say like the classic example, I probably gave this
[00:49:46]
example in our productivity episode, would be mom's birthday.
[00:49:49]
If you have that written down on the list, you're going to be
[00:49:52]
having a lot of anxiety about what about mom's birthday?
[00:49:55]
And for somebody with ADD, you shove that off somewhere and don't
[00:49:59]
think about it.
[00:50:00]
But now if you change it to so getting things done would call this
[00:50:04]
processing that item, turning it into something actionable, a
[00:50:07]
physical actionable next step.
[00:50:09]
Like, what are you doing about mom's birthday?
[00:50:11]
Are you planning a surprise birthday party?
[00:50:13]
And what is the next thing you do for that?
[00:50:15]
Are you sending out an email to somebody?
[00:50:17]
Or are you buying flowers?
[00:50:19]
Or what is the actionable thing?
[00:50:21]
So you say, OK, buy flowers and a card for mom's birthday.
[00:50:24]
Now you're like, OK, I need to go to the store and buy flowers and a card.
[00:50:29]
Now that's your actionable thing.
[00:50:31]
And it's not repelling you.
[00:50:32]
So having things be actionable is huge.
[00:50:36]
And sometimes when things are when you don't have clearly defined
[00:50:40]
styles, it feels like that's another thing you have to think about.
[00:50:44]
Like, what is what is the next action I'm going to take when you
[00:50:48]
don't have like a clear guide for organization?
[00:50:51]
You know, things like a style guide or a clear process for how you're
[00:50:56]
doing something can really help with those things.
[00:50:58]
And I think it can benefit any organization if you have, you know,
[00:51:01]
a clear set of steps for doing something and then automate it as
[00:51:05]
much as possible.
[00:51:06]
That clarity can help the whole team.
[00:51:08]
It's not just something you have to reinvent every time.
[00:51:11]
Like, that's a lot of effort.
[00:51:13]
And the way our brains work also, like, you know, there's the
[00:51:17]
there's the hardware and the software.
[00:51:19]
Like, the hardware is our habits.
[00:51:21]
And if you can burn something into a habit, it requires less exertion
[00:51:26]
and less willpower.
[00:51:27]
And there's less of a cost on our brains.
[00:51:30]
So I think that benefits any team to, you know, to be a little more
[00:51:33]
systematic, you know, not micromanaging people, but figuring out
[00:51:38]
effective processes that reduce the amount of things you have to
[00:51:42]
reinvent every single time.
[00:51:43]
Yeah, that brings me to another point that I was going to ask.
[00:51:47]
So we've talked about things to make it easier for you with ADD or
[00:51:52]
without ADD to work with code and doing your groceries.
[00:51:58]
What would you do if you had someone on your team with ADD or lack of
[00:52:03]
attention problems?
[00:52:05]
Would you change?
[00:52:06]
Yeah.
[00:52:07]
What would you change to your code or to your process?
[00:52:10]
You said automation.
[00:52:11]
That absolutely.
[00:52:12]
Would you write shorter functions?
[00:52:14]
Would you have meaningful names?
[00:52:17]
Basically, what else?
[00:52:19]
Except what people just call better code.
[00:52:21]
Right.
[00:52:22]
Well, I mean, to me, it's very hard to separate the two.
[00:52:26]
In fact, I've sort of like built my career around that concept.
[00:52:30]
Like, in a sense, I'm like, you could call me an ADD consultant or
[00:52:35]
like a technical practices consultant, right?
[00:52:38]
Like, what's the difference?
[00:52:39]
That's my secret sauce that I use my ADD as my canary to discover
[00:52:46]
these systematic approaches that I can then teach.
[00:52:48]
And now it's software craftsmanship.
[00:52:50]
Ta da.
[00:52:51]
But yeah, I mean, writing things down and getting them out of your
[00:52:59]
head is very effective.
[00:53:01]
Like, for people with ADD, having things in a continual state of
[00:53:07]
completion is amazing for ADD.
[00:53:09]
You know, we've kind of talked about that in the context of shipping
[00:53:12]
side projects.
[00:53:13]
Like, for me, if I have code in a place where I can step away from
[00:53:17]
it anytime, there's a talk by Llewellyn Falco that I believe you
[00:53:22]
might have watched this one.
[00:53:23]
It's called Practical Refactoring.
[00:53:25]
Llewellyn Falco and Woody Zuhl set up a five minute timer.
[00:53:30]
Oh, yeah, yeah, yeah.
[00:53:31]
And then they do refactoring on a code base that, you know, is a
[00:53:36]
legacy complicated code base.
[00:53:38]
And they do these refactoring steps without understanding the code.
[00:53:42]
So rather than saying, OK, let's understand the code so that we can
[00:53:45]
then change the code, they say, let's change the code so we can
[00:53:49]
understand the code.
[00:53:50]
If you think about that through the lens of ADD, what does it mean
[00:53:55]
if you have to understand the code so you can change the code?
[00:53:57]
It means it's more amorphous undoability.
[00:54:01]
What are my next steps?
[00:54:03]
There are all these things combined together.
[00:54:05]
It's more working memory space.
[00:54:08]
You have to hold in your head, what is it doing before you can refactor?
[00:54:12]
But then you also have to be thinking about, what am I going to refactor?
[00:54:14]
Yeah, exactly.
[00:54:16]
You're not leveraging things.
[00:54:17]
You're doing two steps in one.
[00:54:19]
And also, like, what are the possible consequences of your changes?
[00:54:23]
Are they going to be problematic in some way?
[00:54:26]
Do you have something to worry about?
[00:54:28]
Additional steps that you will have to do afterwards?
[00:54:31]
Exactly.
[00:54:32]
So now you're looping over that checklist in your head.
[00:54:34]
Every single step you're making, you're looping over that checklist.
[00:54:37]
Now flip that on its head.
[00:54:39]
And now we're going to change the code so we can understand it.
[00:54:43]
So what does that mean?
[00:54:45]
It means we have to do safe changes.
[00:54:47]
What do safe changes mean?
[00:54:49]
They mean you don't have to understand it in order for it to be safe.
[00:54:54]
Because you're using an automated tool to change a method name.
[00:54:58]
You are using an automated tool to extract a variable.
[00:55:02]
And those are safe.
[00:55:03]
You don't have to do anything else than just activating that refactor.
[00:55:07]
And following the compiler's errors,
[00:55:11]
and he's introduced by that,
[00:55:14]
if you rename something and then it tells you,
[00:55:17]
oh, there's now a shadowing error,
[00:55:19]
okay, well, now I know what to do.
[00:55:21]
I don't have to think about it.
[00:55:23]
If there will be a shadowing error, I will be notified.
[00:55:26]
Right, exactly.
[00:55:27]
Yeah, and you can use these safe refactoring steps.
[00:55:30]
You know, Martin Fowler's book refactoring talks about
[00:55:34]
the manual steps of what a safe refactoring looks like.
[00:55:38]
For example, introducing a new function and things like that.
[00:55:42]
And ideally, your tool is safe.
[00:55:45]
Your tool does have these things built into it,
[00:55:48]
so it's offloaded from your head.
[00:55:49]
It's externalized into a system that you trust.
[00:55:52]
But if not, a close second would be doing repeatable safe steps.
[00:55:57]
As you say, you know the things to check.
[00:55:59]
You know the one thing you're focused on.
[00:56:02]
And so I'd say that's huge, is working in that way.
[00:56:05]
I highly recommend that people check out this video practical refactoring.
[00:56:09]
They put on a five minute clock, and at the end of the five minute mark,
[00:56:13]
they have to be in a committable state,
[00:56:15]
where they could ship it to production and it goes live.
[00:56:18]
And that is extremely powerful.
[00:56:20]
The idea was that you could do this before a meeting or something
[00:56:25]
and then be done right.
[00:56:26]
Exactly.
[00:56:27]
And if you think about that from an ADD perspective,
[00:56:29]
if you say, hey, I can walk away from this,
[00:56:32]
well, what are ADD people known for?
[00:56:34]
Getting distracted by shiny objects?
[00:56:36]
Well, yeah, that's kind of true.
[00:56:39]
But if you design your workflow in a way that you can walk away from it
[00:56:43]
at any time, that is huge.
[00:56:45]
It turns out that it also just makes the next steps more clear
[00:56:50]
because you start by reducing the number of things
[00:56:54]
you need to hold in your head,
[00:56:56]
and then suddenly things are more clear and your next steps become more clear
[00:56:59]
and you're thinking about one step at a time, breaking things down.
[00:57:02]
So yeah, I highly recommend that video.
[00:57:05]
Now, there are organizational things often that need to happen
[00:57:09]
in order to get to that state, right?
[00:57:11]
And that's sort of what I did in my past career as an agile coach
[00:57:16]
was helping teams and organizations with these kind of big boulders
[00:57:21]
that you have to move to make that possible, right?
[00:57:23]
Like, oh, well, this team doesn't have permission to touch this area of code
[00:57:27]
or to ship this or to make this change or to...
[00:57:29]
Or we don't have the automation to deploy to production
[00:57:33]
without doing a two week QA process first.
[00:57:37]
Those aren't things you can flip a switch and change overnight.
[00:57:40]
Those are processes that you need to really deliberately work on as an organization.
[00:57:45]
But I think they're essential for an effective software process
[00:57:51]
and particularly helpful for people with ADD, but for everybody.
[00:57:55]
Quick feedback loops, right?
[00:57:57]
Yeah, exactly. And quick feedback.
[00:58:00]
You know, another thing for people with ADD,
[00:58:02]
if you have... People with ADD tend to have this concept of time blindness
[00:58:08]
where it's hard to see the bigger picture and piece things together
[00:58:13]
and just take a large task.
[00:58:16]
That's a lot to hold in your head and it's too much to process.
[00:58:20]
So it really helps if you break things down into smaller milestones
[00:58:23]
and it also helps with the motivation if you have lots of small wins.
[00:58:29]
And so that's huge for people with ADD.
[00:58:31]
So if you can chunk things down into small wins,
[00:58:34]
a commit is a small win, a tiny slice of a feature is a small win
[00:58:39]
that is shipped to production, by the way.
[00:58:42]
If it is a tiny commit to one system that is not going to be used
[00:58:47]
until one month of QA at the end of the year,
[00:58:51]
that doesn't feel like a win for somebody with ADD.
[00:58:55]
And it's not a win for the company either
[00:58:58]
because nobody's getting value from that code you wrote.
[00:59:01]
Yeah, because you will have to remember all the things that you did
[00:59:05]
when QA comes back.
[00:59:07]
Exactly. And you might have messed something up
[00:59:11]
and you will find out about it later.
[00:59:13]
And now that's another thing you have to hold in your head.
[00:59:15]
So the faster you can validate things,
[00:59:17]
the faster you can get them out of your head
[00:59:20]
and move on to focusing on the next thing
[00:59:23]
without being pulled by this distraction of,
[00:59:26]
did I mess something up?
[00:59:27]
Do I have to have this checklist and keep this in my head?
[00:59:30]
You can let go of it.
[00:59:31]
So what is time blindness?
[00:59:33]
Time blindness, it just, you know,
[00:59:35]
people with ADD tend to do things last minute
[00:59:38]
because their sense of time is skewed
[00:59:43]
and it's harder to manage.
[00:59:46]
From what I understand, ADD is related to the executive functioning
[00:59:51]
in your brain and impulse control.
[00:59:54]
And so some people might hear a distraction
[00:59:58]
and be aware of its existence, but not like,
[01:00:01]
oh, hey, that reminds me of this other thing I want to talk about.
[01:00:04]
Somebody with ADD is going to go off
[01:00:07]
and they're not going to filter that out
[01:00:10]
and they're not going to filter those distractions
[01:00:12]
so they can't filter out those noises and say,
[01:00:15]
this is the thing I'm focused on, not that sound I heard.
[01:00:18]
And their sense of time is,
[01:00:22]
they're not as good at managing time
[01:00:24]
and chunking things in to manage that effectively.
[01:00:27]
So suddenly a talk that you were going to give five months from now
[01:00:32]
is a talk that you're going to give tomorrow, for example.
[01:00:35]
It's that concept of time,
[01:00:38]
it's hard to kind of break it into those milestones.
[01:00:40]
So it's very helpful to do that in external systems
[01:00:42]
where you're getting rewarded for those things,
[01:00:45]
where you're feeling the joy of accomplishing those smaller milestones
[01:00:49]
and especially if they're real accomplishments
[01:00:52]
where you've actually done something.
[01:00:54]
Maybe the big conference talk you're giving,
[01:00:57]
maybe you give a meetup talk
[01:00:59]
and that's like an intermediary milestone
[01:01:01]
that represents a meaningful thing that you've accomplished
[01:01:04]
but it brings that time scale more into focus
[01:01:08]
because it's very hard to see time clearly in the big picture.
[01:01:12]
So I have not been diagnosed with ADD,
[01:01:15]
but I do feel like I have a lack of attention.
[01:01:18]
I'm guessing a lot of people listening to this will also feel like that.
[01:01:22]
How does one get diagnosed with ADD?
[01:01:25]
Oh, that's a good question.
[01:01:27]
I mean, I'm very much not an expert on this.
[01:01:29]
I was diagnosed in high school.
[01:01:31]
I'm guessing it will also depend on your country.
[01:01:34]
Yeah, your country. There are like online services,
[01:01:37]
but from what I've heard, there can be a sort of financial incentive
[01:01:41]
for them to tend to diagnose you
[01:01:44]
and so it might not be the most honest way to diagnose yourself.
[01:01:47]
So I don't think I can give effective advice on that one.
[01:01:51]
I think people are going to maybe need to do some research on that themselves.
[01:01:55]
But it's definitely a very interesting thing to know
[01:01:58]
and I will again recommend to anybody getting things done as a goldmine.
[01:02:02]
So if you feel this type of pain,
[01:02:06]
I would highly recommend checking out the book, Getting Things Done,
[01:02:09]
or audiobook if that's easier for you.
[01:02:11]
And I would highly recommend watching
[01:02:14]
Llewellyn Falco and Woody Zool's Practical Refactoring Talk.
[01:02:18]
Those things have really changed the course of my life.
[01:02:21]
A lot of these strategies, I'll also say like in a non technical sense,
[01:02:25]
like regular exercise for people with ADD can be huge
[01:02:29]
for having more ability to, you know,
[01:02:33]
you just feel more grounded and regulated
[01:02:37]
and it's easier to focus.
[01:02:40]
Meditation can be extremely powerful, mindfulness meditation.
[01:02:44]
I've also come to really embrace some of these ways that my brain works
[01:02:49]
and rather than feeling guilt or shame about them,
[01:02:53]
I've just learned like these things are things I know about myself.
[01:02:58]
I know I'm setting myself up for success when I take that into account
[01:03:02]
in the way I do things and when I put things into external systems
[01:03:06]
and I just accept that there's no shame about it.
[01:03:10]
It's just this is how I work best.
[01:03:13]
And so I need to like if I want to remember to pack things for my trip,
[01:03:21]
I need to write a list. It's not a big deal.
[01:03:24]
It's just something I need to do.
[01:03:26]
I have a much clearer picture now.
[01:03:29]
Do you have anything else that you want to ADD to the topic?
[01:03:36]
Are you trying to distract me with shiny new topics, Jeroen?
[01:03:39]
Shiny new puns.
[01:03:41]
I know that will distract you.
[01:03:44]
That's fair. That is fair.
[01:03:47]
Yeah, I mean, I would love to hear other people's experiences with ADD
[01:03:52]
or without ADD.
[01:03:54]
Do people subscribe to my canary in the coal mine theory?
[01:03:58]
Every time you say that, I feel like you're going to kill a bird.
[01:04:01]
It's just it's horrible.
[01:04:03]
No birds were harmed in the making of this podcast.
[01:04:06]
But please don't mine.
[01:04:11]
Yeah, so I wonder if I've now been exposed as a secretly
[01:04:18]
is Elm Radio actually just an ADD podcast?
[01:04:21]
Because we're kind of talking about the stuff that we normally talk about.
[01:04:26]
That is true.
[01:04:29]
Yeah, so, you know, if anybody listening to this wants to learn more,
[01:04:34]
check out our productivity episode.
[01:04:37]
We talked about a lot more specific things that, you know,
[01:04:41]
Pomodoro Technique and some useful tips there.
[01:04:44]
Listen to our incremental steps episode.
[01:04:46]
That one's huge.
[01:04:48]
And I feel like we have a lot of episodes that go into that direction as well.
[01:04:53]
Absolutely.
[01:04:54]
Big types. Always listen to our big types.
[01:04:57]
Mandatory listening.
[01:05:02]
And get things out of your head into a trusted system.
[01:05:05]
Write notes, separate actionable notes from non actionable notes
[01:05:09]
or a, you know, to do list.
[01:05:12]
I really like keeping a to do list as I write my code.
[01:05:14]
That really helps me stay on track and stay focused and slice things down
[01:05:18]
in smaller pieces.
[01:05:19]
Keep that looping checklist out of my head so I can focus on the task at hand.
[01:05:24]
So and just, I mean, yeah, Richard's scaling Elm applications talk
[01:05:31]
really hits at this too.
[01:05:33]
It's about reducing down the possibility space,
[01:05:37]
you know, reducing down the constraints of what data you might be dealing with
[01:05:42]
in a function. Parse don't validate.
[01:05:45]
Opaque types.
[01:05:46]
Making the impossible states impossible.
[01:05:48]
Making impossible states.
[01:05:49]
If it's impossible, then it's out of your head.
[01:05:52]
If it's improbable, then it's in my head.
[01:05:56]
I will tell you that.
[01:05:57]
Yeah, actually most of the good techniques that we love in Elm are valuable, right?
[01:06:03]
In this context.
[01:06:04]
Very much so.
[01:06:05]
Yeah.
[01:06:06]
So if anybody listening to this has ADD, I would love to hear more about your experiences
[01:06:11]
and your room.
[01:06:13]
Until next time.
[01:06:14]
Until next time.