PyDev of the Week: Dan Bader
This week's PyDev of the Week is Dan Bader, Python author and advocate. Find out how Dan got his start, his favorite libraries, and where he sees the language going.
Join the DZone community and get the full member experience.Join For Free
this week we welcome dan bader ( @dbader_org ) as our pydev of the week. dan does a weekly python tricks newsletter/blog that’s a fun read. he has also authored a python tricks book. i always like checking out my interviewee’s github page to see what they enjoy coding or writing about, so i encourage you to check that out as well. let’s take a few moments to learn more about dan!
can you tell us a little about yourself (hobbies, education, etc.):
hey, everyone, my name is dan bader and i’m a complete python nut. i’ve been obsessed with programming ever since i managed to convince my parents to buy me a dusty old commodore 64 from the classifieds in a local newspaper. and my love for writing code hasn’t diminished since then.
eventually, i got a bachelor’s and a master’s degree in computer science. i worked in full-time positions for a few years and today i’m an independent software developer and consultant.
i was born and grew up in germany, but then later moved to canada. i love both countries—and fortunately, i mostly work remotely these days so i get to visit each one a fair bit. i’m glad i found a partner who’s willing to put up with these antics!
in terms of hobbies, i like working out at the gym, cooking vegetarian food (buying my first proper cast-iron wok in vancouver’s chinatown changed my life, haha), and going on hikes. i also read a lot. in general, i found what makes me the happiest is building stuff. so i try and optimize for that. every now and then i play some guitar to relax.
why did you start using python?
i believe that “code is communication.” a good programmer can express his or her ideas so that a machine can execute them. but a great programmer can structure his thoughts so neatly that machines and humans have no trouble following them.
sure, sometimes it’s nice to write super terse code to impress your friends and colleagues. but what i find the most motivating about building software is simplifying a complex process and breaking it down so that a machine can execute it—and at the same time balancing that with the need to have a maintainable piece of software that other programmers can improve and modify in the future.
i found that my philosophy aligns well with python as a language and also its amazing community. there’s less of a “cowboy/cowgirl coder” attitude and more of a pragmatic desire to get things done and to do them well at the same time. i love that.
i’d dabbled in python throughout my whole cs education. i think the first time i learned about it was when a friend of mine had brought a little “learn python in x days” (or something like that) booklet to a ski trip. i immediately fell in love with the clear syntax that basically looked like executable pseudo code. the more i learned about python and its creators the more i appreciated it. i have a lot of respect for its pragmatic and simple design.
the first “serious” project i wrote in python was the data crunching pipeline i needed for my bachelor’s thesis. and it worked so well and was such an enjoyable experience that i started using python for other “serious” projects as well. from that point on i tried to find ways to use python everywhere i could.
what other programming languages do you know and which is your favorite?
well, i got started with basic on my trusty commodore 64 and then dabbled in other languages (c and pascal) once i got my first pc.
but i couldn’t really wrap my head around c at first, so i spent a lot of time in qbasic for dos. for some reason i was always really interested in assembly level languages, i really wanted to see what was going on behind the curtain (imagine how mind blown i felt when i later learned about cpu microcode). and learning x86 assembly and writing a few programs in it made all of the c stuff like pointers and memory management “click.” c is basically a macro assembler with an odd syntax
eventually, i discovered delphi, which was (or still is?) sort of a combination of an oop version of pascal with an excellent gui framework and a graphical editor. i wrote tons of software with that, like little games and utilities.
delphi was simply amazing. i remember having to save up enough money so i could mail order the “full version” of the delphi compiler and ide.
delphi’s standard library and its gui framework taught me a lot about designing good apis. compared to the win32 and mfc stuff that microsoft was putting out at the time, delphi’s approach just seemed so much more beautiful. i loved working with delphi.
then after that, i had a phase where i was obsessed with writing game engines. there was just something fascinating about how these game engines were almost little operating systems, with their own memory management, filesystem abstractions, and even little multi-threaded scripting runtimes.
around that time i had access to the internet for the first time and i discovered that some of the quake 1 source code was already open-source at the time.
you could download the source code for quake’s scripting language compiler and the game logic from id software’s ftp server. i ate that stuff up. initially, i had no idea what was going on, but i couldn’t put this code down. i printed it out and carried it around with me and scribbled down notes - i learned so much from reading john carmack’s code. he’s one of my heroes, i’d love to shake his hand one day and thank him for the impact he had on me as a coder.
so anyway, i was writing these little opengl renderers, scripting systems, and networking code and i just went deeper and deeper down these rabbit holes—without actually producing a playable game.
at some point, i had built almost this “game sdk” with my own vm-based scripting language and hot-reloading for code changes and a graphical map editor—but there was practically no progress on the game i wanted to build (and that i had promised to my friends).
this experience taught me a lot about pragmatic design and program architecture. i got so tangled up in this mess (even though it was fun) that i made no actual progress on the things i said i was going to build. i’m sure most developers are familiar with this effect.
now to reel it all the way back into python:
of course, python is my favorite programming language! i still remember when i thought about python in those terms for the first time:
i was asked to re-write a terribly convoluted mess of a java web application that was the api back-end for a mobile app. i rebuilt the whole thing in python with flask and sqlalchemy. it took me about a month to do it and i used a test-first development style for everything.
the whole experience was just so enjoyable and felt so “right” i couldn’t believe it at first. since those days my love for python never faded.
what projects are you working on now?
i love python and programming in general. i want to inspire as many developers as possible to become better engineers and to grow their skills.
for me, programming is a passion. and i know how hard it is to find people who feel the same, especially when you’re growing up out in the boonies. so i try to be a “force for good” in that space.
pretty much every tech job i ever had in my life had some teaching element to it. for example, i tutored a few programming classes and even got to give a series of introductory lectures during my university days.
or i would give presentations and do q&a’s with the engineering team at companies i worked for. at the last company i worked at, i started this weekly thing called “clean code friday.” eventually, i also started to manage other developers as a lead dev and did weekly 1-on-1s with them.
and i always found that part of the job incredibly rewarding. i really enjoyed it.
when i started doing more and more remote work this teaching aspect suddenly disappeared. and it didn’t feel right. so to bring it back, i gradually built up these outlets like my website , my weekly python newsletter , my youtube channel , and my twitter account where i talk about how you can become a better python developer. and it’s been so much fun!
it’s just awesome how much you can scale your impact that way. if you can help 10 developers to become 10% better at what they do, that already has a huge impact. and this scales linearly: it’s much harder to train yourself to become 100-times better at development. but helping 10,000 developers to become 1% better at what they do? that’s totally possible with the power of the internet and the reach you can have through articles and videos.
to me, that’s just awesome. so if i can move into a direction where i can make a living helping developers over the internet, that’s my ultimate goal.
right now i’m working on a new book called python tricks: a bit’s always uffet of awesome python features . if you’ve been learning python for a while but you still catch yourself thinking “i don’t even feel like i’ve scratched the surface of what i can do with python” then you should check it out.
a slightly “crazier” side-project is this brand for python developer swag that my wife and i just launched: nerdlettering.com: mugs & accessories for python developers
which python libraries are your favorite (core or 3rd party)?
i love the collections module in the python standard library. the more experience i gained programming the more i realized that often the most important thing is picking the right structure for your data. once you’ve expressed a problem with the right data structure the solution often flows from it naturally. it always feels great to do a big refactor that swaps out some complicated mess that’s grown over time for a clear data structure.
my favorite third-party libraries are pdb++ (an improved pdb) and bpython (an alternative python repl). i guess they’re more development tools than something you’d use as a dependency in your own programs. but because they’re such great tools i get to use them on pretty much all projects i work on, so i get a lot of value out of them.
i really like what kenneth reitz is doing with his projects like requests or clint . i know some people think the “xyz for humans” thing has been overdone at this point, but kenneth’s stuff and the way he designs his apis is a great inspiration for me to this day. i like libraries that have been built with the user in mind and helping them achieve their goals.
where do you see python going as a programming language?
we’ll all be writing python 3.
typing hints will play a big role and open up niches where python previously wasn’t the best choice, for example by enabling performance optimizations and making large-scale programs easier to maintain (e.g. tool-assisted refactoring).
i’m convinced that python will expand its foothold in the scientific community. i mean who wouldn’t want to trade a bunch of r code for nice and clean python?
when i grew up in germany as a kid there was this craze about “desks that can grow with you.” like, you’d buy your kid an adjustable desk and then they’d be able to use it throughout their whole education career.
python is a great “adjustable desk” language.
with the small but important difference that python is also a much prettier desk. one that you wouldn’t be embarrassed of using past elementary school, and one that you’d be okay with showing to your girlfriend/boyfriend.
(okay, let’s just stop with the desk analogy here.)
basically, i really like michael kennedy’s idea that python is a “full spectrum” language. it’s easy to get started with it—but it’s not going to prevent you from growing as a developer and getting some really impressive real-world work done with it.
what is your take on the current market for python programmers?
i think today is a fantastic time to be a python developer. according to search engine trends, python is the 2nd most popular programming language in the world right now. that’s powerful.
the job perspectives for python developers are really solid. i’m getting contacted with interviewing opportunities multiple times per week. from talking to hiring managers, i believe there’s a huge demand for “intermediate” python devs with 2-5 years of experience. companies are desperate for these folks.
actually—and this is a bit of a shameless plug—i teamed up with another blogger, elena ruchko, a short while ago to write an article to answer the question “is python worth learning?”
i’d gotten some questions from developers who said “look, i really love python, but can i expect to make a career out of it? what’s the market for python right now?” and the article was a way to give some insight into that.
so, if you’re looking for some more detail, the article goes into salary data and job trends to gauge the market demand for python developers. you can find it here: why learn python? here are 8 data-driven reasons
we also included interviews with industry experts so i think it gives a quite comprehensive overview for someone who’s interested in digging deeper.
is there anything else you’d like to say?
first of all, kudos to you, dear reader, if you made it all the way down here.
and then also, thank you, mike, for inviting me to be a part of this! it’s great what you’re doing for the python community. i really like the “conversational” teaching style you use in your books. to me, that’s much more engaging than handing someone a dry technical reference. it’s something i try to emulate in my own writing.
oh, and one more random thing: i believe every developer should read bob martin’s book “clean code” at some point. seriously, get it now if you haven’t read it. it’s a book i’ve been recommending for years.
thank so much for doing the interview!
Published at DZone with permission of Mike Driscoll, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.