{"id":414034,"date":"2022-03-09T18:40:26","date_gmt":"2022-03-09T15:40:26","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/dont-use-python-if-youre-starting-a-big-project\/"},"modified":"2022-03-09T18:40:26","modified_gmt":"2022-03-09T15:40:26","slug":"dont-use-python-if-youre-starting-a-big-project","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/","title":{"rendered":"#Don\u2019t use Python\u2026 if you\u2019re starting a big project"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2f8d25404dd\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2f8d25404dd\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#%E2%80%9CDont_use_Python%E2%80%A6_if_youre_starting_a_big_project%E2%80%9D\" >&#8220;Don\u2019t use Python\u2026 if you\u2019re starting a big project&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Variable_declarations_dont_exist_and_thats_a_problem\" >Variable declarations don\u2019t exist and that\u2019s a problem<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Oh_module_where_do_you_belong\" >Oh module, where do you belong?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Dependency_collisions_en_masse\" >Dependency collisions en masse<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Different_machines_different_Pythons\" >Different machines, different Pythons<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#The_world_beyond_pip\" >The world beyond pip<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Locking_out_performance_with_the_global_interpreter_lock\" >Locking out performance with the global interpreter lock<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#Concurrency_and_parallelism_are_still_clunky_and_messy\" >Concurrency and parallelism are still clunky and messy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/buradabiliyorum.com\/en\/dont-use-python-if-youre-starting-a-big-project\/#What_to_use_instead_of_Python\" >What to use instead of Python<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CDont_use_Python%E2%80%A6_if_youre_starting_a_big_project%E2%80%9D\"><\/span>&#8220;Don\u2019t use Python\u2026 if you\u2019re starting a big project&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><img decoding=\"async\" src=\"https:\/\/img-cdn.tnwcdn.com\/image?fit=796%2C417&amp;url=https%3A%2F%2Fcdn0.tnwcdn.com%2Fwp-content%2Fblogs.dir%2F1%2Ffiles%2F2021%2F07%2Fpython-code.jpg&amp;signature=8d478350594927078f86ca5435c4d2b0\" \/><\/p>\n<div>\n                            There is a certain point in a developer\u2019s career where you go from contributing to projects to inventing your own schtick. For some it\u2019s earlier, for some later, and some never get there at all.<\/p>\n<p>Most developers with a long career do experience this point, though. I\u2019ll call it the <em>build-it-yourself point.<\/em><\/p>\n<p>If you\u2019ve arrived there yet, you know what the first questions are: How does it work? What does the user experience? What\u2019s the architecture? How does the data flow? And many more questions like this.<\/p>\n<p>I won\u2019t answer these answers for you here. They\u2019re highly specific to whichever project you\u2019re starting. And every single one of these questions deserves at least one article of its own.<\/p>\n<p>I will answer one question though: <em>Which language is best for the project?<\/em><\/p>\n<p>You might be thinking that this is very project-specific, too. And you\u2019re not totally mistaken.<\/p>\n<p>But every programming language has a few pitfalls. And Python, it turns out, has quite a lot of pitfalls. Especially when you\u2019re trying to build a large program with it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Variable_declarations_dont_exist_and_thats_a_problem\"><\/span>Variable declarations don\u2019t exist and that\u2019s a problem<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.python.org\/dev\/peps\/pep-0020\/\">Zen of Python<\/a> states: Explicit is better than implicit.<\/p>\n<p>But when it comes to variable declarations, implicit is way more common than explicit in Python.<\/p>\n<p>Consider, in contrast, this small <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.geeksforgeeks.org\/strings-in-c-2\/\">piece of C code<\/a>:<\/p>\n<pre>char notpython[50] = \"This isn't Python.\";<\/pre>\n<p>Let\u2019s dig into this before we get back to Python.<\/p>\n<p>The \u2018char\u2019 is a type identifier and tells you that everything hereafter relates to a string. The piece \u2018notpython\u2019 is the name that I\u2019ve given to this string. The [50] tells you that C will reserve 50 characters\u2019 worth of memory space for this. Although, in this case, I could have gotten away with 19 \u2014 one for each character plus a null character \\0 at the very end. And, finally, a semicolon to end this neatly.<\/p>\n<p>This kind of explicit declaration is <em>mandatory<\/em> in C. The compiler will go on strike if you omit it!<\/p>\n<p>This way of doing things seems silly and tedious at first.<\/p>\n<p>But it pays off. Bigly.<\/p>\n<p>When you read C code two weeks or two years later and you stumble across a variable you don\u2019t know, you just check the declaration. If you gave it a meaningful name, that already gives you a big clue what it is, what it\u2019s doing, and where it\u2019s needed.<\/p>\n<p>Compare that to Python.<\/p>\n<p>There you pretty much invent variables as you go. If you didn\u2019t give it a meaningful name or at least left a comment about it, your future self will be messed up.<\/p>\n<p>In Python, there\u2019s no way to understand what a variable is doing except digging right into the code.<\/p>\n<p>But if you get a single typo in a variable, you can break your whole code. There is no safeguard declaration like in C.<\/p>\n<p>That\u2019s fine as long as you\u2019re working on smaller projects of say, a couple thousand lines of code. Or if your project isn\u2019t very complex.<\/p>\n<p>But with larger projects\u2026 Shit hits the fan.<\/p>\n<p>You can do explicit variable declarations in Python. But only the most diligent programmers do that. And when the compiler doesn\u2019t complain, many forget about additional lines of code like these altogether.<\/p>\n<p>Coding Python is fast.<\/p>\n<p>Reading Python is easy, for small and simple projects.<\/p>\n<p>Reading and maintaining large Python projects \u2014 you\u2019d better be a world hero at finding de<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">script<\/a>ive variable names and commenting out all your code, you\u2019re done messed up.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Oh_module_where_do_you_belong\"><\/span>Oh module, where do you belong?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you thought that things can\u2019t get much worse, you\u2019re wrong.<\/p>\n<p>The question where a variable starts \u201cliving\u201d in your code doesn\u2019t stem from implicit declarations only.<\/p>\n<p>Variables may come from <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/3\/tutorial\/modules.html\">other modules<\/a> as well. They\u2019re usually in a form like my_module.my_variable().If you\u2019re confused by such a variable, you\u2019re not finished when you\u2019ve checked where else it appears in the main file.<\/p>\n<p>You\u2019ll also have to check if there\u2019s a line called one of these two things:<\/p>\n<pre>import my_module&#13;\nfrom another_module import my_module<\/pre>\n<p>In the second line you\u2019re telling the compiler which function or variable you need from a module that contains more stuff.<\/p>\n<p>This is annoying because there are more modules than the ones you can find on <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/pypi.org\/\">PyPI<\/a>. You can also import any other Python files on your computer. So quickly googling your function or variable won\u2019t always help.<\/p>\n<p>But it gets even worse.<\/p>\n<p>Modules can depend on other modules. So if you\u2019re unlucky, you imported modules A, B, and C, but these depend on modules E, F, G, and H, which in turn depend on I, J, and K. And suddenly you don\u2019t have three but ten modules to manage.<\/p>\n<p>What\u2019s worse, sometimes it\u2019s not such a simple tree. Say B and C also depend on M and N, and J also depends on M, and C and H depend also depend on Q\u2026 No need to follow along, you get the idea.<\/p>\n<p>It\u2019s a labyrinth. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/laptrinhx.com\/dependency-hell-monorepos-and-beyond-2275028771\/\">Dependency hell<\/a> is a real thing, coined by Pythonians.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/stackabuse.com\/python-circular-imports\/\">Circular dependencies<\/a> are the ugliest beast in the labyrinth. If module A depends on module B, but B also uses parts of module A \u2014 ouch.<\/p>\n<p>Not a big deal in small projects. But in big ones\u2026 welcome to the jungle.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Dependency_collisions_en_masse\"><\/span>Dependency collisions en masse<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Oh, I\u2019m still not finished with my rant on modules. It\u2019s not only the modules themselves, but also their versions.<\/p>\n<p>In principle it\u2019s great that Python has such an active user base and many modules are updated regularly. There\u2019s just one problem: not all versions of a module are always compatible with other modules.<\/p>\n<p>Say for example you\u2019re using modules A and B. Both depend on module C. But A requires C in version 3.2 or later, and B needs C in version 2.9 or earlier.<\/p>\n<p>You don\u2019t care about C. You only want A and B.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/knerd\/the-nine-circles-of-python-dependency-hell-481d53e3e025\">No tool in the world<\/a> is going to help you with this conflict. If you\u2019re lucky, you\u2019ll find a patch written by someone who has encountered the same problem as you. If you\u2019re not so lucky, you\u2019re going to have to write the patch.<\/p>\n<p>Or you use a different package. Or you rewrite one of the packages, A or B, completely, and find workarounds everywhere the wrong version of C is needed.<\/p>\n<p>In any case, you\u2019re going to need extra time for this.<\/p>\n<p>It\u2019s a jungle, and you\u2019ll need patience and some tools to navigate it.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/knerd\/the-nine-circles-of-python-dependency-hell-481d53e3e025\">Dependency collisions aside<\/a>, there are some nice tools around. There\u2019s \u2018pip\u2019 that makes it easy to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/pypi.org\/project\/pip\/\">install packages<\/a>. With a simple \u2018requirements.txt\u2019 you can <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/knerd\/best-practices-for-python-dependency-management-cc8d1913db82\">specify which packages<\/a> and which versions you want to use instead of polluting your file headers. And <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/3\/tutorial\/venv.html\">virtual environments<\/a> keep all packages in one place and apart from your main Python installation.<\/p>\n<p>For bigger and messier projects, there\u2019s also \u2018conda\u2019, YAML files, and more.<\/p>\n<p>But you\u2019ll need to learn how to use each tool anyways. And you\u2019ll need to spend a minimum amount of time dealing with these problems.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Different_machines_different_Pythons\"><\/span>Different machines, different Pythons<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Linked to this whole world of dependency hell is yet another uncomfortable topic.<\/p>\n<p>Even if you\u2019ve resolved all dependency issues on your machine and your Python runs smooth like a newborn horse, there\u2019s no guarantee that it will run on other peoples\u2019 machines.<\/p>\n<p>Do newborn horses run at all? I have no idea but it seems like I\u2019m trying to seem more savant in biology than I\u2019ve ever been. Anyway, back to Python.<\/p>\n<p>Tools like \u2018pip\u2019, \u2018requirements.txt\u2019 and virtual environments will help you navigate mild forms of dependency hell. But only locally.<\/p>\n<p>On every new machine you\u2019ll need to check and potentially reinstall each single requirement and its version.<\/p>\n<p>The only really portable solutions are <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/jupyter.org\/\">Jupyter notebooks<\/a>. Here you can write things in any version you like. In Jupyter everything runs on an online server, so you can send these files to anyone and they\u2019ll be able to use them out-of-the-box.<\/p>\n<p>There\u2019s a significant drawback to this, though: Jupyter notebooks have a graphic interface only.<br \/>I don\u2019t want to sound like a die-hard terminal afficionado. But with graphic interfaces it\u2019s quite difficult to handle large projects with many interlinked files.<\/p>\n<p>Maybe that\u2019s why I\u2019ve never seen a large project in Jupyter notebooks. Even though they surely exist.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/digital.com\/best-web-hosting\/java\/jvm-programming\/#:~:text=Let%27s%20start%20with%20the%20most,were%20developed%20expressly%20for%20JVM.\">Other languages<\/a> just have virtual machines. Problem solved.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"The_world_beyond_pip\"><\/span>The world beyond pip<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Say you\u2019ve managed to port your project to different machines by using <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.jython.org\/\">Jython<\/a> or <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.pypy.org\/\">PyPy<\/a> or a similar solution.<\/p>\n<p>All of which are slightly more clumsy to handle than a virtual machine. But hey, at least they work.<\/p>\n<p>If you\u2019re stringing together a big project, you might be integrating C packages, Fortran packages, and more. There are many advantages to this: C packages might not exist in Python, and are <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/codex\/how-slow-is-python-compared-to-c-3795071ce82a#:~:text=It%20is%20450%20million%20loops,mode%20for%20a%20better%20performance.&amp;text=Yes%2C%20it%20is%20unbelievable!,45%2C000%20times%20faster%20than%20Python.\">usually faster<\/a>. Scientific packages often exist only in Fortran for <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/scicomp.stackexchange.com\/questions\/11514\/python-vs-fortran#:~:text=Python%20is%20used%20more%20widely%20overall%20as%20a%20general-purpose,for%20users%20in%20that%20domain.\">legacy reasons<\/a>.<\/p>\n<p>In effect, you\u2019re going to have to use compilers like \u2018gcc\u2019, \u2018gfortran\u2019, and perhaps others more.<\/p>\n<p>And that\u2019s a hassle! The documentation for integrating C modules in your Python code is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/realpython.com\/build-python-c-extension-module\/\">more than 4,500 words long<\/a> \u2014 twice as long as this article! And the documentation for Fortran <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/dektoud.github.io\/blog\/post\/fortran_dlls\/\">isn\u2019t that much shorter either<\/a>.<\/p>\n<p>Building your whole project in C might be slower to code at first. But you\u2019ll prevent situations where you have to mess around with multiple compilers and interfaces.<\/p>\n<p>C is so old that there\u2019s packages for almost anything. Even <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/analyticsindiamag.com\/top-10-libraries-in-c-c-for-machine-learning\/\">user-friendly machine learning packages<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Locking_out_performance_with_the_global_interpreter_lock\"><\/span>Locking out performance with the global interpreter lock<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The global interpreter lock, or GIL, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.youtube.com\/watch?reload=9&amp;t=12m11s&amp;v=KVKufdTphKs&amp;feature=youtu.be\">has been around<\/a> since day zero of Python. It made memory management incredibly easy for the end user.<\/p>\n<p>In smaller projects at least, developers don\u2019t have to think about computer memory at all when they use Python. Compare that to C where you literally reserve bits of memory for every single variable!<\/p>\n<p>Basically, the GIL counts how many times a variable has been referenced in every section of the code. If the variable is no longer needed, then it frees the memory space it occupies.<\/p>\n<p>In small projects, the GIL helps with performance-boosting because unnecessary memory space is wiped out.<\/p>\n<p>But in bigger projects there\u2019s a problem: the GIL doesn\u2019t like <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.techopedia.com\/definition\/24297\/multithreading-computer-architecture\">multithreading<\/a>.<\/p>\n<p>This is a very performance-boosting way of executing programs where several instruction threads run independently on the same process resources. <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/towardsdatascience.com\/speeding-up-model-training-with-multithreading-462df558d4f4\">Machine learning models<\/a> are great to train this way.<\/p>\n<p>There\u2019s just one little problem: the GIL only works on one thread at a time.<\/p>\n<p>So if variable A is getting executed on thread 1, while thread 2 is already finished with A, then its memory might end up getting deleted. It just depends where the GIL happens to be at the time.<\/p>\n<p>This can lead to very weird bugs, as you might imagine\u2026<\/p>\n<p>There are workarounds for this, but they are all <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/realpython.com\/python-gil\/\">not very pretty<\/a>. As an alternative, there\u2019s multiprocessing. But it <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a>ly <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.fusion-reactor.com\/blog\/multithreading-and-multiprocessing\/#:~:text=A%20multiprocessing%20system%20has%20more,runs%20parallel%20to%20each%20other.\">won\u2019t be as fast<\/a> as multithreading in <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/@geisonfgfg\/everything-i-know-about-global-interpreter-lockers-gil-880e1f4c45e0\">languages without a GIL<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Concurrency_and_parallelism_are_still_clunky_and_messy\"><\/span>Concurrency and parallelism are still clunky and messy<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We\u2019ve already seen one downside of concurrency. When you\u2019re doing <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.infoworld.com\/article\/3632284\/python-concurrency-and-parallelism-explained.html\">multithreading<\/a>, the global interpreter lock can slow things down. Or cause weird errors.<\/p>\n<p>The same downside applies to Python\u2019s <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.python.org\/3\/library\/asyncio-task.html\">coroutines<\/a>.<\/p>\n<p>There are some subtle differences between threading and coroutines, but the bottom line is that coroutines execute one task at a time, while threading can do multiple tasks at the same time. Both of them are implementations of concurrency.<\/p>\n<p>Coroutines are useful when you have tasks that require a lot of waiting around, like if you\u2019re reading website data and waiting for the server to respond. Instead of letting the computer sit idly by, coroutines assign another task to it.<\/p>\n<p>Threading, on the other hand, is useful when you have several tasks that are time consuming, but not too CPU-consuming and don\u2019t require too much waiting around. Streaming data could be named as an example.<\/p>\n<p>If you have a CPU-intensive task and you want to make the most of your hardware, you might want to give parallelism a try.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.toptal.com\/python\/beginners-guide-to-concurrency-and-parallelism-in-python\">Multiprocessing<\/a> is your best friend then. It basically tells the computer to use multiple cores and save time.<\/p>\n<p>All three techniques, threading, coroutines, and multiprocessing, face similar problems though. They\u2019re not that hard to implement in Python. But the code looks clunky and is hard to read, especially for beginners.<\/p>\n<p>Languages like Clojure, Go and Haskell are much better for concurrency and parallelism.<br \/>It\u2019s not worth a thought if you\u2019re not dealing with slow or intensive processes. But if you are, you might want to consider your options.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_to_use_instead_of_Python\"><\/span>What to use instead of Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Python isn\u2019t all evil. At all.<\/p>\n<p>But it has its downsides.<\/p>\n<p>If you want clearly stated variables and well-developed packages that won\u2019t bring you to dependency hell as easily, then C is your friend.<\/p>\n<p>If you want something that\u2019s portable to any machine, then Java, Clojure or Scala are great options. They run on a virtual machine, so you won\u2019t get into the same trouble as with Python.<br \/>And if you want to run big and slow tasks, you might want to give Go or Haskell a try. In the beginning they\u2019re harder to learn than Python, but the time you invest pays off.<\/p>\n<p>And you can always combine languages.<\/p>\n<p>Python is great for quick scripting, drafting, and even medium-sized projects. Many developers that I know make their first drafts and test runs in Python, then rewrite the important parts in C, Go, or Clojure.<\/p>\n<p>This makes the code execute quicker, and you still get to enjoy the advantages that Python gives you.<\/p>\n<p>In big projects, Python isn\u2019t forbidden. But it might not be the only language that\u2019s used.<\/p>\n<p>You can use Python like glue to piece together parts in C, Go, or Clojure.<\/p>\n<p>If you\u2019ve already reached your <em>build-it-yourself point<\/em>, remember that no one language is the Holy Grail.<\/p>\n<p>Despite its downsides, Python is cool and convenient. You can always get around the pain points by integrating code in other languages.<\/p>\n<p>Happy building!<\/p>\n<p><em>A big thank you to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/@janek_schleicher?source=post_page-----e77e9435d382-----------------------------------\">Janek Schleicher<\/a> for inspiring me to write this story.<\/em><\/p>\n<p><em>This article was originally published on Medium. You can read it<a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/medium.com\/geekculture\/want-to-start-a-large-project-keep-away-from-python-af840b6d21c2\"><span> here<\/span><\/a>.<\/em>\n                        <\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/thenextweb.com\/news\/dont-use-python-for-big-projects\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Don\u2019t use Python\u2026 if you\u2019re starting a big project&#8221; There is a certain point in a developer\u2019s career where you go from contributing to projects to inventing your own schtick. For some it\u2019s earlier, for some later, and some never get there at all. Most developers with a long career do experience this point, though&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":414035,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/img-cdn.tnwcdn.com\/image\/tnw?filter_last=1&fit=1280,640&url=https:\/\/cdn0.tnwcdn.com\/wp-content\/blogs.dir\/1\/files\/2021\/07\/python-code.jpg&signature=381734fcda63033359d3b1c53b875634","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-414034","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/414034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=414034"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/414034\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/414035"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=414034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=414034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=414034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}