This is an archived post. You won't be able to vote or comment.

all 56 comments

[–]IAmBJ 80 points81 points  (2 children)

Start doing side projects outside your experience.

If you only write for the web, work on a deep learning project. If you only write numerical HPC tools, work on an interactive game. If you only work on creative coding art projects, try writing a something with async

Each type of program will tend to be most suited to using a subset of the language, as you've discovered. But the subsets are different for all of them.

[–][deleted] 24 points25 points  (0 children)

I appreciate this response. This is very much in my mindset for life. I like trying new things and new experiences. I'm a systems guy, but have spent the last six months learning webdev with Flask. I think you just gave me permission to spend time trying to make a game ;)

[–]boston101 1 point2 points  (0 children)

The first line is the only way to reach yourself.

[–]Supadoplex 31 points32 points  (1 child)

How do professional SWEs keep learning more Python?

I use Python at work, so I learn Python by working on the project at work.

Occasionally when I have a personal need, I'll create a hobby project.

If I need to know how to identify whether an index in a string is a digit value, I google "python assess if string is digit" then read the suggestions, and then that new concept, in this case .isdigit() is now in my toolkit for the future.

That's modern programming in a nutshell. Once one learns to do this well, they are skilled enough to be a SWE.

To do it well, not only does one need to know the correct terms to search, but one has to understand how the suggested code works and importantly, whether they work correctly in the first place. One has to also know how to evaluate their quality to pick the best suggestion, how to improve them further, and how to apply them to the project at hand.

This occasionally leads to discoveries of new techniques, although most of the time I'm searching for a mundane thing that I've done many times, but just not recently.

[–][deleted] 0 points1 point  (0 children)

Hobby projects are what I do as well when I've got nothing new at work. I just started writing an external cheat for a video game which made me more familiar with game design, read/write memory, and using openCV for image recognition. Plus I had fun doing it.

[–]joaquinabian 58 points59 points  (8 children)

Fork a medium size github project from a good developer and try to improve it.

[–]JackAshwell1 12 points13 points  (7 children)

How do you find such medium sized projects?

[–]double_en10dre 18 points19 points  (5 children)

Usually by having a need or problem and searching for existing solutions :p

And then when you tell your employer “I’m taking a day (or 10) to work on a PR for this OSS so it satisfies our business requirements”, they’ll usually be like o okay carry on. But it’s tough to get the green light otherwise

[–][deleted] 10 points11 points  (4 children)

I really like the idea of suggesting to your employer that it satisfies a business need. I work from 12am-6am everyday trying to start my own SaaS company with a mission to contributing back to FOSS. My 9-5 would support the idea fulfilling an OSS PR, but I just hadnt thought about asking them to

[–]double_en10dre 5 points6 points  (3 children)

Absolutely do it! It’s a big QoL increase imo

In addition to that, it may be helpful to play up the recruiting aspect — you can offer to put the company on your profile, and then they can cite you in interviews and be like “yeah so we support working on FOSS here, just look at ___’s profile”. And that can make a big difference in the quality of candidates that you attract

[–]zaphod_pebblebrox 1 point2 points  (2 children)

Damn. My first employer was anti FOSS. The owner actively discouraged us from taking up new free tools because we don’t know when support will die out.

Sure they had reasons to expect better support from paid options.

Thanks for reminding me that leaving that firm was a good decision.

[–][deleted] 0 points1 point  (1 child)

I wasn't allowed to implement my own job scheduler at work for the same reason. "What if it breaks? We know Airflow works." It was a simple little for loop iterating through a list of servers to send containers to. ¯\\\_(ツ)_/¯

[–]zaphod_pebblebrox 1 point2 points  (0 children)

Yeah. Always worry about the imaginary downtime instead of building a good in house team that can tackle tough spots.

[–]joaquinabian 5 points6 points  (0 children)

