What is the demand for Python in back-end development and what are some "starting" resources?

I'm relatively proficient in Python as I have been using it for many years now, and use it for my research in terms of data science. However recently I have felt that I'd like to branch off into having a more practical skillset with the Python skills that I already have and so am curious about back-end development with Python. However, many websites that are under the subject "Back-end development path" always slightly mention Python, but then recommend some other language such as Javascript. I'm curious if anyone could tell me about the demand of Python in back-end development, or even in anything other than data science, and what resources are there out there. I enjoy book resources, but it seems people don't recommend learning back-end development from books.

Posted Jan 24, 2019, 6:58 AM UTC

58
alchninja•

Python back-end development boils down to what you're trying to develop. The two most commonly used frameworks are Flask and Django. While they're two very VERY different frameworks for web development, they can both perform very similar functions (especially at the introductory level). To simplify a lot: Flask is more "abstract" and better suited for building microservices, while Django is a little more on-the-rails and generally more commonly used for websites and other services. Both approaches have strengths and weaknesses. Both frameworks have excellent official documentation, as well as active communities online.

To learn about web development with Python, I'd suggest watching sentdex's videos on building a website with Django. If you like books, maybe see if you can get some ebooks from Packet Publishing (they normally sell a bundle of development books on HumbleBundle, keep an eye out since it's always a killer deal). They also hand out one random ebook for free every day. Maybe think of a simple personal project that you can start with to explore the fundamentals of developing a website or REST API (or both). Heroku is a great place to host your app for free since they eliminate a lot of the complexity that normally comes with setting up hosting as a novice. If I remember correctly they also offer some free PostgreSQL storage if you need to hook up a database.

Finally, there are a few reasons we don't hear about Python for web development nearly as much as JavaScript:

  • With a solid understanding of JavaScript (and the requisite frameworks), you can technically write your entire stack with a single language. The most common setup I've seen is to use React for the front-end and Node.js for the backend. Full-stack development does have its caveats, but since Python doesn't have a competitor to frameworks like React, it generally makes sense for companies to double down on JS. Python is more or less strictly back-end, and should be more directly compared to Java or GoLang
  • In general, Python is slower than Node.js or Java (both of which can be magnitudes slower than Go when handling massive volumes of requests). Intrinsic limitations like the Global Interpreter Lock, restrictions with multitasking, etc tend to slow things down. In a world where we want the fastest response times possible, these inefficiencies are a black mark against Python. Even if optimisations were made and Python suddenly got a whole lot faster, it would take years for the industry to catch up
  • This is somewhat anecdotal so take it with a grain of salt, but... Django is perceived as "old" by a lot of people in the industry. While I think that it's great that Django has been active and up-to-date for a very successful 13 years, marketing thinks otherwise. Say what you want, but selling your product with the idea that it's built using the newest flavour-of-the-week JS library and exotic bits of GoLang webservers still does wonders to build hype for your product
  • Once again somewhat anecdotal, but... Python seems to be perceived as a jack-of-all-trades, master-of-data-science language. I only see my peers use it for learning programming, rapid prototyping, ML/data science stuff and personal projects. Good or bad, that's the reputation that Python has in my circles. Meanwhile, JS is more or less the official language of the internet, and it's slowly creeping into other things as well (take a look at Electron and React Native). Branding matters, whether we agree with it or not

Because of all this, I think that the number of companies actively searching for web developers to write Python is... Kinda low. They do exist, I've definitely bumped into a few companies of that kind, but they're obviously much rarer than companies searching for JavaScript skills. Even if they do exist, it's incredibly rare that they use ONLY Python (for example, I have a friend who works at a place that primarily uses ReactJS and Python).

If you're interested in getting into the basics of web development, I'd start by learning React (front-end) and Node (back-end), the two leading JavaScript frameworks. If you've never made a website before, you'll save yourself a lot of trouble by learning the basics of HTML/CSS before you start learning React. Learning React will also allow you to expand into app development with React Native, which could be an interesting option for you. If you don't like JavaScript or Node, or just want to try something more unique, consider learning GoLang instead. Go is basically Google trying to reinvent C; keeps the speed and a lot of the syntax, picks up garbage collection and type inference, and ditches the troubles of async and segmentation faults. It's a pretty young language with some quirks, but it's seeing quick growth and it's fun to work with.

For context, I'm a 21 year old CS student in Canada, just finishing up my degree. I've worked at a startup writing "prototype" code with Flask, but the Python bits were eventually replaced with other languages better suited to those tasks once things were closer to production. Your mileage may vary depending on where you are in the world, and what your prior experiences have been.

This reply was really long, but I hope I've been able to help you!

14
krexxers•

I'm not OP but I want to thank you anyway. You answerd a lot of questions I didn't even know I needed to ask.

2
csccta•

(just a hint if you want to do bullets you have to have a blank line before the * bullet point i.e: (hits enter)

  • this wont work (hits enter twice)

  • this will work

2
alchninja•

Huh, that's a little weird, all the bullet points seem to be rendering just fine for me (including your example of a bullet that won't work). What are you using to view this thread? I'm using "new" Reddit (resigned myself to it at this point). I think they've made some changes to how the Markdown rendering works, so people on old Reddit sometimes see broken Markdown even though the new UI says everything looks fine.

Similarly, the old "forgiving" way of adding hyperlinks is broken on new Reddit: https://www.reddit.com/r/redesign/comments/934cdy/space_in_link_markdown_prevents_proper_formatting/

They should really clarify what they expect to be correct with the new standard.

1
csccta•

I'm on old reddit bc I hate change (great trait for a programmer to have) so that's probably why I see it the way I do

1
csccta•

totally agree with what alchninja said. I'd even recommend using Ruby/Ruby-on-rails (very Python-ish in its simplicity) before I'd tell you to use Python. There is definitely a demand no doubt, but unless you already have some job in mind that you know exclusively uses Python, I'd recommend casting a wider net with JS. You already learned how to program with Python, the concepts are all (mostly) the same, just the syntax will be different.

2
alchninja•

Oh my God, I can't believe I forgot that Ruby exists. My excuse is that I've never really had to use it before outside of very tiny snippets of code. Also I was typing out my response at like 3AM, but still.

OP, this is really solid advice. Ruby is great if you want to stay away from a lot of the inevitable mess that comes with Node. It also has a very Python-esque syntax and general "design philosophy" and is generally just as English-readable, if not more so. Look into Ruby-on-Rails and Jekyll if this sounds interesting to you.

Edit: You could also argue that Ruby looks sexier on a resume in the context of web development, but maybe that's just me.

1
csccta•

In terms of resume, I feel like Ruby is more techy/startup/googly while Python is more for old school industry/finance/big data analysis, just based on the content of the hundreds of job offers I see every month (I'm just on a mailing list not a programming god lol)

1