Meetup: Python for Java developers

This month I had the honor of preparing our internal meetup, topic for this meetup: Python. Not Python from that awesome movie or the Efteling, but Python the programming language. In this blog post I would like to share how I approach my preparation for a meetup.

Preparing a meetup means learning a lot of new things and diving into the unknowns. This is also one of the reasons why at Sourcelabs we feel that everyone should do this every once in a while, because it stimulates the neurons inside your brain and helps you learn better. Having used many different programming languages throughout my career (mostly on the JVM), I never encountered Python in any of my projects before, so a lot of neurons had to be stimulated 🙂

Every start of a meetup we vote on a topic for the next meetup, that means that the topic for each meetup is clear. My first step is to focus on creating an agenda for the day. The way I draft my agenda is by making a list of subjects I would like to investigate/discuss and putting them in a (for me) logical order. I use this list to create a time table for all the subjects and adding coffee/lunch breaks in between. The most important subjects get the most time.

Once the agenda and time table are clear, I focus on collecting (the right) information. I typically do my research by reading documentation, blogs and watching YouTube videos to gain knowledge on the subjects I am preparing. Sources used during my research might be used later during our meetup as well. There is no need to develop all materials used during our meetups ourselves if one could also use available resources on the Internet. Large part of the preparation is filtering out the right information and structuring it in a way that it makes sense. When putting together a program I always try combine theory with some practical exercises. I firmly believe that you learn best by having a good basic understanding about a subject and then practice with it yourself.

At Sourcelabs we all have a Java programming background, this gives us an advantage when learning a new programming language #weknowjava, so no need to start with a beginner tutorial. I found a nice YouTube video explaining the Python language basics and comparing them with their Java equivalent, this video explained at least the basic Python language constructs. Once you know the basics, you are ready for more. And now it becomes interesting, because I don’t want to bother people writing a Hello, World! application, I focussed on collecting information about Python best practices and information around working with Python in “real” world applications. This means trying out a lot of things yourself and also failing a lot and gaining new insights along the way.

Learning a programming language means figuring out more about the ecosystem and understanding what libraries/frameworks/packages are common when developing applications in the ecosystem. In the Java world, knowing your frameworks and how to retrieve the packages is an important part of our work too. We continued our Python journey watching a YouTube video about the Python package manager, learned about pip, and how to use virtual environments to manage versions of our packages in Python applications. We gave it a try using IntelliJ IDEA and played around with Python and virtual environments using the excellent Python support provided by IntelliJ.

Coming from a Java background I felt that having type checking in Python applications is kind of mandatory too, we watched a YouTube video about Python type hints and how to use mypy for type checking.

Most Python devs have probably heard about or worked with Django or Flask. Inspired by the Thoughtworks technology radar (https://www.thoughtworks.com/radar/languages-and-frameworks?blipid=202104087) I decided to give FastAPI a try instead of looking at Django or Flask. At Sourcelabs we have a lot of experience building backend systems/microservice and exposing APIs and FastAPI is very well suited for that. I made up an assignment where everyone had to develop an API using Python and FastAPI and had to expose some of the Chuck Norris quotes from: https://api.chucknorris.io/ using a FastAPI endpoint.

In around 4-6 hours we covered a lot of ground. We learned about the Python language basics, worked with virtual environments and developed a small API application using FastAPI. During these meetups I always really enjoy the fact that people come up with all kinds of interesting questions and useful discussions we have about the technology we are exploring.

At 14:00 hours we had to call it a day and packed our stuff and headed to https://www.downunder.nl/ for some wakeboarding. We were really lucky with the nice weather and had a few drinks outside in the sun before crashing into the water 😉 After the wakeboard session and a hot shower we ended our day with a nice dinner!

Did you enjoy this content? We have got more on the way! Sign up here for regular updates!

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *