Hacker News new | ask | show | jobs
by frankPants 5269 days ago
This post should be titled, "Why I fucked up by choosing Ruby to write a game." - Or "What the fuck was I thinking"

I love Ruby, I spend a lot of time writing it. I also write kids games for iOS. I would never consider Ruby(in it's current state) a good language to write a game in. Anyone who would has clearly; never written a game before; or never used Ruby for anything serious before.

I agree with the other posters, you should investigate ObjectiveC though. You can get ObjectiveC packaged and running on Windows BTW, don't worry about that.

3 comments

While what you say may be 100% true you might be shocked by the number of Ruby and Python devs I talk to who tell me that Ruby can do anything that C++ does if you're even a half-decent Ruby or Python dev. I've literally asked people, "What about something like Gran Turismo 7?" And I've literally been in rooms where every dev there (none game devs, all web devs) basically said if they were writing it in Ruby it could be done, but they wouldn't trust Sony devs to be able to do it.

This may not be the case for all Ruby devs, but I think having these stories out there is still useful.

For what it's worth, I help to organize a fairly active Ruby group, and I am certain that, if not zero, nearly zero of us would make this proclamation. In fact -- and I mean not to attack you, but just to illustrate how incredulous I am -- I tried to think of a reason there might be for you to fabricate or exaggerate that story. I don't really think you did, but my mind went there.
Didn't make it up. No reason to do so, although I suspect if I spent some time on HN I could find some posts about Ruby perf that don't jive with reality.

But I will say this, do you think this guy made up his post about using Ruby to try to write this game? If you don't think it fabricated, do you think he's alone?

I do think there is a fundamental problem, especially with respect to perf, that a lot of people have never looked at what code actually runs on their box. Never looked at the emitted or generated asm. Don't know the cost of calling a method, much less invoking some framework routine to do something. And then you couple this with a lot of devs think their the cats meow because they got x trans/sec and hear horror stories about the ceremony and inefficiency of C++.

And it doesn't help with the blogs and articles that constantly come out saying that Java or Ruby or Lisp is faster than C/C++ (the answer is never pleasingly straightfroward).

While I appreciate that none in your Ruby group would think this, I'd also ask why do they believe this? It's no more reassuring if they don't have a clear understanding of why C++ might be better for the job.

Lastly, I should add that the conversation was a heated discussion where I was playing devil's advocate that I thought they were going to switch off of Ruby like Twitter. I don't think they really appreciated it, although I wasn't actually being all that serious at the time.

> But I will say this, do you think this guy made up his post about using Ruby to try to write this game? If you don't think it fabricated, do you think he's alone?

I neither think his story is fabricated, nor do I think he's alone. (I didn't say I really thought your story was fabricated, either.)

> While I appreciate that none in your Ruby group would think this, I'd also ask why do they believe this?

I don't know that we would all choose C++, were we building a game, but the performance of Ruby is frequently a topic of discussion. We are lucky enough to have several members that have significant experience working with/around Ruby performance, and they share their knowledge. In other words, were you to choose one of us at random, we would more likely be able to tell you why Ruby is not a good idea, as opposed to why C++ is.

> And it doesn't help with the blogs and articles that constantly come out saying that Java or Ruby or Lisp is faster than C/C++

Show them some numbers

http://shootout.alioth.debian.org/u32/which-programming-lang...

It's not because it would not be wise to write a Gran Turismo 7 in an interpreted language such as ruby or python that writing any game with such language wouldn't work. Not all games have such specific requirements as Gran Turismo 7 where huge teams want to extract the most power out of some very specific piece of hardware.

Nowadays it gets easier and easier to use interpreted language as the hardware gets more and more things delegated. For some games, it may be better to do everything in C/C++, some others C/C++ with some interpreted language on top for some parts, and some others whatever language you prefer.

Given higher level language usually help you write code faster, I would definitely give up some performance (which is not really visible usually) in exchange for some efficiency. Even for some 3d game. But then again, not everyone is writing the next Gran Turismo :)

Although I can't speak of ruby or its vm since I never used it, but have used python + OpenGL or pygame quite a few times.

In his case not only performance suffered too much from ruby but writing code in ruby didn't make him more efficient. So ruby didn't bring enough value.

As an example, Toontown is a full game written in Python, with a C++ game engine (Panda3D) and runs without performance issues at all in a single core 1.6GHz CPU.
I'm a full-time ruby developer (have been for 6 years). I do web development exclusively and all the experience I have with C and C++ came in college. In other words, I'm pretty ignorant when it comes to game development.

What you're saying here is extremely disturbing to me. For one inexperienced developer to make a wild unsupportable claim like Ruby can do anything C++ can do performance-wise is an act of hubris. For a whole roomful of such devs to nod in agreement is a little microcosm of willful ignorance that must have been terrifying to behold. If this is typical of your experience with Ruby devs I will suggest that your moving in C-player circles and you should expand your travels. We are not all that ignorant.

These sound like designers turned quasi-developers rather than serious programmers. I don't know anyone that actually understands real software development that would make this claim.
First, those are all pretty fantastic claims that need support.

Second, technically speaking of course it can do anything C++ can do. The question is can it do it well, or fast?

Heh :) I'll take the bait :)

I've written lots of Ruby for things that are serious (large websites with lots of traffic), and I've worked as part of a team that built on commercially available games in C++ that sold lots of copies.

Ruby has come along enormously recently, especially with 1.9.3 and the other flavours that are out there now. I thought it might be worth trying it and advancing the state of the possible. Eventually I decided that actually shipping something was more important.

The title of your self-submitted post is misleading. The bait post you're referring to stated the obvious, albeit in highly charged language.

It's one thing to choose the wrong language for a project. But having done that, please don't submit a post that suggests expert knowledge or deep experience in Ruby.

For what it's worth, I use both Ruby and C++. I would probably have gone with Qt if I wanted to build such a game. It would never have crossed my mind to write it in Ruby, and I don't consider myself an expert in Ruby.

Reasonable comments - thanks for the HN feedback. It's not for me to say if I'm an expert in Ruby or not, but I don't think attempting something to push some boundaries is mutually incompatible with experience or knowledge. If I'd succeeded, it would have been awesome for Ruby (far and away my favourite language).
This post is mean, and has no place on Hacker News. It's fine to say there's no reason to ever use Ruby for a game, but it seems like the main purpose of your post is just to call into question the OP's intelligence and experience.
I thought he was just calling into question the link-baity title.

The title is designed to be controversial as people don't like their favourite programming language to be slandered, thus they will be obliged to read the article so that they can defend their baby.

Using link bait as a title is contrary to HN guidelines, so if anything, it is the article that does not belong on HN, not the grandparent comment.

Fair enough: perhaps I should have been more specific about the context and thought of a better title.
Don't sweat it. I was more annoyed at the parents attack on the grandparent than your title. You got a discussion going, so well done :-)
Agreed. This is pure link bait.
Sure.

He coded his game in one language and then SWITCHED in mid-development to another, with all the delay and hassles that that brings, in order to get links...

It is mean. That's nothing wrong with trying new thing even if most people are saying it's the wrong choice. And there's no shame in failing in the process. People will say, I told you so. But you never know until you have tried it, and you would learn a lot in the process. And sometime you might just have a break-thru.