What App Language Should I Learn? Ruby, Python, Javascript, Other? Apps, Web Apps, Games?

These impressions are not the most informed so please correct me where applicable. I've done some programming in VB mostly. I've tried C# and found it less confusing than its other C brethren but I don't have these problems with other languages. I want to make apps, web apps, and games. I don't want to start with anything more complex than a time waster, but I hope to progress beyond that to something like a 3d top down shooter and eventually to a basic 3d diablo (3/4 perspective, click to move, non animated character). I am also interested in 3d app development possibilities. Its been a while since I've taken any math so I may not have the math background for even a basic version of the latter.

Ruby: I like the readability of Ruby and I've read it has some inherent app security. I'm worried that its not as standard and extensible with graphics as the other languages. My web search returned some extensions for graphics and games, but I have seen no pygame equivalent or somebody raving how awesome writing games with it is.

Javascript: I looked into it and it does not seem like it would be very hard to transition from my prior experience with VB and VBA. I am very hyped about learning more about what I can do with html5 and javascript. I hate java as it reminds me of C++ and is just as confusing. My concern is that it is too slow/bloated. I am worried that as I progress through projects with more sophistication, I am going to regret not going with a more robust language.

Python: Seems great and well rounded. I have seen so many apps and games of all kinds written in python, I know its capable of all I want to do. What are the drawbacks? Is it too slow/bloated?

I feel confident saying -- and I don't mean this as an insult -- that if you are thinking about the problem in this way, the limiting factor is not the language you're using. If you want to be a software developer, then you have to be prepared to use whatever language is best suited to get a particular job done. The implementation details of a given language just aren't that big a deal.

Given that, I'd say you should confront your fears, man up, and learn C. This isn't to say it's the best tool for every job -- in fact, it almost certainly isn't -- but C programming is the most likely to teach you things you need to know about computer architecture and programming as a craft that will be widely applicable for the rest of your life.

I am exaggerating here, but the fact is that for 3d game programming, every language you are likely to use can be described as "C with more stuff." If you're not comfortable with C, you won't be able to do the job. You're just not going to write Diablo in a scripting language.

That's my opinion, anyway.

All three.

Ruby's killer app is Ruby on Rails, and especially outside of big corporate web development, it is IMO the best, most enjoyable, and most rapidly productive web framework. Which is why we're standardizing our web app development on Rails at the little company I work for.

JavaScript is what you write for client-side scripting of web applications. You're going to learn it, and you're going to use another language for the server-side scripting. You mentioned Java when talking about JavaScript. The only thing Java and JavaScript have to do with each other is that they share the first four letters of their names. Otherwise you might as well be comparing VBA with SmallTalk - they are not related. JavaScript is actually called ECMAScript, with JavaScript, in strict terms, only being the name of Netscape's (now Mozilla's) ECMAScript interpreter.

Python is a fantastic language as well. For me, I use Python for tasks when Ruby isn't the best fit. There's kind of a dumb "Pythonistas vs. Rubyists" mentality among some members in the various communities, but when you get down to it, each of them have their areas where they're the best choice. They're probably my two favorite languages to work in. And one of those areas where Python has a strength that Ruby doesn't match is a library like PyGame.

None of these languages are incredibly hard to learn. For web apps, I can't recommend Ruby and Rails enough. For games, PyGame is very mature, popular, and well documented. And there is going to be lots of cool stuff coming out with HTML5 and JavaScript with the WebGL API and such.

The more languages you learn, the more you separate concepts from specific implementations, and the more easily you pick up additional languages. Make learning all of these your goal. Then pick one and get started. Time spent trying to make sure you pick the "right" one is wasted time that could go to actually learning one, and then moving on to learn the next.

Not C#

I'm a C# veteran and that and 2 bucks will get me coffee but will get me laughed out of the room with real jobs/programmers. If you like C# I don't get why you wouldn't like Java, they're very similar.

Also Javascript is great but it sure seems to me like it's had it's heyday and with HTML5 coming out, people will start using HTML5 in it's place.

Elliottx wrote:

Also Javascript is great but it sure seems to me like it's had it's heyday and with HTML5 coming out, people will start using HTML5 in it's place.

