Latest / The Hedge / Best of the Hedge: 18, Programming Skills for Network Engineers
Transcript
- 0:00- Join us at The Hedge for a conversation
- 0:02- about engineering,
- 0:03- technology, and business.
- 0:05- In this episode, Russ White, Tom Ammon, and
- 0:08- David Barroso
- 0:09- dig into programming fundamentals for network engineers.
- 0:23- Well, hello, Phil. You have put up a
- 0:25- lot of stuff in your little home office
- 0:28- studio since
- 0:29- the last time I've seen it. Look at
- 0:31- all that
- 0:32- foam on the walls. I don't know. I
- 0:34- may have to up my game a little
- 0:36- bit. And David,
- 0:38- where are you physically located, David? Just so
- 0:40- that our listeners have a
- 0:42- sense of who we have on.
- 0:46- I'm located in in Stockholm, Sweden.
- 0:49- Oh, okay. Scotland. Oh, that's really cool. Stockholm.
- 0:52- Oh, Stockholm. Sweden. Okay. I thought you said
- 0:54- Scotland.
- 0:55- Okay. Yeah. So Stockholm,
- 0:58- you know, I've never been to Stockholm, actually.
- 1:00- I worked for Ericsson. They tried to get
- 1:01- me to come to Stockholm on a regular
- 1:03- basis, and I never ended up going. But,
- 1:05- yeah, that's cool. Good.
- 1:07- Nice place from what I understand, but very
- 1:08- cold.
- 1:10- Oh, right now it's quite cold. Yes. It's
- 1:13- it's it's very nice during summer.
- 1:15- Okay. Very nice in the summer. I like
- 1:17- the way you do that.
- 1:21- Well,
- 1:21- if you're into the country skiing and things
- 1:23- like that, it's also great during winter. I'm
- 1:25- I'm not a a snow person, so
- 1:28- I'd rather stay here in summer.
- 1:30- I have a lot of friends who live
- 1:31- in Nook, Greenland,
- 1:33- and I always wonder about them. You know?
- 1:35- It's like,
- 1:38- you really have to love winter sports to
- 1:40- live in Nook, Greenland somehow or another.
- 1:44- It's okay. It's kind of crazy. But anyway,
- 1:48- so David, we're talking about
- 1:50- network engineers and programming. So, you know, we
- 1:53- started before the recording talking a little bit
- 1:55- about your background. It might be good to
- 1:57- fill readers, listeners. Readers, where am I today?
- 2:00- Anyway, it might be good to fill listeners
- 2:02- in on that a little bit,
- 2:04- as to what your background is so they
- 2:06- have a sense of your experience in that
- 2:08- space.
- 2:09- So my background is,
- 2:11- network engineering. So I've been working at,
- 2:15- like, service providers, like NTT, for instance.
- 2:18- And then around
- 2:20- five years ago, I
- 2:21- jumped into, like, full time,
- 2:25- programming in the networking space. So I have
- 2:27- a lot of experience in both programming
- 2:30- and as a network
- 2:32- operator. Okay. Awesome. Great.
- 2:35- So
- 2:36- let's just start with a simple question. Why
- 2:37- do network engineers need to learn to code
- 2:39- or need need to have programming skills? I
- 2:41- should say, I should not say learn to
- 2:43- code because I think there is a difference
- 2:44- between having programming skills
- 2:47- and
- 2:48- being a full on coder. So let's just
- 2:50- start with why is it important for network
- 2:52- engineers to have, coding or programming skills?
- 2:56- I think mostly
- 2:58- because,
- 3:00- I mean, if you look at the type
- 3:02- of networks that we manage, like, ten years
- 3:04- ago, like, we would have, like, a, I
- 3:05- don't know, like, a few switches, a few
- 3:07- routers. Like, you could count them in the
- 3:09- in the dozens.
- 3:11- And so everything was more or less manageable,
- 3:14- like, for a human to to deal with
- 3:17- with everything. Like, nowadays,
- 3:19- like, everything is super fast paced. Like, you
- 3:21- need to do changes super fast because of
- 3:23- the cloud and and other things, and you're
- 3:26- also managing, like, way more
- 3:28- devices, like, one, two,
- 3:30- even three orders of magnitude,
- 3:32- higher.
- 3:33- So it's a matter of
- 3:35- being able to to do your job to
- 3:37- begin with. And then secondly, there are also
- 3:39- other benefits.
- 3:41- Consistency,
- 3:43- and
- 3:44- if you get speed, you manage to... You
- 3:46- can also free up your time to do
- 3:48- more interesting stuff instead of just, like, firefighting
- 3:51- and deploying villains and firewall rules.
- 3:53- So I think there are several reasons, not
- 3:56- just one, to be honest.
- 3:57- Yeah. I I would actually add to that
- 3:59- personally. I think knowing...
- 4:01- Having programming skills and even to the point,
- 4:03- I mean, my my second language... People ask
- 4:05- me what my second language is sometimes. I'm
- 4:07- in a PhD program and they're like, oh,
- 4:09- what are the languages you study? And I
- 4:10- always say, Si. And they don't make the
- 4:12- joke. But anyway,
- 4:17- you know, they're expecting Greek, Latin, or German.
- 4:19- And I'm always like Si.
- 4:21- Like, is that a language? Yeah.
- 4:24- Anyway,
- 4:25- so I think it's important as well because
- 4:28- it's a mindset. Right? I mean, it's a...
- 4:30- Programming or coding is a different mindset.
- 4:33- I was talking to Alastair Woodman,
- 4:36- nobody else. Well, I think Phil might know
- 4:37- Alastair a little bit. But... And he was
- 4:39- saying, you can always tell the difference between
- 4:41- a good coder and a bad coder because
- 4:43- a good coder works with tools. They build
- 4:45- their own tools. It's like a carpenter. They
- 4:47- have all these tools that they use. And
- 4:49- then the really bad coders, or the coders
- 4:51- who don't really know what they're doing, they
- 4:53- just use things raw, just like they are.
- 4:54- Right? They just pop the slider up in
- 4:56- factory default position, and they just do whatever
- 4:58- they're going to do. Whereas, good coders are
- 5:01- always customizing their environment and building tools to
- 5:03- help them. I think those kinds of mindset
- 5:05- things are really, really helpful even for network
- 5:08- engineers.
- 5:10- Yeah. Even just computational thinking as a skill
- 5:13- set in itself is super helpful
- 5:15- in approaching networking problems, other problems.
- 5:18- My... I'm not very affluent in programming yet.
- 5:21- I know basically just Python and some Java,
- 5:23- but,
- 5:25- my journey
- 5:26- into that even has helped me understand the
- 5:28- systems that are operating on top of the
- 5:29- network a lot better and, has increased my
- 5:32- ability to troubleshoot and resolve issues.
- 5:35- Yeah. Interesting. So so I guess that segues
- 5:38- into the next question.
- 5:40- So if you're gonna learn programming skills,
- 5:43- what languages should you learn? What should you
- 5:45- do? Any ideas, David?
- 5:47- That's gonna depend a bit on your,
- 5:51- like, on your on your field. In the
- 5:53- network
- 5:54- world, the main one would be Python. Like,
- 5:57- there is a library for almost
- 5:59- everything network related,
- 6:01- and it's also what's getting,
- 6:03- most traction,
- 6:05- in our communities. So Python, like, without any
- 6:08- doubt.
- 6:09- And Golang would be also also a a
- 6:12- good option, but that has a bit of...
- 6:14- There's...
- 6:15- The community is not that big there in
- 6:17- the networking space yet, so I would
- 6:19- I would say, Python.
- 6:23- Interesting. Do you see Golang growing as a
- 6:25- language that's used in the network automation space?
- 6:28- I I think so. I'm actually
- 6:30- doing, like, at at work, for instance, everything
- 6:34- I do nowadays is, is Golang. Like, there
- 6:37- are a few reasons for for that. Like,
- 6:40- my main reasons would be, like,
- 6:42- speed. Like, colon is way faster than, than
- 6:46- Python.
- 6:47- And, also,
- 6:49- because it's statically
- 6:50- typed,
- 6:53- the code tends to be more reliable.
- 6:55- Like, there's no way that you can pass
- 6:57- the wrong type to a function,
- 6:59- and then everything just explodes, which is kind
- 7:01- of a common problem in,
- 7:04- in Python. So I think long term... And
- 7:05- when I say long term, I mean, like,
- 7:07- I don't know, like, maybe ten years. I
- 7:08- think Golang
- 7:10- is
- 7:10- maybe,
- 7:12- in the position that Python is, today and
- 7:15- Python may be the
- 7:16- the the pearl of today
- 7:18- for people who makes fun of pearl.
- 7:21- Yeah. Interesting. But it... So it... It's hard
- 7:23- to predict in ten years, but that... That's
- 7:25- why that exists. Yeah. I mean, who knows
- 7:28- what's gonna happen in ten years? ATM,
- 7:30- according
- 7:31- to some analysts, was going to take over
- 7:33- the desktop in ten years. I mean I
- 7:35- still remember the charts.
- 7:41- I'm still not running ATM so
- 7:43- maybe they were wrong.
- 7:45- So
- 7:47- it might be interesting to go into a
- 7:48- little bit of the difference between Python and
- 7:50- Golang, for people who aren't familiar with the
- 7:52- two different programming languages and even the paradigm
- 7:56- of different ways of building programming languages or
- 7:58- the way they work. For instance, Golang is
- 8:01- not really an interpreted language, but Python is.
- 8:03- Can we go into a little bit of
- 8:05- that and try to explain,
- 8:06- maybe for listeners,
- 8:08- why that's different or or what the differences
- 8:10- there are?
- 8:11- So the main difference between an... The interpreted
- 8:14- language and a compiled
- 8:16- language is that you... Like, in Python, for
- 8:18- instance, which is interpreted, you would write your
- 8:21- code, and then you have this, dot p
- 8:23- y
- 8:24- file that then you use Python,
- 8:28- like, the program to run that that script.
- 8:31- Right? So every time you need to run
- 8:32- your script, you need Python in the same
- 8:34- machine to be able to to run it.
- 8:37- With a compiled language like like c, Java,
- 8:41- Golang,
- 8:42- you have instead, a compiler that will read
- 8:45- the code and generate a a binary, and
- 8:47- that binary can be run without requiring,
- 8:50- the the, like, Java itself or,
- 8:54- or Golang or
- 8:57- or or or the c compiler. Like, you
- 8:59- have the binary, and the binary can be
- 9:01- can be run.
- 9:03- Another benefit
- 9:04- of,
- 9:07- compile language as opposed to runtime,
- 9:10- languages,
- 9:11- runtime
- 9:11- language is the same as interpreter languages, is
- 9:14- that you are able to catch,
- 9:16- errors on compile time. Like, usually,
- 9:19- compiled languages are also,
- 9:22- statically typed. So you need to say, like,
- 9:25- oh, this function takes these parameters, and these
- 9:27- parameters are of are of this particular type.
- 9:29- So you make a mistake and pass the
- 9:31- wrong type,
- 9:33- things just,
- 9:35- blow up at compile time. So it means
- 9:36- that when you run the program, you don't
- 9:38- find any surprises that, oh, yeah. I passed
- 9:40- this type, and this type doesn't have this
- 9:42- particular
- 9:43- attribute, which is a common,
- 9:45- problem with with Python. Like, anyone that has
- 9:48- written some Python has seen the typical,
- 9:52- error, non type
- 9:53- has... Doesn't have the attribute
- 9:55- blah. Right?
- 9:57- So those would be, like,
- 9:59- main main differences,
- 10:01- I guess. Yeah. So so it also depends
- 10:05- on whether the language is strongly typed or
- 10:07- or weakly typed. Right? So c, for instance,
- 10:09- is not a weakly typed language. You can
- 10:11- cast a string to a pointer
- 10:14- or a string to a like you can
- 10:16- take the ASCII value of a number and
- 10:18- just use it as a number with no
- 10:19- conversion. Like it's just stored in memory locations.
- 10:23- You can do whatever you want to. In
- 10:25- fact, a lot of people who start with
- 10:27- C, that's one of their biggest confusions is
- 10:28- the whole pointer mess, how you can cast
- 10:30- pointers and pass pointers and shared memory versus
- 10:34- things that are not shared, stuff like that.
- 10:36- Whereas with Golang, it's a strongly typed language,
- 10:38- right? So if you want to cast
- 10:40- a text string as integers or as a
- 10:43- different type, you've actually got to go through
- 10:45- the process of doing that cast. You can't
- 10:47- just randomly use the array or the string
- 10:50- in a different way,
- 10:52- which also helps catch errors, right?
- 10:54- Yeah. Yeah. Correct.
- 10:56- So, and now, Python, now is Python weakly
- 10:59- or strongly typed?
- 11:01- I think it's pretty weakly typed from what
- 11:03- I remember. I don't do a lot of
- 11:04- Python. So... I... Py... Python
- 11:06- is actually,
- 11:08- strongly typed, but it's dynamically
- 11:10- typed, which means that you can change variable.
- 11:13- You you can change the type of of
- 11:14- variables, but you cannot easily convert,
- 11:18- like, between types. Like, if you have, an
- 11:20- object of a particular type, you cannot just
- 11:22- say, like, oh, now it's gonna be this
- 11:24- other thing that's just,
- 11:27- blow. So the the main thing is that
- 11:28- it's dynamically typed. So you have this,
- 11:31- variable n, and you can start with n
- 11:34- being an integer, and then three lines below,
- 11:36- you just assign a string in there.
- 11:40- So it's dynamic. That's even more confusing than
- 11:43- c. Because it's just... Yes. Whatever it is
- 11:45- in C, it's always a string. You can
- 11:47- use it as a number, but it's still
- 11:48- a string. And, you know, you assume that
- 11:50- if it's a string, there's a null endpoint
- 11:53- and stuff like that. So that's interesting. Now,
- 11:55- another difference is that
- 11:57- compiled languages like C Golang
- 12:00- are required
- 12:01- to be recompiled for different processors. Now, that
- 12:04- used to be a big deal. And in
- 12:06- some cases, it still can be. In data
- 12:08- centers, you can get ARM chips versus Intel
- 12:10- chips. And it used to be AMD had
- 12:12- a completely different,
- 12:14- different API or a different instruction set than
- 12:17- Intel did, so you would have to recompile
- 12:19- on multiple platforms.
- 12:21- And that still is true, like, with cell
- 12:23- phones or with
- 12:24- ARM chips and data centers or tablets or
- 12:26- something like that. Whereas with something like
- 12:29- Python or even Java in a JVM,
- 12:32- which it is kind of a virtual machine
- 12:34- that you're running inside of,
- 12:37- then you can just run it on anything.
- 12:38- It doesn't matter because it just... There's the
- 12:41- interpreter sitting there that does the job of
- 12:43- making the right machine code pop out the
- 12:45- other end. So those are kind of some
- 12:47- of the differences.
- 12:48- So now let's talk. So
- 12:51- so Golang is interesting.
- 12:53- I really like Golang. I've looked at Go
- 12:55- BGP and stuff like that. Now I don't
- 12:57- know that I would still
- 12:59- suggest running...
- 13:00- I still think building a routing protocol or
- 13:03- something is still something that you should be
- 13:05- doing in C because of the expressive semantics.
- 13:08- But as a network automation,
- 13:10- now what type of tools are available in
- 13:12- Golang for network automation? I assume you have
- 13:14- gRPC,
- 13:15- which means you can do JSON and stuff
- 13:18- like that. But are there
- 13:20- things like SaltStack or anything else that you
- 13:22- can use or Ansible that you can use
- 13:23- with Golang?
- 13:25- So I haven't I haven't seen anything
- 13:27- like that. Like, everything I'm using, for instance,
- 13:30- is mostly built on top of gRPC,
- 13:33- which works, like, beautifully with with Golang.
- 13:37- But now I haven't used anything like... I
- 13:40- haven't seen anything like salt or or anything
- 13:42- like that. For those familiar with with Nornir,
- 13:45- I wrote, a Golang equivalent, which is basically
- 13:49- what I'm what I'm using.
- 13:52- So tell us about that a little bit
- 13:53- because that's really interesting. It's... Like I said,
- 13:56- good coders always build their own tools. So
- 13:58- tell us about this tool that you've built.
- 13:59- It's very interesting.
- 14:01- So
- 14:02- this is for both, Nournier and and Gournier,
- 14:05- which is the Golang equivalent. Like, the idea
- 14:08- here is to have, like, a framework
- 14:11- to,
- 14:12- to do,
- 14:14- various things, like loading an inventory of of
- 14:17- devices
- 14:17- and then being able
- 14:19- to to pass task to the to the
- 14:22- framework to execute those tasks over
- 14:25- over those devices. So you would say, like,
- 14:27- okay. I'm gonna I'm gonna create a task
- 14:29- that its own... Only responsibility
- 14:31- is to configure a set of, BGP
- 14:34- peers.
- 14:35- And then you just say, like, okay. This
- 14:37- is my inventory. This is my task. Just
- 14:39- do it over this set of devices, and
- 14:42- then everything just... Like, all the multithreading,
- 14:44- all the passing data around, making sure that
- 14:47- the,
- 14:48- code,
- 14:50- is executed and all that. That's just
- 14:52- done for for you. You only have to
- 14:54- think in terms of,
- 14:57- individual operations, and then all
- 14:59- the magic on these different devices happens by
- 15:02- itself.
- 15:04- Really cool. So is this open source? You
- 15:05- can get this on Git?
- 15:07- Yeah. This is all on on GitHub. It's
- 15:09- all Apache two,
- 15:11- licensed
- 15:12- and, yeah, available on
- 15:15- PyPI in the case of,
- 15:18- Nournier for Python, and is just available via
- 15:22- GoGet as as useful.
- 15:24- Okay.
- 15:25- So Nournier is written in Python and uses...
- 15:29- It has plugins for Netmiko and Napalm. Do
- 15:31- you have similar plugins in the Gornir,
- 15:34- library for Golang?
- 15:36- So there is some,
- 15:39- plugins for SSH based,
- 15:42- devices, but because everything I'm doing is, gRPC
- 15:46- myself, so
- 15:47- I... I'm mostly just,
- 15:50- having integrations for my own gRPC devices.
- 15:55- Very cool.
- 15:56- Awesome.
- 15:57- That's great. So
- 16:00- so let's talk a little bit about the
- 16:01- skill set. So
- 16:03- when you think about learning how to code
- 16:05- or a network engineer thinking about learning how
- 16:07- to code, what is it that they should
- 16:09- be learning? Is it data structures, algorithms?
- 16:12- I know Git. Git's a big one, and,
- 16:14- honestly, I still struggle with Git, and I
- 16:16- need to spend some time doing better with
- 16:18- Git. And it's really sad because I'm a
- 16:19- maintainer on FR routing, so I push PRs
- 16:22- all the time. I did code reviews and
- 16:23- PRs all the time, and I'm in the
- 16:26- code all the time looking at how things
- 16:27- work, and yet I still feel completely lost
- 16:30- in Git a lot of times. So I
- 16:32- know Git's a big one. Right? I mean,
- 16:33- you need to learn Git to start from.
- 16:36- That would be my immediate guess.
- 16:39- Yeah. I mean, I think there are several
- 16:41- tools
- 16:42- to program that people
- 16:44- usually overlooks. Like, they
- 16:46- go straight into coding, and they
- 16:49- don't, spend any time, like, learning the the
- 16:53- tools for parameters. Like, for instance, like, the
- 16:56- the usual
- 16:58- one that people,
- 16:59- ignores is learning how to use a debugger.
- 17:03- And that's the only way of actually
- 17:05- trying to more or less sanely,
- 17:08- troubleshoot code when it doesn't work as as
- 17:11- expected. Like, a debugger is something that can
- 17:13- tap into your program, and then you can
- 17:15- stop the execution of your program and say,
- 17:17- like, okay. Can you just show me the
- 17:18- memory
- 17:19- when you hit this particular line of the
- 17:21- code? So that's useful to start seeing, like,
- 17:23- okay. Why is this not working as as
- 17:25- expected? And people usually,
- 17:28- ignores,
- 17:29- that. Another thing that is very useful to
- 17:32- learn to use is some proper
- 17:34- ID. IDEs can help you with the debugger
- 17:36- itself. It can help you by... With auto
- 17:39- completion, with
- 17:40- inline documentation. It just makes your life so
- 17:43- much easier, especially when you're starting
- 17:45- and you may not know
- 17:47- the the libraries that you need by heart.
- 17:49- Like, you start typing, and the auto complete
- 17:52- more or less shows you the option that
- 17:53- you have. Like, oh, yeah. This is the
- 17:54- function that I that I was thinking of,
- 17:57- which is also great for exploring new,
- 18:00- libraries.
- 18:02- And, of course,
- 18:04- Git, I would say that those are the
- 18:05- most important
- 18:07- overlooked,
- 18:08- tools that people need to learn.
- 18:11- Yeah. I think it was about six months
- 18:12- into my journey of learning Python that I,
- 18:15- ran into PDB, IPDB
- 18:18- and started using it. And I was like,
- 18:20- oh my gosh. This is fantastic. It,
- 18:23- really changes the game for actually understanding how
- 18:25- your code is running instead of just trying
- 18:27- to arbitrarily troubleshoot
- 18:29- functions and things. So,
- 18:31- what do you use in Golang? Is it,
- 18:33- g d... Is there, like, a GDB? What's
- 18:35- the,
- 18:36- the the tool for debugging?
- 18:39- Yeah. So there is GDB, and there is
- 18:41- also one that is tailored for Golang, specifically,
- 18:45- which is called Delves.
- 18:48- Okay.
- 18:50- So Delve...
- 18:52- Oh, sorry. Go ahead. And
- 18:53- I was gonna say Delve is pretty similar
- 18:56- to to PDP. So you have experience with
- 18:58- it. Like, you would... And just start playing
- 19:00- with Delphi. You will see, like, it's pretty
- 19:01- much the same type of interface, the same
- 19:04- type of commands, and and everything.
- 19:07- Uh-huh. What... How does GDB
- 19:09- differ from Delphi?
- 19:11- So
- 19:12- GDB is more tailored
- 19:15- for compiled software, so it's a bit more
- 19:18- rough to to to follow. Like,
- 19:22- like, you will...
- 19:23- It doesn't integrate that well with the with
- 19:26- the Golang code, so it's harder to
- 19:28- jump into particular lines and and things like
- 19:31- that.
- 19:33- Gotcha. Gotcha. Do you use, other tools along
- 19:36- with that? Like, do you set breakpoints in,
- 19:39- some sort of text editor in order to
- 19:41- run your code and,
- 19:42- debug it? Or do you typically just walk
- 19:45- through the program directly? How do you go
- 19:46- about that normally?
- 19:48- I usually deal with the command line directly.
- 19:51- And by the command line, I mean the
- 19:52- command line that the debugger
- 19:54- gives you. When you start to do a
- 19:55- program, it jumps into this,
- 19:58- shell, within,
- 20:00- PBB or Dell or any other you may
- 20:03- be using. And then I just type the
- 20:05- the break points in in there. I program
- 20:07- mostly in in
- 20:09- BI, so I don't have a lot of...
- 20:10- I don't have a super fancy
- 20:12- ID myself. I tend to just,
- 20:17- deal with the with the common line.
- 20:20- Oh, that's interesting.
- 20:21- So I use Visual Studio Code,
- 20:25- quite a bit,
- 20:26- because it's just easier to jump around like
- 20:29- a text document and edit it that way
- 20:31- for for me. I'm curious why you use
- 20:33- VI and just go directly from the the
- 20:35- CLI.
- 20:37- So I mostly use VI because everything I
- 20:39- do is in the
- 20:41- in the command line anyway. Like, I'm... When
- 20:43- I'm programming, I'm mostly, like,
- 20:46- working with,
- 20:47- containers,
- 20:49- maybe SSHing into remote machines, and I'm always
- 20:52- in the in the command line doing whatever.
- 20:55- So I used to use,
- 20:58- ATOM,
- 20:59- before jumping into VI.
- 21:01- And I
- 21:02- I felt that I was always jumping between
- 21:05- Windows and losing
- 21:07- track of what I was doing,
- 21:09- with so much context switching. So I started
- 21:11- just, like, using TMX and and BI, and
- 21:15- then my workflow just became
- 21:17- a bit faster and and better.
- 21:20- Although it has a bit of
- 21:22- a learning curve, like,
- 21:24- the... Going through configuring the eye and t
- 21:27- mux to your,
- 21:29- liking.
- 21:30- Yeah. Yeah.
- 21:36- I think you're muted. Yeah. I'm muted.
- 21:40- So,
- 21:40- yeah, let me think about what I was
- 21:42- just gonna say.
- 21:45- I just blew my... Blew myself up.
- 21:47- So you don't use Z Max? I'm I'm
- 21:49- pretty amazed that you use VI. You're hung
- 21:51- on VI.
- 21:52- VI, I find very difficult to use personally.
- 21:54- I know most of the coders I deal
- 21:56- with don't find it very difficult to use,
- 21:58- but I I seem to find it very
- 22:00- difficult to use.
- 22:02- So I I tried to use Emacs a
- 22:05- couple of times, and
- 22:07- I have found two problems with it. The
- 22:09- first one was that I haven't had the
- 22:12- time to actually
- 22:14- customize it to my liking yet, so
- 22:16- I don't have the same environment that
- 22:19- I would have with VI.
- 22:21- And the second issue is that I I
- 22:23- have problems in my my hands. So I'm
- 22:25- very sensitive
- 22:27- to changes in the movements that I do
- 22:30- with my fingers and my wrist. And
- 22:34- I... Two days that I tried TMax, that
- 22:36- just led to a
- 22:38- lot of pain. So decided to to just
- 22:41- stop.
- 22:42- That's very interesting. Yeah. So so that's another
- 22:45- interesting point is that your tools are often,
- 22:48- can be man... Or can be impacted by
- 22:51- what you do on a regular basis, like,
- 22:53- what your workflow is, which is very interesting
- 22:55- because
- 22:56- because a lot of people say, well, how
- 22:57- do you write fast in Microsoft Word or
- 23:00- whatever? They're always fussing me about writing books
- 23:01- in Microsoft Word. You should be using markdown.
- 23:04- And I say, well, I don't know. I've...
- 23:06- Don't even use the standard Microsoft Word menu
- 23:08- system. I have my own that I've built.
- 23:11- And second of all, I don't use a
- 23:12- mouse. I use a tablet.
- 23:14- And so because I use a tablet, I
- 23:16- can actually switch back and forth between the
- 23:18- keyboard
- 23:19- and the tablet much, much faster, particularly if
- 23:22- I put on touch mode on the tablet.
- 23:24- I don't even have to pick a pen
- 23:25- up or anything. I just reach over there
- 23:26- and do it.
- 23:27- So I find it actually to be pretty
- 23:29- fast. So I think the work flow is
- 23:32- really, really important. People don't think about the
- 23:34- workflow
- 23:35- in terms of what they're doing.
- 23:37- And second of all, just the idea that,
- 23:39- you know, your physical...
- 23:41- The way you're physically made is that it's
- 23:44- easier for you to use your fingers in
- 23:46- a way where all the commands are close
- 23:47- together. And I don't think people think about
- 23:49- those things. But they're really important in getting
- 23:52- your workflow speed up.
- 23:55- Yeah. Yeah. I agree. I I try to
- 23:57- avoid anything that requires,
- 23:59- a mouse mouse for the same issue that
- 24:01- I mentioned before. Like, if I use a
- 24:02- mouse for long periods of time, I start
- 24:05- getting pain in my in my wrist. I
- 24:07- always try
- 24:08- to optimize for for the common line because
- 24:11- I feel more comfortable typing. I also feel
- 24:14- that I'm
- 24:15- faster typing than just moving the mouse around,
- 24:17- but mostly because it doesn't lead to to
- 24:19- pain.
- 24:20- Yeah. Right. Right.
- 24:22- So in the realm of programming beyond tools,
- 24:25- do you think people need to learn algorithms?
- 24:27- Like, I see people who say, I just
- 24:29- don't need to learn algorithms and data structures
- 24:31- or anything like that. I just need to
- 24:33- go learn how to do stuff. How would
- 24:35- you pit those two arguments against one another,
- 24:38- or how do you see that playing out?
- 24:41- So
- 24:42- regarding
- 24:42- algorithm, I'm not sure that it's so important
- 24:46- nowadays because
- 24:47- most of
- 24:48- the useful ones are gonna be implemented as
- 24:51- part of the standard library. Like, how to
- 24:54- sort a a list, how to search in
- 24:56- a sort of list. Like, all those kind
- 24:57- of things are already
- 24:59- solved. It's nice to know them because that
- 25:02- also
- 25:03- helps you, like,
- 25:05- like, to think about
- 25:07- problems and and whatnot. I don't think they're
- 25:10- extremely,
- 25:11- important. I think data structure is more important
- 25:14- because a lot of people struggle with, like,
- 25:16- Oh, I have I have all this data,
- 25:18- and they have even problems iterating
- 25:21- over the data because they don't understand the
- 25:24- difference between a map or a dictionary,
- 25:27- and a list, for instance. Like... So I
- 25:29- think data structure is certainly super important.
- 25:32- Algorithm,
- 25:33- it's nice to know because that's gonna open
- 25:36- up, new way of thinking for you, but
- 25:38- I would say it's not as important,
- 25:40- nowadays. So that brings up a good question.
- 25:42- What what are the differences between a map,
- 25:44- a list, and a dictionary?
- 25:46- So a dictionary and a map is mostly
- 25:48- the same. It's just that different languages call
- 25:50- them, in different ways. In Python, it's called,
- 25:53- a map... A dictionary.
- 25:55- In Perl, it's called, HashMap, if I recall
- 25:58- correctly, and in Golang, it's called, a map.
- 26:01- So that's just the same data structure, just
- 26:04- different,
- 26:05- programming languages call it,
- 26:07- differently.
- 26:08- And,
- 26:10- so the main difference between
- 26:12- a map and a and a list,
- 26:14- or a dictionary and a list would be
- 26:16- that,
- 26:17- a list is just
- 26:19- what the name implies. It's just a list
- 26:21- of elements. So you have one element after
- 26:24- the other. They may be sorted
- 26:26- in the same order as they're inserted in
- 26:29- the in the list.
- 26:31- While
- 26:32- a map or a dictionary,
- 26:34- they're usually not
- 26:36- ordered in a list. What they are is
- 26:38- just referenced by, by a key. So you
- 26:40- have a set of elements within the dictionary,
- 26:43- and the way that you access them is
- 26:45- by saying, like, okay, give me this particular
- 26:47- element. And then that particular element is just
- 26:49- referenced by this by this key. Yeah. And
- 26:52- I suppose that kinda ties back to algorithmic
- 26:54- efficiency too a little bit because if you
- 26:56- have a list of, you know, a million
- 26:58- different data points, you would have to loop
- 27:00- over the entire list to find something. Right?
- 27:02- Whereas with the dictionary, you can just do
- 27:04- a a hash lookup on the key. So
- 27:05- algorithmically, it's a lot more efficient depending on
- 27:08- what exactly you're trying to do with the
- 27:09- program.
- 27:10- Yeah. It depends on what you're trying to
- 27:12- get out of the right because
- 27:14- if you can structure it in the way
- 27:16- where you have
- 27:19- a key
- 27:21- to get things, then that's fine. But sometimes
- 27:23- you can't. Right? Sometimes it's...
- 27:25- Yeah. I mean, those data structure are mostly
- 27:29- interesting
- 27:30- when you're
- 27:32- talking about
- 27:33- efficiency. Like, you really need to
- 27:36- to, like, make your code,
- 27:38- like, super efficient because of what you're doing.
- 27:41- And then it's when it's interesting to know,
- 27:43- like, the, like, the very deep details of
- 27:45- those data structure, how they're implemented in the
- 27:47- in the language, and and and whatnot. But
- 27:47- that's probably
- 27:55- programming... As network parameters because
- 27:57- we're all... We're always gonna be bound by
- 27:59- IO anyway. Mhmm. So the CPU is gonna
- 28:02- be idle anyway most of the time. So
- 28:04- so you would say you're bounded mostly by
- 28:07- the way... The most logical way to structure
- 28:09- the data in a way that makes it
- 28:11- easy to read the code
- 28:13- or understand what's going on rather than
- 28:15- as much around,
- 28:17- making the program efficient. Because I know in
- 28:20- c, we go to great lengths to make
- 28:22- things
- 28:23- as efficient as possible in many cases using
- 28:26- data structures that most people wouldn't even begin
- 28:29- to understand.
- 28:31- So that's that's interesting.
- 28:33- Yeah. Correct. I mean, if you're writing BGP
- 28:35- as the as the demon to to run
- 28:38- it in your machine, like, sure. Like, you're
- 28:40- gonna have to be dealing with,
- 28:42- a stream of bytes to make everything as
- 28:45- efficient as as possible,
- 28:48- like three s and other data structures.
- 28:50- But if you're just trying to automate,
- 28:53- like, the, like, the
- 28:55- deployment of configuration to this particular BGP instance,
- 28:58- then just make sure that you optimize for
- 29:01- for the human that is gonna be,
- 29:05- dealing with the system rather than for the
- 29:07- machine. Because in the end, I mean,
- 29:09- you're talking like a few milliseconds
- 29:11- of latency between your,
- 29:14- management station
- 29:16- and the system that you're configuring anyway.
- 29:19- So saving a few nanoseconds is gonna be
- 29:21- just negligible.
- 29:23- Yeah. Yeah. And if you use something like,
- 29:25- Napalm or NetMico in order to log into
- 29:27- a box and,
- 29:29- get data back or a gRPC call or
- 29:32- or whatever that... Like you're saying, that's IO
- 29:34- bound. So it's gonna take a lot of
- 29:36- time for that query to go through the
- 29:38- network,
- 29:39- whereas the the time that the CPU actually
- 29:42- takes to process that and parse the data
- 29:43- that you get back is, like, fractional.
- 29:47- So...
- 29:48- Yeah. Yeah. Awesome. So if you were... Since
- 29:50- you've made the transition,
- 29:52- if you were talking to a network engineer
- 29:54- today who wanted to get started in programming
- 29:56- or just even learning the skill sets, where
- 29:58- would you tell them to start? Is there
- 30:00- a book? Is there just go do it?
- 30:02- Or how would you how would you start
- 30:04- out talking to people?
- 30:06- So I would suggest
- 30:08- going through
- 30:09- places
- 30:10- like Coursera,
- 30:12- edX.
- 30:12- I know
- 30:13- that Kirk Byers, who is the,
- 30:16- author of Nemeco has also some
- 30:19- training
- 30:20- courses. I would suggest
- 30:22- just pick one of these and
- 30:24- go through through them. And
- 30:26- when you have completed any of these courses,
- 30:29- just try to jump into any
- 30:32- open source project and start
- 30:34- helping there as much as you can
- 30:37- learn the the tools, the processes,
- 30:39- and
- 30:40- and things like that. I... Most most
- 30:44- most people will just do one of these
- 30:45- courses and not do the
- 30:47- open source thing.
- 30:49- And
- 30:50- that's
- 30:51- a bit of a pity, especially when you
- 30:53- are working alone because then you're missing out
- 30:56- on a lot of,
- 30:58- interest in tooling. Like, how to use
- 31:00- gate when
- 31:02- you're,
- 31:04- several people working together. How you... How to
- 31:07- use
- 31:07- a CI system for testing. How to use,
- 31:12- testing libraries and and things like that. So
- 31:15- that's also an important,
- 31:17- skill that people often overlook. And it's super
- 31:20- hard to get if you're working alone in
- 31:22- in your,
- 31:23- particular company. So I think it's interesting to,
- 31:27- after you have done some learning, try to
- 31:30- get into
- 31:31- a larger team even if that larger team
- 31:33- is just some open source project. Alright. Well,
- 31:35- thanks David for coming on, and we'll hope
- 31:37- to talk to you again in the near
- 31:39- future.
- 31:40- Thank you for having me. Thank you, David.
- 32:02- Thank you for joining us. You can find
- 32:04- the hedge at rule11.tech.