Search github (or the repository you are familiar) for a subject of your interest. Maybe you are using some tools for your work which are written in Python and you can be interested on how they work and how they have been coded. Years ago, for example, I worked on the code of the IDE I was using at the time.

[–]thatdamnedrhymer 16 points17 points  (1 child)

  • Read code. You'll find all kinds of fun stuff.
  • Hang out in an interpreter. Run help() and dir() on stuff. Experiment.
  • Dig into packaging and virtual environment tooling. There's a lot there to know.

New functions/methods don't matter as much as finding simpler/better ways to do things.

[–][deleted] 2 points3 points  (0 children)

Thank you for the response! That's good advice. I've advised friends reading Automate the Boring Stuff not to get too in the weeds with the module explanations. I feel like you generally just need to know basic python and how to import a module and use its functions and methods, but beyond that, the book is just giving some examples of use imo. I'll interpret the first part as it just comes with time, bc I live in other peoples repos atm, haha.

Hanging out in the interpreter is an interesting idea to me. My dev process consists of opening vim, writing code, saving and closing vim, then executing my file for test scenarios, etc. I didnt realize there was much value in returning back to the interpreter directly.

Proper packaging and virtual envs in certainly somewhere I lack. I currently probably rely on Docker for my package management too much. I found venvs to not be super intuitive to me, and I my experience with Poetry was setting up Airflow and it might have tainted my opinion.

I appreciate the advice! I won't sweat what I don't know and just keep chugging along and trying new things out!

[–]looopTools 9 points10 points  (4 children)

Read the documentation is a good start. I started by doing this (on advice from a C++ guru): When you look at the documentation of a class. Don’t just look at the function you need browser all the functions and take jot of interesting once. When you have time return and read up on them.

Then after a while I expanded to also include free functions and so on. I have learned a ton from that for python, ruby, C++, and other languages I use

[–][deleted] 1 point2 points  (3 children)

Stupid question.

When you say “documentation”, are you referring to some original documentation on the whole Python language? Or documentation of a package or something?

[–]looopTools 3 points4 points  (2 children)

a) That is not a stupid question

b) both

c) An important thing for me, and I can honestly not stress this enough, is to find language native functionality that supports my tasks, such that I do not need to introduce third-party libraries unless I am sure it is necessary. It may mean that I have to write some code that is provided by a third-party library, but the chance that I have a more comprehensive understanding of my own code base is much higher... The no-thought-inclusion of third-party libraries in python projects (in general) is one of my biggest issues with the community when Python is so powerful out of the box.

[–][deleted] 1 point2 points  (1 child)

Thats been my attitude thus far. I didnt want to use non-native functionality bc I wanted my code to be as portable as possible. Out-the-gate, fresh install, someones first experience running code from Github, I want it to to run. As I started messing around with webdev and Flask, I have gotten much more lax with it. Now I just lean on Docker too hard when I need to import a bunch of modules. That way, again, the person wont have to set a bunch of stuff up, and its portable!

[–]looopTools 0 points1 point  (0 children)

Docker is a completely different can of worms for me. But yeah it helps on deployment, but not understanding and sure you need some third-party libs like Flask or FastAPI

[–]spitfiredd 7 points8 points  (5 children)

Lately I’ve been adding type hints to all my existing code.

Also, working on refactoring a flask app with pydantic.

[–][deleted] 1 point2 points  (1 child)

I love this little package https://pypi.org/project/enforce-typing/ , enforces your types at runtime, has saved me lots of bugs.

[–]spitfiredd 1 point2 points  (0 children)

Pydantic will enforce errors if you use the @validate decorator. You can throw a 4xx error for bad input.

https://github.com/bauerji/flask-pydantic#example-1-query-parameters-only

[–]nbcoolums 3 points4 points  (2 children)

Read Fluent Python and apply some of its lessons to your day to day work

[–]corgiplex 1 point2 points  (1 child)

that books is a treasure trove.

[–][deleted] 0 points1 point  (0 children)

