News for hackers. Stuff that matters.

Why Ruby for startups?

I see so many new startups being built on Ruby/Rails. Why so?

Why not Python?

PS: This is not a Python vs Ruby question. Just, why is Ruby preferred in the startup world?

( 21 comments | 13 points | on HN )
Re:Why Ruby for startups? by anonyfox on Wednesday August 07, 2013 @03:58AM (#6171440)
When Rails came up, it's "new way" of developing a webapp fast and without much hassle was exciting. In addition, Ruby is a really nice language, and switching to it may give you massive productivity boosts, depending on where you come from. Plus: the amount of high-quality libraries ("gems") is very high. But i forecast a massive decrease of Ruby usage in startups. I'll explain why in the following sentences:

Startups are not picking _Ruby_, they are picking _Rails_, which happens to be written in Ruby. Seriously, the language doesn't matter that much nowadays it's all about the ecosystem around it. You need one or more nice frameworks, as light or heavy as you want, and a bunch of libraries for common stuff you have to deal with (never invent the wheel again if not absolutely neccessary!).

But time goes on. I was a ruby zealot, but this changed over the last 2 years. Most of the webframeworks of other languages integrated the "rails way" in one way or another. To be clear: Rails hasn't special benefits or is "cool" any longer (i say this as an currently employed rails developer). In addition to this, Ruby itself is showing it's age:

- excessive metaprogramming (like eg. in ActiveRecord) makes these things nearly unreadable/un-understandable today. - parallel processing in MRI is not possible, Rubinius 2 didn't finish/change for the last 2 years (especially unicode support is the showstopper in non-english countries), JRuby brings the disadvantages of the JVM to the table (the startup times in short TDD-cycles are annoying). - Ruby is still one of the slowest scripting languages in use. In addition, stuff like ActiveRecord kills performance even more, some expressions (no exact number) take hundred times longer than writing the raw sql statement in the rails app. The "convenience" of AR comes with price. (and as i mentioned, the "under the hood" isn't that easy to understand either).

To be fair: other languages have their problems, though.

- python: the frameworks are similar to the language in their inception: quite good, but not mind-blowing, boundary-pushing or just "hip". I'd say most usage of stuff like Django results from "yeah, i know python, let's use a python web framework" if you know what i mean. Indeed, there's nothing wrong with that. Also: Python3-transition-hassle, GIL like Ruby prevents parallel processing, similar hassle like with the different ruby implementations.

