Live data from Hacker News

Ask HN: Would you use Python as the main lang in a potentially large project?

news.ycombinator.com

1–10 of 16 posts

Ask HN: Would you use Python as the main lang in a potentially large project?

#1
tl;dr Would you advocate for using Python as the main language in a potentially large-scale project and long running standalone project (not a library)? Such as if you are a startup aiming to build a sustainable SaaS that becomes your full time occupation, or for enterprise projects?

I've been using Python for over 4 years from writing web applications for enterprise to startups in Django and Flask, and to RF test frameworks leveraging GNURadio. Python was a suitable choice for many problems I have encountered as because the ecosystem is extremely broad and it is very easy to get started, not just because the language is simple, but because of the popular "battery-included" frameworks. This means I can deliver value must faster from the beginning.

But having worked in a company which develops many different production systems developed over a period of 10 years, some running on platforms such as Debian etch, I can't help to think that had an enterprise language and ecosystem such as Java or .NET been chosen, maintenance and new features would have been significantly easier, because you hit performance issues much later and understanding legacy code bases are easier even if poorly written because of the static typing, and migration between different runtime versions is first-class.

I see Python (or similarly, Ruby) being used at large-scale at consumer-facing businesses such as Reddit, Digg, Uber, Dropbox, etc. but many eventually integrate to a JVM based language into their production system.

Would you advocate for using Python as the main language in a potentially large-scale project and long running standalone project? For people who have had the experience, it is worth using Python at the beginning and bearing the cost of adding another language and ecosystem in the mix when to support/replace Python when you hit scaling issues?

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#3
post #2

I've the same problem, but instead of python is ruby(with rails) vs python/node.js(that perform a better than ruby)

In your case, if you are just planning to de a web API with the majority of the workload being I/O (such as hitting other APIs), then node.js (outperform Python and Ruby out of the box in this case IMO). Otherwise, Python is a more versatile choice. All 3 are relatively easy to start, but given you like Rails, which is big on convention over configuration, the closest you'll get, that has a large community is Django, and a Node.JS counterpart would be sails.js. The biggest difference is in the languages itself, all 3 have some distinct differences in design.

But all 3 suffer from the same issues that dynamic languages have, and weren't designed for enterprise. Node.js is also being added to existing enterprise applications, but normally for anything web facing.

EDIT: Add opinion relating back to main question.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#4
The main advantage of Python for you is that you know the language and the libraries, and when you start something new, it's critical that you work on the project, not on learning a new technology.

The main advantage of JVM and CLR for large scale development is support for static types. But, Python has a standard for type annotations (https://www.python.org/dev/peps/pep-0484/) which allow you to have all the language services which are available for static languages (refactoring, completion, etc) available for the Python. Not all libraries have these annotations, but you can provide it yourself, or separate code with annotations from code without annotations.

You should also take into account that JVM, and CLR have much better runtime performance than Python, almost on par with C++, so you should think about this if it's important for your app to use resources as efficiently as possible, but typically it's not as important for SaaS projects.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#5

The main advantage of Python for you is that you know the language and the libraries, and when you start something new, it's critical that you work on the project, not on learning a new technology. The main advantage of JVM and CLR for large scale development is support for static types. But, Python has a standard for type annotations ( https://www.python.org/dev/peps/pep-0484/ ) which allow you to have all the langu…

True, I've been using type notations with all my Python 3.5+ projects (and works very well with PyCharm), though noting that this is only a recent addition, available (officially) for very recent Python releases and is not enforced out of the box. And yes, delivering on the project is critical, especially for startups at the very beginning where you're still trying to find product-market fit so sudden production changes need to be swift.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#6
What is large scale? Does it just mean lines of code? I'm in charge of a Python app that has about 75,000 lines (not including comments, blank lines, imports, generated code or tests), and been doing it for 4 years.

Would I recommend python for something the size I do now? No. I would recommend any other language that has strongly enforces types and compile time checks (like Java). They add an extra layer of safety on unit tests. I have dreams of rewrites that are in C# or Java.

Just today I fixed 2 bugs because of unexpected types being used.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#7
> Python as the main language in a potentially large-scale project

This is the flaw in your thinking, the word Potentially. Good engineering means you worry about actual problems and not potential problems (within reason ofc). Your actual problem is that you haven't written the web application, so you do that first. For doing that, Python is an excellent choice.

"But what about web-scale?" Well, chances are your product will fail for some reason and never become successful therefore thinking about scaling problems now is a waste of time. In my experience, scaling problems comes much later than most people think. I've worked on an interactive site in Django that served 60k visitors per day without problems. It was the database that gave us the most performance problems not Python.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#9
post #7

> Python as the main language in a potentially large-scale project This is the flaw in your thinking, the word Potentially . Good engineering means you worry about actual problems and not potential problems (within reason ofc). Your actual problem is that you haven't written the web application, so you do that first. For doing that, Python is an excellent choice. "But what about web-scale?" Well, chances are your pro…

>I've been using Python for over 4 years from writing web applications for enterprise to startups in Django and Flask

He has used python to write web applications.

Re: Ask HN: Would you use Python as the main lang in a potentially large project?

#10
post #7

> Python as the main language in a potentially large-scale project This is the flaw in your thinking, the word Potentially . Good engineering means you worry about actual problems and not potential problems (within reason ofc). Your actual problem is that you haven't written the web application, so you do that first. For doing that, Python is an excellent choice. "But what about web-scale?" Well, chances are your pro…

> It was the database that gave us the most performance problems not Python

I agree database has given the most pain to me as well may it be SQL or NSQL

Post reply on HN