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