HTML5 isn't going to replace JavaScript. HTML5 and JavaScript go hand in hand. JavaScript and JavaScript libraries like WebGL is what you use to do that awesome stuff with HTML5's Canvas element. Just like how JavaScript is how you manipulate the HTML DOM now.

That said, it remains to be seen how much people do that by writing JavaScript natively, or how much people instead use a cross-compiling toolkit like GWT (which cross-compiles Java into JavaScript, and is what the Google engineers used for that Quake II demo)

*Legion* wrote:
Elliottx wrote:

Also Javascript is great but it sure seems to me like it's had it's heyday and with HTML5 coming out, people will start using HTML5 in it's place.

HTML5 isn't going to replace JavaScript. HTML5 and JavaScript go hand in hand. JavaScript and JavaScript libraries like WebGL is what you use to do that awesome stuff with HTML5's Canvas element. Just like how JavaScript is how you manipulate the HTML DOM now.

For truth. HTML 5 will make some tasks easier that used be done in JavaScript, but it in no way replaces it.

If you're looking for game stuff and are willing to limit yourself to Windows, look at C#/XNA. It takes care of a lot of the boring setup stuff and lets you jump pretty much straight into game programming. I've been using it quite a bit for the past year or so.

Java and Python also both have game libraries available.

In the end, don't let yourself get bogged down by paralysis by analysis. Any of the choices are good, you'll never get anywhere unless you just pick one and move forward.

Of the languages you list, only C# is likely to be fast enough for serious live-action game development. I don't have direct experience with it, the lead on that project was Anders Hejlsberg, who was the lead dev on Delphi, which was freaking amazing. Writing Delphi was like writing poetry. He was the heart and soul of the project, and it died after Microsoft paid him millions to leave Borland. I expect C# will also be outstanding.

Javascript is getting faster. In the more recent builds of Webkit and Firefox, it's actually getting kind of decent. But I have no idea if the language itself is well-suited to the task. I get the impression it's kind of brain-dead in some areas.

Note that for applications, pretty much any language is fine. But games need a fast language, and C# is really very quick. It won't keep up with real C, but it's way faster than Python or Ruby or even Javascript.

Malor wrote:

Of the languages you list, only C# is likely to be fast enough for serious live-action game development. I don't have direct experience with it, the lead on that project was Anders Hejlsberg, who was the lead dev on Delphi, which was freaking amazing. Writing Delphi was like writing poetry. He was the heart and soul of the project, and it died after Microsoft paid him millions to leave Borland. I expect C# will also be outstanding.

I've thoroughly enjoyed C#. But then again, I do PHP in my day job so almost anything is better.

Also, for C# or Java or even Python with byte code cache, speed doesn't become an issue until the project gets terrifically complex (or unless you're doing something terribly, terribly wrong). It's much better to focus on the theory and good coding practices while learning rather than get bogged worrying about minute speed differences.

Ok, thanks guys!

I just want to clarify a few things here. I learned basic in the 80's. I went to college as a CS major. I was completely bored with my fortran class and dropped out of CS about a month in to an ANSI C class. I took a pascal class and got through about 4 weeks of assembly. So I understand programming constructs. As a matter of fact I get flustered learning new languages because I'm tired of going through the same basics (variable types and declaration, arrays, if/then statements, for loops, do/while, select/case). Its almost like just hand me a reference and I can program in any language. At a startup I thumbed through a SQL book to get what syntax I needed to know to make a small customer database in VBA.

Up until recently I thought my problem was with object oriented languages but its just the way the language is implemented. I know java and javascript are totally different animals. I think I grouped them together because they are object oriented. I'm pretty sure all the languages I mentioned are OO but the ones I have difficulty reading/following are C++, java and to a lesser extent C#. Ruby is the most readable with javascript being the next easiest. That could be just because of the type of javascript tutorials I looked up. They had examples that were using forms and textboxes and buttons just like the database I programmed in VBA. (well that part was html but they called a javascript function that i could follow instantly)

Its funny but I looked up pygame after posting and the first news post is that they ported pygame to javascript because it is a "better" language. I'll have to check the date of the post and make sure its not April 1st.

I wonder if they'll port to ruby or maybe ruby will work with the Unity engine.

