5 ms·
Forgive me if I missed this, but I would highly recommend talking about virtual environments, pypi, and the existence of other things like pipenv. The environm
by Waterluvian 7y ago
Forgive me if I missed this, but I would highly recommend talking about virtual environments, pypi, and the existence of other things like pipenv.
The environment/dependency management story for Python is such a tire fire and I wish someone introduced me to it from a reasonably high level at the very beginning of my time with Python.
It doesn't have to dig deep. Just needs to talk about what these things are, why they exist and why it's such a challenge.
Too often I think people skip over these topics, considering them as nothing more than a means to an end. But by far and wide my largest challenges with Python has been environment and dependency management.
- airstrike 7y agoI second this. Sure, there's a huge value in the beginner-friendly structure that Jupyter notebooks provide, but it's also a limiting factor as it's just a very small subset of the Python experience (I've personally never edited a single .ipynb file in my life)
- rahimnathwani 7y agoNote, this is intended for people who will use python for data science, not for future software engineers. Data scientists using python but not using jupyter notebooks is the exception.
- webartifex 7y agoThat is correct. But even then, I think in the future the data scientist role and the data engineer role will converge and the person doing this must know virtual environments.
- jonfw 7y agoIn the future we will likely have different tools to handle dependencies and environments. If these things aren't immediately useful, it might be worth teaching other stuff instead.
- webartifex 7y agoLet's hope poetry will become a standard. Opinionated, I know :)
- Waterluvian 7y agoFourth time is a charm!
- webartifex 7y agoI agree that this is important. My personal choice is to use pyenv together with poetry on a Linux machine. Yet, please understand that I teach this course to absolute (!) beginners. That is why I chose to use the Anaconda Distribution in class, which comes with every package installed that I want my students to study. Making your first steps in programming is hard enough and so I want to keep the "boiler plate" as small as possible. But dependency management will be part of the more "advanced" lectures I will do in the future.
- Waterluvian 7y agoI hear you. There's probably no one "right" answer because as I type this, I'm already conflicted with my own opinion. There's already a mountain of important topics to teach. What's on my mind is that all of the "meta" parts of programming are usually seen as "boilerplate" when they make up such a critical part of "authoring" meaningful software. I'm approaching this concern from my personal experience in university. I took a 100 level "CS for Non-CS majors." We did all the formal CS stuff like talking about variables, functions, loops, recursion, etc. but by the end of the course I was still never taught how to take my java applications and package them in a way that I could share with my friends. It felt very much, "you can do so much with a computer... as long as you stay within the environment we rushed you through setting up and use the few libraries we gave you." (I wrote a Reversi game for my girlfriend and shipped it by installing the entire development environment on her laptop! Hah.) I guess my $0.02 is, maybe near the start, I would have loved a little detour block, "If you want to learn how to take these Python scripts/programs we're writing and share them with the world, check out this advanced chapter at the end of the book!" The same might probably be true for, "if you want to play with other Python libraries, take a peek at this chapter that talks about pypi and environments!"
- webartifex 7y agoGood idea. This will go into the course in the future.
- Wowfunhappy 7y agoAs a related note, this is what I think we really lose as we move to computing environments like the iPhone with absolutely mandatory code signing. I've heard it said that "oh, if you're a kid with an iPad and you just want to learn, you can download the little Swift playgrounds app, easy!" But the thing is that the children I've worked with don't want to create stuff inside a toy app that only other people with the toy app can use—they want to create programs that feel real. Sure, maybe the only thing that real app does is display a guess-the-numbers game, but still, you can install it on the computers of your parents and friends and say "look, I made this app!" iOS devices just don't let you do it. Android, Windows, and macOS does, and I really hope we don't loose that in the name of security.
- memco 7y agoI agree. One of my most memorable unanswered questions from my first C programming class is where the things we imported came from. I wondered how to inspect them so I would know what's available in those libraries, how to use it and to some extent how I would build my own. I moved on from C and so in the end it didn't matter much, but when you do settle into a language long term it is really helpful to know how to navigate docs, system/standard library and packaging tools so that you can participate in the ecosystem effectively.
- j88439h84 7y agoStrongly recommend ignoring virtualenv, venv, and pipenv; and using Poetry instead. Poetry is simple and feature-complete where the others require you to learn all kinds of minutiae. http://python-poetry.org/ http://python-poetry.org/
- kyawzazaw 7y agodidn't know about this. Thank you for sharing. Looks really clean.