JavaScript vs Ruby vs Python. Which is the best language for your startup?

JavaScript vs Ruby vs Python. Which is the best language for your startup?


By: Raji Ayinla, Codesmith Intern

When my friend pitched his startup idea to me, I had to come up with a language that could be used to write code for both a landing page and a mobile app. After some research, I came up with a list of pros and cons that you can also use to decide to which language you’d want to commit.

Javascript and the MEAN Green Stack

For years, Javascript has been relegated to front end development, caged within your client browser. With the introduction of Node, Javascript (in my books) reigns supreme in the world of backend web development. Here are some pros and cons of writing your backend in Javascript.

Pros:

  • Javascript is sexy. Simple as that. Thanks to Google’s highly-optimized V8 engine and Javascript’s inherently non-blocking asynchronous design, certain tasks handled by Node are, in certain cases, 20 times faster than tasks handled by Rails. Just ask LinkedIn, who stripped out Rails and replaced it with Node for better performance according to their case study.
  • Javascript devs are a one woman/man wrecking crew. Why cripple your burgeoning startup with overhead when you can hire a Javascript developer who can write both your backend and frontend web app in Javascript? Once you’re ready to build your mobile app, the Javascript dev can then use React Native to build a fully functioning application. No Swift or Java required.
  • Node is the future. Just take a look at Google Trends. You want to be able to sell to VC’s the scalability of your company, and Node’s rising popularity provides a stable model of growth.

Cons:

  • Javascript can become a spaghetti monster. Just Google ‘callback hell’ and you will see how illegible Javascript can become when programmers don’t program functionally.
  • Node is fresh off the press. A lot of developers are still transitioning from the idea that Javascript makes fun things happen on the web to the idea that Javascript is robust enough to be implemented in the backend. Then you have to take into consideration that Node, unlike Rails and Django, is simply a platform that allows Javascript to run outside of the client. Dependencies like Express, MongoDB, and Mongoose must be learned as well. This means a shortage of skilled Node-savvy developers.

 

Ruby on Steroids

With the rise of the Node/Express/React super team, Ruby on Rails seems to have diminished in the eyes of developers. It doesn’t help that Ruby has recently fallen to 8th on RedMonk’s language ranking, the lowest it’s ever been. Then you have the rise of Machine Learning, Big Data, and A.I. – only some of the many futuristic keywords repeated ad nauseam at Google’s keynote events. Python has monopolized this data-driven area of research, which in turn has dented Ruby’s popularity.

With that being said, here are some pros and cons of starting your startup with Ruby.

Pros:

  • Ruby has one of the most active dev communities out there, and that means great documentation and amazing open-sourced dependencies, or “gems”. You want to use a React library within your Rails app? There’s a gem for that!
  • Ruby code is simple, yet expansive. The rubyist philosophy of “there’s more than one way of solving a problem” can be a bit overwhelming at first, but once you’ve mastered a few methods, you’ll be in awe of the seemingly countless tools at your disposal. Say goodbye to polyfills.
  • I swear, Harry Potter invented Rails. Ruby’s framework is by far the most magical concoction. With a single rails g scaffold command, you can create an entire blog. The routing system is excellent and once you learn all of Rail’s nuances, you will scale projects quickly.

Cons:

  • Ruby has a major kryptonite: Sloooow performance. Just look at the chart.

To quote Jules Winnfield, “That is one slow mother——”

  • Rails’ red screen of death may make you pull your hair out.  Oftentimes, debugging a Rails app can cause nightmares due to its abstract nature. Once the magic wears off, you’re left with long stack calls and nested folders to scavenge through.

 

Python’s Tango with Data

Jeff Knupp, a Python programmer, posted a great article that deftly explains why Python is rising in popularity. In short, the language is a tool for statisticians and has given rise to the job description of “data scientist.” Recent developments in Deep learning, a technique that patterns machine learning off of the neural networks of the brain, has opened up the field of A.I. If your startup is going to exhibit any form of intelligence, having a Python codebase may be the way to go. Here are some Python pros and cons:

Pros:

  • Like Ruby, Python is readable. It is also dynamically typed so that exceptions are raised, leading to more pain-free debugging processes.
  • Python is ideal for computational tasks because of its buffer protocol, which allows C extensions to be built out of Python, which can then be used to create powerful computational libraries.
  • The Django framework is similar to Rails in that a developer gets everything they need to scale a web app out of the box. The advantage, though, is that Python’s principle that “explicit is better than implicit” means that there are fewer abstractions.

Cons:

  • Because of its focus on computation, Python is not a speed demon. In fact, it’s a fraction slower than Ruby…by 0.7%
  • Python is restrictive. Dynamic typing is double-edged in this case in that it causes more errors, most of which show up only at runtime. This means a longer development process. The compiler also enforces its own style upon the programmer, forcing them to indent and space correctly lest they be hit with loud error messages.

 

Conclusion/ TL;DR

Spoiler alert: I believe Javascript is the best language of the three, but it doesn’t mean that Python and Ruby don’t have their own uses. It depends on the situation of your startup. How much funding do you have? Can you afford to pay talented Ruby and Python developers? What type of app are you building? If it’s a data driven app, perhaps Python is the way to go. Ruby may be ideal if you have a tight-window until your app has to go to production or if your startup is based on contracting website construction. Rails will help your startup scale rapidly. But if you’re on a tight budget and you want high performance on your image sharing app, Javascript has you covered.

References:

 

Write your comment Here