Of course I looked it up and sure enough it was April 1st!

My thoughts are very similar to Legion's -- I use Python and Ruby for 95% of my programming. I still have to support some legacy Classic ASP, but that is another story. Almost all of my work is web oriented these days. Python and Ruby have comparable features and each have great web frameworks and tools. With Ruby, the community largely revolves around Rails, though other micro-frameworks like Sinatra have their place. Rails is superb for web application development, but I also use Django (Python) for more CMS-like content driven web sites. This type of application just fits the Django sweet-spot better than Rails. I love Python and Ruby so it is a joy to work with either. For me it comes down to using the right tool for the job. As for Javascript, I write very little custom Javascript anymore. Full featured libraries like jQuery or Dojo will fill 99% of what you need for any web app. There is some really exciting work being done right now in server side Javascript though. Google's V8 Engine and node.js are two places to look in this area.

Malor wrote:

Note that for applications, pretty much any language is fine. But games need a fast language

Depends on the game. There's a whole mess of games out there that run on the Flash runtime environment.

Large scale game development certainly leans towards the C-family languages. But smaller games don't have to. One of the games that has been chronicled on this site, Dangerous High School Girls in Trouble, is a PyGame title. PyGame titles have made the IGF finals. There have been other IGF titles written in Python but using PyOpenGL instead of PyGame.

Dynamic languages ain't so slow anymore. Mainly because they're not just interpreted languages anymore.

*Legion* wrote:

Dynamic languages ain't so slow anymore. Mainly because they're not just interpreted languages anymore.

Indeed. The main thing really is that if you're using an appropriate framework, you're not doing the heavy lifting in your comparatively-slow language anyway -- it's all happening under the covers in C/C++ code or calls to hardware-accelerated APIs like OpenGL. There'll definitely be limits to what you can do because of that, but I'd say that Python is more than capable of being used to create games. It'd just be a poor choice if what you wanted to make was a game engine.

FWIW, my number 1 pick would be Python: it's intuitive, it's flexible, and with the wealth of add-ons and libraries and such for it, it's certainly capable. Dive in and have fun!

Pirate Bob wrote:
Malor wrote:

Of the languages you list, only C# is likely to be fast enough for serious live-action game development. I don't have direct experience with it, the lead on that project was Anders Hejlsberg, who was the lead dev on Delphi, which was freaking amazing. Writing Delphi was like writing poetry. He was the heart and soul of the project, and it died after Microsoft paid him millions to leave Borland. I expect C# will also be outstanding.

I've thoroughly enjoyed C#. But then again, I do PHP in my day job so almost anything is better.

*waves to himself in the mirror*