- PHP: cheap. hosting is cheap (most customers are happy with near-garbage hosting since they won't get _that_ much traffic). developers are cheap and everywhere available. developing is cheap because of the massive amount of high-quality "frameworks" (not only coding-frameworks, but also stuff like drupal, typo3, wordpress, wiki, ...). But: you get what you pay for. Innovations happens everywhere except in PHP, folks there are just playing catch-up. If you have to develop something new, where you don't have the skeleton in place, PHP isn't the best choice. Like Ruby, performance is not that good, especially when you target modern webapps with thousands of concurrent small requests. PHP isn't made for this.

- Perl: slowly fading away. May become "cool" again, similar the way old clothes become "retro" and cool again. No pun intended, i personally like perl. And CPAN is just insane. Everything you'll ever need (and more) is available.

- Scala: very interesting (but also complicated and not beginner-friendly) language. Biggest drawback last time I used scala: the "package manager", the single most important thing of every modern language, the thing that defines how the ecosystem will behave, was just garbage. There (as i know) is no place like "rubygems.org" and just "gem install myawesomelib". It _may_ be that SBT has involved into something great over the last year, i don't know. The whole "JVM Ecosystem" has quite a learning curve, too. Not startup-friendly and you'll need _great_ developers (my experience).

- ASP.NET MVC/C#: This is my personal opinion: i would never use it again or recommend it to anyone. Not only C#, but the whole .NET stuff or other microsoft-centric technologies. It has fanboys for sure, but not only i hate to work with every single piece of the microsoft "stack", MS is fading away slowly. Even silverlight was abandoned, ehrm i mean, "open sourced". The only way to write C# code in a productive way is in Visual Studio. Oh, you'll need the features of the "ultimate edition"? Have fun shelling out thousands of $$ for your developers. Use MS-SQL Server? Look at the license costs. Whatever, i don't want to start flamewars here. Actually i (european) see C# stuff outsourced to indian offshore businesses more and more (no pun intended). C# Development is just "stuff that needs to be done" in some businesses, there is nothing really innovative or exciting going on and developers are cheap.

All this said and done, there is one outstanding "stack", and this is... javascript. We all know the language and the "fame" of javascript and how it evolved over the years. But today, things have changed.

- JS is the only player in the browser. "unfair" advantage. Every softwarestack above have to deal with JS today. - Node.js brings JS to the server. While not suited for anything, it is just _perfect_ for many apps today. - NPM (the "rubygems" for JS/Node) is quite "better" than rubygems and seems way more active today. - Kickstart from scratch with express/mongoDB is really fast and perfectly suited for agile development. - "Big Frameworks" are evolving rapidly the last months. - Desktop- & Mobile-Apps tend to be written in HTML5/JS more and more. - Databases like MongoDB use JS as their query language. - if you don't like JS, there are preprocessing-languages like coffeescript which compile to JS. Write in the style you want, that's it. - The raw Speed of the V8 VM is amazing.

=> if you want, you can have a Stack with JS-pieces only today. From database to the UI, everything can be javascript, which makes development of modern client-heavy apps a breeze.

So, to conclude: The future question will not be "why ruby?", but "why not javascript?".

Re:Why Ruby for startups? by _random_ on Friday August 09, 2013 @02:18PM (#6187333)
!!! warning - an extremly biased person above !!!

"- ASP.NET MVC/C#: ..."

1) Microsoft came up with TypeScript recently which is truly open-source and will dominate Dart/CoffeeScript etc. over the time. 2) Microsoft is supporting SignalR which is truly open-source Pub-Sub and is a replacement for WCF. 3) Microsoft is supporting KnockOut.js which is truly open-source and one of the best MV(C/VM) frameworks today. 4) Microsoft invented _modern_ flat GUI style. 5) Visual Studio + ReSharper makes the most feature-rich IDE on the market. You don't have to buy Ultimate or even Premium - Express/Professional is good enough for most people. 6) If you mentioned Scala then mention F# as well. 7) Windows and Visual Studio will now be on much shorter release cycles.

Old Microsoft != New Microsoft.

Re:Why Ruby for startups? by anonyfox on Friday August 09, 2013 @03:29PM (#6187835)
yes, i am biased.

1) i'd say typescript will have its place, like coffeescript. usual MS behaviour: "oh there is something cool going on! We'll rewrite this stuff again in our ecosystem, instead of helping the original thing. Then we announce it as 'awesome new thing' with a cool buzzword!"

2) i ignore windows development currently (just as much as crossplatform toolkits need). i know there are many C# people out there, but i am just facing unix-ish based developers around me. so, i can't say something about this.

3) "is supporting". oh, great. And google supports angular. and facebook supports ... . not really an argument. Oh, and i know that microsofts actually pays some linux developers. many firms do. most of them with much less money than microsoft. (oh, when the current stock course ddrops further, this won't be true for future readers ^^)

4) As far as i know they hired a lead designer from apple to actually "invent" the design. Personally i like the tiles of windows 8, at least the spirit. What they made out of this ideas, well, not so much.

5. Who really needs IDEs? C# folks (and java'ish of course). It doesn't matter how good Visual Studio actually is (i know it is good or even the best, i have the ultimate's here), but efficient developing C# requires VS, and that is, in my opinion, a central design flaw of the language itself.

6. i didn't mentioned F# because i have no experience with it.

7. not an argument for a startup for developing their stuff in C# right away, seriously.

Old microsoft: massive marketshares and influence. new microsoft: too little too late, fading away (PC drops, public windows 8 perception (!) is a desaster, Tablets and RT's don't sell, Phone marketshare is not enough, XBox one presentation desaster, stock price drops and drops, ...).

i love discussions with other biased people :)