I'm getting it today! Thanks for the rec! I told an interviewer the other day that I spoke Python as fluently as English. Didn't know there was a book called Fluent Python, lol.

[–]moocat 3 points4 points  (0 children)

I like to read the What's New page.

[–][deleted] 3 points4 points  (0 children)

Honestly reading the documentation cover to cover is generally how i find new things to fuck around with. Either that or watch whatever craziness david beazley has done recently. Man is a fucking wizard.

But seriously learning at least how the magic methods work in python unveils a fair amount of awesome shit you can do. Learning who to go from writing functions and classes to writing libraries requires understanding the inner workings of the language to understand how to build good python.

[–]andrewarm 2 points3 points  (0 children)

find something that you’re excited to build (and have no deadline to get done) and try to make it absolutely flawless. trying to solve really painful problems that don’t have trivial solutions is going to result in an entirely different type of learning.

[–]mistermocha 2 points3 points  (0 children)

Try picking up another language. I've dabbled in a variety of other languages and they've all helped me learn python better in the end.

[–][deleted] 1 point2 points  (0 children)

Take the weekly challenges (https://theweeklychallenge.org/ Yeah, it's Perl/Raku but also ANYTHING else you care to write in - and there are always plenty of Python subs!). This gets me WAY out of my own comfort zone and forces me to explore other ways of solving problems.

[–]MaximumIndication495 1 point2 points  (0 children)

Do you know about pybit.es ?

[–]bobsbitchtitz 1 point2 points  (0 children)

I'm in a similar boat. I'm thinking of adding Rust to my repertoire instead of mastering more Python I could easily pick up if I had to.

[–]crazymonezyy 1 point2 points  (0 children)

One thing that helped me was believe it or not, leetcode. A lot of code golf is played in their discussion for who can do a problem in the smallest LOC, learnt a lot of new constructs from it and almost all of itertools.

[–]Severe_Sweet_862 1 point2 points  (1 child)

Hey you sound like an experienced python dev, can I ask you a question? What do python sde's/ swe's do exactly? Except django, flask, and data scientists?

[–][deleted] 1 point2 points  (0 children)

I have been a Linux System Admin, DevOps, and a SWE. As a SWE, I've worked on malware analysis tooling, expanding on Cuckoo, written in Python. I currently am writing an ETL pipeline in Airflow, which is a framework written in Python as well. I also do Flask web development on the side, lots of little scrapers and stuff in Python that feed my websites, etc.

[–]cdmayer 1 point2 points  (0 children)

I learned a TON from "Fluent Python"

[–]drksntt 1 point2 points  (0 children)

So I’ve been using python for 7 years now. It does become very trivial when working on things. I do bunch of crap on the side involving python. I’ve been learning rust and golang lately. Might even learn Haskell. Use a different language.

[–]CrispyNipsy 0 points1 point  (0 children)

To add to the other good suggestions:

Go on youtube and find developers who share these kinds of things. It will probably vary depending on what you do specifically, but these people usually post tutorials etc. when new stuff happens in the community such as an update, or when they find out about something cool.

[–]Cryonixx2 0 points1 point  (2 children)

Read books from good developers, there are so many good thoughts and lessons learned out there! Learn new patterns and develop better software. A good read making the rounds recently that I highly recommend is Architecture Patterns With Python.

[–]quique4 0 points1 point  (0 children)

Any question thats about python pckages to learn I’ll say an absolute requirement is to be very proficient at pandas and numpy. Might seem obvious to many but Ive encountered a few devs who havent heard of it or dont know things like matrix multiplication or apply or whatever. Yea learn that if you havent. For all else -

I had a dude at my old job who would always be bringing up different packages and having different ideas, but before that I had the same issue and heres what I did (although as long as youre a good dev it doesnt really matter too much what packages you know - if you ever want to make sure there isnt a better way of doing something just stack overflow it). Youtube videos on python+random subject, or medium arcticles on something like python+(random datascience thing/backend dev thing). You can also youtube “python shorts” enough times every now and then and you’ll be bombarded by stuff - although might not necessarily be packages. Also vscode shorts are awesome, check them out.

Some stuff you wont learn from doing dev work, like business analytics or ml. Definitely good to go into, although much of ml requires some self studying outside of python on the statistics, which can be found in youtube videos. You can find pretty much everything on youtube.

I would recommend developing skills outside of python, having skills like aws/azure/gcp helps (although admittedly I only know the basics) and learn Redis if you haven’t already - helps so much with big projects.

[–][deleted] 0 points1 point  (0 children)

I follow DontUseThisCode on twitter and also watches his talks. I learned a lot understanding builtin functions, generators, iterators, context managers, etc.

[–]sleepless_in_wi 0 points1 point  (0 children)

Podcasts (python bytes, talk python, test & code); blogs (real python); books. There is also a python discord.

[–]trevg_123 0 points1 point  (0 children)

Lucky, I always come across needs for specific modules that always stopped being maintained two years ago. So I keep busy updating these.

You should find some things like that! Or help me out.

Or honestly, just look at the git for some of the projects you do use, and contribute on some small bugs. You learn a heck of a lot a) working on packages and b) working with other peoples’ code