I work in console games development (I'm an audio guy myself), and all the Devs I know regularly use C++, C#, and occasionally Python for quick scripting. Never heard of anyone using Ruby or Javascript for console games stuff...

That's a case of right tool for the job. You wouldn't want to use C++ on a web game either. I think the OP might get a better idea of what they want to learn if they think of a project they want to do, and then work out the tools they need to implement it.

One thing I'd say about development though is that there are several levels that you can work at. You can start from first principles and create everything from scratch getting into all the details, it'll take a while but you know you made and understand everything. You can get some frameworks that give you a leg up to cover the basics and get into the app creation faster, but you only need to understand the interfaces to make stuff happen. You can start from an established project's source and make your idea on their foundation.

I don't think any of this changes whether you're doing web based, or a compiled client, in whatever language, whether it's a game or not. It'll be a well trodden path with lots of resources to go find. My main piece of advice would be to find something interesting to you, either a tech you want to learn, or the project you want to create, if it's not interesting you're not going to stay with it.

Dynamic languages ain't so slow anymore. Mainly because they're not just interpreted languages anymore.

Well, Ruby is pretty dismal, no matter what. It's SLOW. Python can be reasonably fast, but keep in mind that fang is talking about a Diablo-ish game. Isometric 3D is much easier than the real stuff, but I'd be worried about Python's ability to keep up. Plus, it's got the garbage collection runs, meaning the game might stutter sometimes.

C# is still an interpreted language, compiling down to a bytecode runtime like Python does, but it's really fast, outclassing everything but, well, real compiled languages. I don't know what the language itself is like to work with. I know Python is quite lovely in many respects, with great tools and some very powerful features, like introspection, but when I last looked, I think it was maybe a quarter the speed of C# in computation-intensive benchmarks. And fast-action games do a lot of computation.

For web apps and the like, pretty much any language is usually fine. You're typically waiting on disk and network I/O anyway, so a more efficient language just waits faster. But with games, you've got to chew through an assload of game logic, and then manually draw each frame, and you need to do this fast enough to preserve the illusion of motion. The faster your language, the more sophisticated you can be, the more work you can do with each frame.

Most fast languages are less powerful than the slower ones, and will take longer to code in. They won't have the enormous libraries of debugged code ready for you to pull into your project; you'll have to do most of the grunt work yourself. With slower apps, those libraries typically save you so much time and effort that it's stupid to use a less featureful language, but when you're animating a whole screen at 30+ frames per second, you want as much raw grunt as you can reasonably get. C# isn't as fast as C, but it has a lot of advantages, and should be fast enough to do what he wants with some panache.

Malor wrote:

Well, Ruby is pretty dismal, no matter what. It's SLOW.

That claim is rapidly becoming outdated. Ruby up through 1.8 was strictly an interpreted language, like the old interpreted languages. No byte-code, no VM, no JIT.

Ruby 1.9's interpreter introduces all of those things and brings it into the same class as languages like Python. There's nothing about the Ruby language that is inherently slow; it's simply been running on an interpreter that, until now, has basically lacked all of the major features that have made dynamic language performance not suck.

Unfortunately, we're still in that transition phase where libraries are in the process of being updated. Adoption isn't as fast as would be desired. Very much like Python 3.0, though it's nowhere near as critical for performance as moving to Ruby 1.9 is.

Ok, I didn't know about the 1.9 version of Ruby, so I retract my complaints of slow execution. Assuming it's in the same speed range as Python, that should be fine for pretty much any normal use. Turn-based games would be fine in either language. For something Diablo-esque, though, you'll probably want something more tuned for speed.

So I went to Fry's book department and flipped through an O'Reilly book on python. (I do like O'Reilly books) They made the assertion that python is the better language to fumble through beginning OOP. They listed some compelling reasons (i.e. not a strongly typed language, and python is not locked into OOP) so I was wondering what your guys take was.

Here is a tip I give to anyone with a list of languages and a confused look: Subscribe to the Oreilly Safari Online bookshelf and go through the "Hello World" chapters of books that feature the languages you are interested in. Stick with the 1) book that jives with the way you learn, and 2) language that seems the most "fun".

Once you get to the point where you are *comfortable* in any language, then learning a new one is usually as simply as having a reference available and asking the right questions ("How does Ruby handle the C-style switch-case statements?").

C is a phenomenal language to learn as a basis, but you'll likely not use it very much. I treasure my C background, and you wouldn't be wasting your time at all by reading and doing the exercises in "C Primer Plus". I've read *a lot* of programming books, and this is the best introduction to "real" programming that I've ever read. I still use it as a reference once or twice a year, and I've been a professional engineer for over 10 years.

I can't recommend the "Head First" books enough for learning a new concept, tool, or language. They are fun to read and they will leave you with a solid foundation. Their Java book is great, although I prefer Thinking in Java.

Good luck and enjoy it!

Learn C. I cannot stress this enough. I don't necessarily recommend it as a primary development language (though I'd certainly take it over C++ any day), but C is the closest thing to a lingua franca in the programming world. Everything speaks C, and just about any library you could name is either written in C, or has some way of talking to C.

The book on C is The C Programming Language, by Kernighan and Ritchie.

C and Unix grew up together. Unix is traditionally thought of as being implemented in C, and the original "scripting language" for Unix can be considered to be C. Unix syscalls are C functions, and so on. If you ever need to do anything sufficiently interesting on a Unix-like system, knowing C will be immensely helpful.

In addition, Python is written in C. Anything with an interface to C can be made to talk to Python reasonably easily. One of the most prominent examples, I think, is the game Civilization 4. The rendering engine was written in C++, but the UI and much of the game logic was written in Python. This is a pattern which Python excels at: Write the parts which need to be fast in a language like C or C++, and then write everything else in a more pleasant to use language.

