Would you choose Python (with Django) or Java (with Spring?) for building a web application?
At the enterprise level, scalability, security, performance and a clean code base are important for an extensible software. Are Python and Java pretty evenly matched and the choice of language/platform is not a big deal after all?
Also, would a Python or Java web application be easier, cheaper or more compatible to deploy on cloud infrastructure in case a user decides to deploy it on IaaS/PaaS like Amazon Web Service, Google Cloud Platform or Microsoft Azure?
Thoughts and comments are welcome.
Remark: Decides to exclude Microsoft ASP.NET as I want it to be as platform independent as possible, not locked in to Windows ecosystem.
You burn this question inside a crucible, at the end it will only be one thing left -
COMPETENCY.
In today modern web landscape, you have large scale web applications designed with Python, .NET, Java, Ruby, Node.JS, ABAP, PHP. So all these languages and maybe a couple more not listed are feasible candidates. Adding on that nowadays Enterprises learnt about all these new languages from online marketing and word of mouth among engineers, they are more open to try out new approach on how to develop softwares.
Scalability is not relevant at programming level. If you are a good software architect, you can use shell script (via CGI) and still create highly scalable web application. Give you a zero overhead multithreading/event-driven programming language, and nothing stop you from creating bottlenecks which doesn't scale.
Security is really not in its entirety a programming language issue. It is largely to do with developers competency to recognise security issues with each programming languages on how you sanitise your inputs and the processing of data, and how to output them properly, along with proper management of credentials and data, good level of isolation, protection, prevention techniques and practices. Use Java and you still get hacked. Good understanding of the intricacies of C/C++ and you know how to practice defensive coding practices to prevent buffer overflow or some other kind of arcane hacking techniques. The programming language and framework can only do so much, but it can't prevent you from coding a rogue application intentionally and unintentionally.
Performance again is developers' onus. Make a wrong choice in your framework, your components/libraries, your architecture, your data structure, your algorithm and your performance will be further away. Java may be faster in a lot of areas than Python, but you can still create tons of bottlenecks in it because you have chosen wrongly in areas above. It is faster, not light years ahead, hence deficiencies in some areas can be made up in other higher level areas. The same applies between Java and C/C++.
Then we need to consider your workforce. Are you considering forming your team from scratch or from a readily available workforce ? Personally my forte are in Java, PHP, Perl, JS@Client, Unix Shell and utilties. Secondary are Node.JS, C/C++, Python. If you were to give me a task, I would be proficient and productive using my forte areas. The same applies for developers in their own domain may it be Node.JS, Python, Ruby and so forth. That is where cost comes in. You make your team, even if they are experienced, going into a new domain or new set of tools, there are always learning curves and time and effort spent into adventuring new tools, new libraries, new frameworks, new techniques and approaches in solving the same set of problems. All these are going to cost that need to be taken into account.
Generally most IaaS cloud are language agnostic. The cost between the languages are really not the most significant costs around, because the real heavy weight costs are in your development and operations. Infra costs while significant is normally not the highest. If you infra is costing you a lot, you would want to look at whether the right approach is used to solve the problem. If the solution is done correctly, it might just use 10 servers, instead of 20 today. That's why good architecture and good understanding of the problem and domain is usually the most crucial cost components as oppose to use a bubblesort or mergesort at deeper level.
Just from my perspective, Java has a strong language design than Python. After all, python is a rather old programming langauge. OOP is not the first line of thought when Python was built. Java was designed with OOP in mind. Hence when it comes to encapsulation and objective design, Java is a clear winner. Python didn't really get much focus until recent years where there is focus on data analytics and AI. Libraries like numpy, scipy and more python integration into this particular field brought attention to it. Otherwise it would have been .NET, Java and perhaps Node.JS. Node.JS was brought in when there is a focus on event-driven approach, which ain't strong areas in .Net and Java, but I think nowadays the game is pretty much levelled. But still those days made a lot of developers competent in these other non-mainstream languages which make the competency stays and flourish. Across the major cloud providers, I would say PHP, Python, Ruby, Java, .NET, Node.JS are safe choices.