Re:Why Ruby for startups? by AznHisoka on Friday August 09, 2013 @12:59PM (#6186792)
I think the language will almost never matter to a startup (unless you're using something like ASP.NET and MS technologies). Even if you're a pure tech startup, the core technologies is what matter, ie your secret sauce - such as advanced NLP techniques, a superior search algorithm, etc. All of those are language-agnostic
Re:Why Ruby for startups? by dragonwriter on Friday August 09, 2013 @01:11PM (#6186866)
Well, different mechanisms will be more readily expressed, understood, and maintained in different languages, so language choices will probably make some difference; but what the trade-offs are will depend on what the "secret sauce" is.
Re:Why Ruby for startups? by anonyfox on Friday August 09, 2013 @03:46PM (#6187959)
ideally you "invent" your secret source in front of a whiteboard (if you know what i mean), and then choose the language/ecosystem that fits best for the following implementation, and works with your future customers' (eco-)systems.

In terms of processing power, widespread availability and available libraries, JS'ish things are a good bet already. When it comes to choose language and expressions and stuff like this, there are different "meta"-languages available today.

Re:Why Ruby for startups? by _random_ on Friday August 09, 2013 @02:19PM (#6187337)
"So, to conclude: The future question will not be "why ruby?", but "why not javascript?"."

Because you will be using TypeScript instead.

Re:Why Ruby for startups? by anonyfox on Friday August 09, 2013 @03:13PM (#6187728)
With "Javascript" i mean meta-languages that compile to javascript, too. I prefer coffee, but typescript may be fine, too.
Re:Why Ruby for startups? by _random_ on Friday August 09, 2013 @03:21PM (#6187784)
Reasonable, but that's a blurry line. If a meta-language gets traction it might get support for other compilation targets MSIL/bytecode etc.
Re:Why Ruby for startups? by anonyfox on Friday August 09, 2013 @03:37PM (#6187902)
Possible. But since JS is already running on every desktop, smartphone, tablet and now on the server, why bother with less spread ecosystems? And, given that in some places already reaches half the performance of native code (which is incredible fast for non-c'ish code!), it should be fast enough.
Re:Why Ruby for startups? by dgregd on Saturday August 10, 2013 @09:12AM (#6190977)
Google Dart looks very promising.
Re:Why Ruby for startups? by mhartl on Thursday August 08, 2013 @12:42AM (#6177366)
N.B. To typeset italics on HN, use asterisks, not _underscores_.
Re:Why Ruby for startups? by workhere-io on Wednesday August 07, 2013 @06:24AM (#6171839)
why is Ruby preferred in the startup world?

I'm not sure it is. If you look at the polls there have been here on HN, Python often places better than Ruby (one example is https://news.ycombinator.com/item?id=3745084, but there are other polls as well).

Re:Why Ruby for startups? by workhere-io on Wednesday August 07, 2013 @08:56AM (#6172447)
Here's another poll that shows Django being way ahead of Rails among the YC startups: https://news.ycombinator.com/item?id=750142
Re:Why Ruby for startups? by nmat on Wednesday August 07, 2013 @10:58AM (#6173252)
Note that this poll is 4 years old. You should add the year when you link to such content.
Re:Why Ruby for startups? by lewstherin on Wednesday August 07, 2013 @01:36AM (#6171070)
I can't speak for others but I chose Ruby/ Rails over Python/ Django, because the Rails community seemed bigger and much more active. This may not be necessarily true of course, but I took a look at Ruby and liked what I saw, so much that I never looked back :)
Re:Why Ruby for startups? by _random_ on Friday August 09, 2013 @02:21PM (#6187358)
Because it is fashionable (in a bit hype-y way) and happens to be not bad :).
Re:Why Ruby for startups? by deathwithme on Wednesday August 07, 2013 @02:38AM (#6171221)
cause with Rails, a web application is developed fast and very easy and the cost is very low. You know start ups need time and money.
Re:Why Ruby for startups? by workhere-io on Wednesday August 07, 2013 @08:58AM (#6172456)
cause with Rails, a web application is developed fast and very easy and the cost is very low.

How is that different from e.g. Django?

Re:Why Ruby for startups? by anonyfox on Thursday August 08, 2013 @03:34PM (#6181252)
I think that it's a save bet to say: rails has no advantages any longer. You'll find similar features in nearly every common "web-language" and their range of frameworks today. The only difference is the language itself, and you all know the holy wars fought about which is better, right?
Re:Why Ruby for startups? by karangoeluw on Wednesday August 07, 2013 @11:34AM (#6173474)
I too want to know this.