MightyMooquack wrote:

Learn C.

The thing is, if he's been tinkering around with other C-like languages already, chances are he already knows most of C whether he's done it or not. This is the strength of C, that a whole bunch of languages are based off it's syntax and you can quickly pick up any codebase and have a clue how it works. Saying "Learn C" at this stage is to learn the details and specifics of the language that only apply to C and not programming in general.

Learning C would also imply learning memory management, pointer arithmetics and other basics that require an understanding of the hardware you're working on. This is imho needed as a foundation in order to be a good programmer, even if you then later stick to languages and systems that try to hide this from you.

fangblackbone wrote:

So I went to Fry's book department and flipped through an O'Reilly book on python. (I do like O'Reilly books) They made the assertion that python is the better language to fumble through beginning OOP. They listed some compelling reasons (i.e. not a strongly typed language, and python is not locked into OOP) so I was wondering what your guys take was.

Totally concur. Python is an excellent, easy to learn language with a huge amount of high quality libraries available to do just about anything you want. It is well supported and maintained. (It is one of the 3 "official" languages that Google uses -- the creator of Python works for Google.) Reddit is all Python. Python is very widely used in the scientific and academic communities due to libraries like NumPy. MIT teaches Python as part of their introductory curriculum. I guess the point is, there are lots of very smart folks who do most of their work in Python

MightyMooquack wrote:

The book on C is The C Programming Language, by Kernighan and Ritchie.

One of the finest programming books, period.

One reason I like The Ruby Programming Language is that it attempted to be as close to a Ruby version of K&R as possible (hence the title).

The only problem I have with "learn C" advice - although none of the ones here have done this - is that so often it takes the stance that C must be learned first.

Although it is definitely beneficial to have that lower-level knowledge while working in languages that abstract much of that away from your view, it is not necessary to bang one's head against the C wall before using something like Python. It is absolutely the case that one can learn to program in a more "accessible" language, and later go learn C and pick up the understanding of those lower-level concepts. C is a nice, light language, and K&R is a lean, to-the-point book to match.

Ruby or python would be good candidates.

This isn't an endorsement but I recently stumbled across this book that you might find interesting: Invent Your Own Computer Games with Python

The biggest thing I'm worried about is that I'm not sure Python is fast enough to do Diablo-esque games. That's a heck of a lot of processing to do every frame.

There aren't very many areas where the speed of the language is really critical, but fast-action games is one of them.

Malor wrote:

The biggest thing I'm worried about is that I'm not sure Python is fast enough to do Diablo-esque games. That's a heck of a lot of processing to do every frame.

You seem fixated on the Diablo part. It was but one of the ideas he mentioned having, and the only one he qualified with "eventually".

Also, I think you're underestimating Python. A number of Disney's 3D games like Toontown Online are written in Python using the Panda3D library (which, like most graphics libraries, are not in Python themselves but have Python bindings). Even if you make a 3D game writing Python, you'll be calling libraries to do lots of heavy lifting, and those libraries are in C or C++.

Even if, when he comes to "eventually", he finds that pure Python doesn't meet his performance needs, he may find that, as a lot of commercial games do, a good way to go is to write the performance-intensive parts in something else, and use Python to glue everything together.

I'd say he's better off crossing that bridge when he gets there, instead of worrying about it before he starts.

Yeah, there's some truth to that. Python's great for many things.

My particular beef with it is that it's very hard to do proper defensive coding with it; the only way I've found to be really sure you're getting good arguments and doing the right thing is to sprinkle a bunch of asserts into the code. I'm pretty paranoid whenever I'm taking input from the Net and using it to write files into the filesystem of any sort, and the lack of hard variable types really makes that difficult for me. Then I have to write tests on top of that, to make sure that my asserts really do throw a proper exception when bad data comes in.

I suspect it wouldn't bother me as much if I were doing more advanced programs, since that part of the defensive coding is going to be a very small part of a big app, but for small, Web-facing apps, the extra overhead of making sure you're not being given corrupted data is very annoying. Static variable typing would make that a lot easier.

I probably ought to dig through the big Python web applications to see how they do it. I may be over-paranoid.