Modern Python Projects Transcripts
Chapter: Cookiecutter templates
Lecture: Starting a new project can be hard
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
What do you do when you want to build a new Python application? Do you stick with the same tools and techniques that worked fine in the past 10
0:08
projects that you build? Do you use this new cool library or framework that you
0:13
just found recently, or do you search for the best Python library for X. Each of this option has some drawbacks.
0:20
If you stick with the same tools that you have been using for years, you are playing it safe. If something worked for you 10 times,
0:27
there is a huge chance that it will work. Fine this 11th time, and since you are using a framework or a library that
0:33
you know very well, you will be more efficient and you will build it quite fast. But you might be missing on a new tool that could help you build
0:41
your application even faster. A library that has some features that you need, so you don't have to write them from
0:46
scratch or a Web framework that this 100 times faster and could save you a lot
0:50
of money because you could deploy your application on a much cheaper server and still handle
0:56
all the incoming traffic. And maybe there are no tools and techniques that worked fine
1:00
in the past 10 projects, because this is your first Python project, so you are not sure what to use.
1:06
So maybe you decide to try a new framework this time, something that you found on
1:09
Hacker News or some other website where programmers share the cool things that they have built. It looks very promising. According to the benchmarks.
1:18
It's faster than all the other frameworks. It has a beautiful documentation, and they GitHub
1:23
Repository looks very active. Every new issue is addressed almost immediately. It's a great framework, you think,
1:29
and you start using it in your project. Fast forward one year. It turns out that the creator of the framework no longer has time to work on it,
1:37
so no new version has been released since half a year. You had to fork this framework because there were some security vulnerabilities that you had to
1:45
fix. At some point, you decided to finally give up and rewrite your project
1:50
in a different framework, something that has been around for long enough so there is a much smaller chance that it will be abandoned.
1:57
If this was your personal project, then selecting a wrong framework will only cost you time.
2:02
But if that was a project at work, now you have to explain to your boss why instead of working on those new features,
2:09
you will have to spend a few weeks rewriting this application in a different framework.
2:13
And that means losing money. If there was one thing that I learned about companies is that they don't like losing money.
2:20
Instead, we should look for a middle ground. There might be some libraries or a framework that are much more suitable for your new
2:27
project, then what you have used in the past. At the same time, you need to make sure that whatever library you choose will
2:34
still work in the next few years. So, what people commonly do is to search for recommendations from other programmers.
2:41
We look for phrases like fastest Python Web framework or best graphQL library for Python. Then we start doing our research.
2:49
We read articles. We compare the number of stars in GitHub for each recommendation etc... This is a good approach.
2:56
The more time you spend doing the research, the more likely you are to choose the best tools.
3:01
But sometimes the number of alternatives can be overwhelming, and it might be hard to choose one.
3:06
Some people recommend one framework. Others say that it's bad and you end up confused.
3:10
Wouldn't it be better to have a recommended solution for a specific problem like a
3:16
recommended way to, build a Python library or recommended set up for a Django application with user authentication and some common features?
3:24
Well, I don't have a perfect solution. I have a solution that worked well for me, so chances are that it will work well for you.
3:31
The solution is called cookie cutter.