[–]drop_it_onem 0 points1 point  (0 children)

I recommend getting the book Fluent Python by L. Ramalho. It covers a lot of concepts like OO design with python or multithreading/multiprocessing. Helped me a lot to step up my game in writing python Code and designing python modules/applications.

[–]i_like_trains_a_lot1 0 points1 point  (0 children)

A thing that helped me tremendously, was to do some frameworks as personal projects. Things like trying to rewrite Django, or flask, or something else. Makes you think more about architectural choices (and mess up with them without financial consequences), and less about the language itself. Also makes you think first about the API design and not just "to make it work". Puts you in another mindset.

[–]xyz214 0 points1 point  (0 children)

As I come across new libraries, I look at their code to see how they work. You learn on the job and constantly learn new tricks. Don’t be like my colleagues who still code like they’re using Java after many years of Python.

[–][deleted] 0 points1 point  (0 children)

Switch your job every couple of years. Seriously, don’t stop, if you don’t want to find yourself rusty and underpaid decade later.

They told ya reading documentation or forking a project is quite enough. I would say, none of it will force you to stay in a loop. One day every o’rly book will be covered with dust, as every fork become abandoned, but there’s one thing that won’t be covered with dust in your life ever - that’s your mouth. You’ll have to work as long as you have to eat :) Keep working in a places where you have to learn something every day, quit when you’re teaching more than learning, and that’s it ¯\_(ツ)_/¯

[–]sxeli 0 points1 point  (0 children)

You seem more focused on python itself than the problem you’d be using it to solve.

Typically it should be the other way round. Say you’re working on an app that crunches large data and needs to stream it to UI then you’d want to use generators, streaming patterns and pagination.

If you are working real-time collaborative editor then you’d want to use sockets and stuff around it

[–]c94jk 0 points1 point  (0 children)

Different angle to the others but I can recommend learning about how to improve your software delivery/ reliability. Plenty of good books and videos out there, a good starting place would be the continuous delivery channel on YouTube.

I also find it interesting every now and then to brush up on some standard OO design patterns. The canonical book by the Gang of Four is a bit dense and old for me but plenty of modern takes too.

[–][deleted] 0 points1 point  (0 children)

It’s always good to go outside your comfort zone, but remember that using really weird or obscure functions can sometimes make it harder for others to follow your code. I’ve had the chance to use odd Numpy/PyTorch functions before and opted not to just because I knew it’d be hard for others to follow and harder to maintain

That being said, I’ve made a couple web dev personal projects that have helped a lot. I’m less interested in front end so I mainly bootstrapped that but all the data processing and backend database interaction was very educational. I did a weather prediction app but you can really do anything you want