The Language of Game Development

 Pages PREV 1 2
 

The only disadvantage to starting in python is that it's somewhat hard to debug a problem due to variables being dynamically assigned. Forward declarations of variables helps immensely with narrowing down type cast issues. This has become glaringly apparent in my work when I tried building a program using the A* algorithm.

I started out coding by looking at the source code for Gorillas in QBasic. I'm not very practiced at programming, mostly having made a few helpful programs(and one text based adventure game) on my old TI-83 calculator. I've recently started picking up Common Lisp after having picked up an interest from reading XKCD comics. I could recommend Land of Lisp for that, as it teaches the language by having you make several small games.

Ah, hi.

Let me reiterate the suggestion of Python; it was explicitly designed to be a good first language, and it has lots of useful libraries with beautifully-written source code to read. It is one of the very few languages that Lisp enthusiasts will grudgingly admit to being almost okay.

(Or, you could learn Lisp. Not exactly an ideal language for game design, but the absolute best language ever to learn computer science. Pshaww, nah, too many parentheses, you say. Well ... um ...)

But, you say, Python is slow (sadly, it is, but computers these days are really really fast) and Lisp is weird. You want a proper compiled language that runs at most an order of magnitude more slowly than tuned C code, and you want it to be robust and scalable and all those nice things. You also want it to be able to communicate with those complicated game engines written in C and assembly language without too much hassle. Then, sir or madam, you should be using Haskell.

... what?

Yes. Remember that from your boss' point of view, programmer productivity is far more important than code execution speed. Haskell is even more terse and powerful than Python. In particular, Haskell and other pure functional languages are really the only effective way to take advantage of multi-core processors, unless your name is John Carmack; taming massive parallelism is mind-blowingly difficult in any imperative language but in Haskell, your compiler does almost all of the hard work for you.

Also significantly, Haskell is fairly easy to learn as a first language. In fact, if you adopt Haskell or Scheme or SML or Common Lisp or perhaps even Scala before you get down to the metal in C, you will be a better programmer. Declarative languages such as these teach you how to think about data and algorithms rather than states and procedures, and you will have fewer bugs in the programs you write in any language.

What a disappointing bullshit article. It's like Shamus doesn't realize that the game industry is already filled to the brim, and even professional programmers would have a hard time finding a job there. Telling complete amateurs "It's okay, you can start off by doing this and that" is just dishonest.

Tarfeather:
What a disappointing bullshit article. It's like Shamus doesn't realize that the game industry is already filled to the brim, and even professional programmers would have a hard time finding a job there. Telling complete amateurs "It's okay, you can start off by doing this and that" is just dishonest.

Yeah, I mean if you want to join a development studio, you're pretty much going to have to learn whatever language they're using anyway, so what's the point in pondering whether a language if effective for you personally or not? It's not like you can just go out and make a game independently.

Wait.

Tamayo:

(Or, you could learn Lisp. Not exactly an ideal language for game design, but the absolute best language ever to learn computer science. Pshaww, nah, too many parentheses, you say. Well ... um ...)

It's not a commonly used language, true, but nothing about it is particularly bad for the purpose of games programming(and apparently Jak and Daxter was partially programmed in a custom dialect of Lisp). It's a multi-paradigm language that can do pretty much anything any other language can do(though obviously not as efficiently as a low level language), and in the hands of someone competent in the language, often in less lines of code than in other languages.

As for the parentheses, yeah, they take some getting used to, but I don't find them any more or less annoying than semicolons or whatever other punctuation or syntax might be peculiar to any given language. The biggest thing I can say against learning Common Lisp is that any given company you might want to get hired by probably isn't using it. But for personal use? I'm liking it alright so far.

Oh, yes, Lisp is brilliant. It is the third high-level computer language, and the first and best dynamically-typed language. Good Lisp compilers (and it's hugely easier to write a good Lisp compiler than a good C++ compiler) can produce code almost the quality of a good Fortran compiler. Yes, that means that well-written Lisp programs are often faster than well-written C programs.

Paul Graham:
What's so great about Lisp? And if Lisp is so great, why doesn't everyone use it? These sound like rhetorical questions, but actually they have straightforward answers. Lisp is so great not because of some magic quality visible only to devotees, but because it is simply the most powerful language available. And the reason everyone doesn't use it is that programming languages are not merely technologies, but habits of mind as well, and nothing changes slower.

Yes, as I said, Lisp is weird. Lisp "has no syntax", as Graham says; well, it has some, but the syntax of Lisp is really, really minimal, so much so that Lisp programs are easily manipulated as data by Lisp programs---yes, even by themselves. This property, which has been dubbed "metacircularity", used to be rare amongst programming languages.

It isn't any more. C++ achieved metacircularity when someone noticed that templates were a Turing-complete language in themselves. Smalltalk and Ruby and Python have it because they use metaclasses for class creation. Java and C# have very clunky reflection facilities. Perl 5 and Perl 6 are dialects of Lisp, though Perl programmers don't like that comparison. (Javascript is a dialect of Lisp, too, but that's harder to perceive.) The advantage of metacircularity is metaprogramming: by writing programs, one can create the programming language that is most suitable for one's endeavour. That sounds great. It is great. It is far, far easier to use C++ now after the STL and the Boost libraries have adopted template metaprogramming than it was before, and you can still hack the bare metal if you have to.

Still, the use of metacircularity for metaprogramming is easiest where it is most natural, and that is in Lisp. Consequently, Lisp programs use a lot of it. It has been observed that Lisp programmers from different companies cannot read each others' code, due to the fact that by heavy use of metaprogramming, they are essentially using different languages. Contrast the backlash against C++ templates by many people, including John Carmack: templates are difficult to use correctly and compilers don't often compile them correctly. People don't like reading code with templates, because they're opaque and confusing and not absolutely necessary to most tasks; but they do make C++ more powerful (in Graham's sense above) than its ancestor C.

So yes, Lisp is weird in the same way that C++ templates are weird, and Lisp's weirdness works when C++'s doesn't always. It's still weird though.

Scars Unseen:
It's not like you can just go out and make a game independently.

The kind of people who make games independently are the most talented and ambitious types. Those don't really need an article like this to get started with programming. Unless you're referring to real amateur games that are just there as fun little projects, in which case I'd actually recommend something like GameMaker etc.

Tarfeather:

Scars Unseen:
It's not like you can just go out and make a game independently.

The kind of people who make games independently are the most talented and ambitious types. Those don't really need an article like this to get started with programming. Unless you're referring to real amateur games that are just there as fun little projects, in which case I'd actually recommend something like GameMaker etc.

I'm sure you're aware, but it's highly unlikely that any of those talented and ambitious types sprung full grown from the head of Ada Lovelace, born with an innate gift for algorithms. Everyone starts somewhere, and "what language should I use" is a pretty common question among budding programmers.

 Pages PREV 1 2

Reply to Thread

Log in or Register to Comment
Have an account? Login below:
With Facebook:Login With Facebook
or
Username:  
Password:  
  
Not registered? To sign up for an account with The Escapist:
Register With Facebook
Register With Facebook
or
Register for a free account here