[gameprogrammer] Re: Rant on the Wind of Change

  • From: kuon <kuon@xxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Mon, 24 Sep 2007 12:30:32 +0200

This thread deserve to be in some guinness book, not for it's length, but
mostly for it's content.

When I read what people say, I can agree to nearly everything.


I'm a C coder, I always hated C++ because I think it add nothing needed to C
and it syntax is confusing (that is, more than C).


Obj-C on the other hand is nicer, but I don't think it's a replacement to C.


I think language should be used for what they were created. Maybe I'm wrong,
maybe people will start throwing things at me, but here is how I use today's
languages:


C
For example, currently, I'm writing a network 3d game.


In that game, everything is in C except the UI which is in lua. Lua is used
for the UI because it's way more flexible, I can give the job to some less
experimented programmers, it keeps the game logic clean, and lua syntax is
more adapted for this.


A little example of what lua do well is in defining the interface, like:
C[1] = {
 UsernameLbl = Label:new {
x = -150,
y = 250,
a_h = LEFT,
size = 'Big',
text = L['Username:']
},
UsernameFld = TextField:new {
x = -150,
y = 200,
a_h = LEFT,
size = 'Big',
K = {TAB = Login_FocusPasswordField, RETURN = Login_DoLogin, ENTER =
Login_DoLogin}
}
}


This is straight lua, then I can do C[1].UsernameFld to access my username
field.




Ruby
Yea, I do some Ruby. Actually, I use it for Ruby on Rails. I think Ruby is
perfectly suited for it. Mapping the objects to the database is really well
done in RoR. I know, many will argue about the design decision of RoR and
Ruby itself, but I know it's not an universal solution. But for new project,
it is really well suited.


I love the Ruby syntax because it's very short to get the job done, and when
you are writing a little online tool to manage the timeline of the game lore
(like I did), you are very happy with Ruby and Rails.


Ruby is also nice for testing, if I had to test some algorithm, I would
surely do it in Ruby as it has many good tools for it.


Lua
I think lua is a very elegant and clean scripting language. I also think it
sucks at debugging and finding errors, that's why (in the game I'm working
on) all the C underlayer is responsible for errors (of course, you have to
do the error in our own C API).


Lua is also, in my opinion, the best language to add into a bigger
application, a couple of C files and there you go!


Java
I did a lot of Java coding, I did a couple of WebObjects application, I did
some embedded java, I used Faces and some other web technologies.
Now, I don't do any Java, I replaced web coding with Ruby and Rails and I
don't have any project concerning embedded devices.


One of the problem of Java is the memory usage, this is mostly because
nearly all types are long and in object programming, this can grow very
large very quickly. But java has a lot of advantages:
- Virtual Machine
- You can do a Windows/Mac/linux/Solaris app in a jar and just bundle this
with very few hassle.
- It has a huge set of libraries.


But it also has some drawbacks:
- Memory footprint
- Language is not elegant, it's just C with perhaps 3 added syntax.
- Many API are not high level enough, even for a "high level" language, but
I think this is because Java was not thought as high level, but on this I
don't know and I just say many API could be simpler. (OK they changed a lot
now)
- It's sometime too easy to get the job done by copy pasting code. This is
an issue. Copy pasting is evil in coding, you can inspire yourself from some
code, but having to maintain code you do not understand is not good, in that
case, just use a lib.


Now, I'll say java is evolving to be better, java has a huge market and it's
becoming better every new release. If I have to make some logic that quickly
need to work on multi platforms (without any ifdef, and higher level than
just console, because C is very portable when you don't touch the GUI) I'll
use Java.






Objective-C


Ok, if you are still reading, there you go.


I think objc do things really well. It separate the object model from the
procedural model with:


for(i = 0; i < 10; i++)   // Porcedural programming
    [myObject doSomthing];  // OO programming


This is where it does things better than java and C++.


So, this is for the syntax. Then, I love the fact you can do plain C in it,
this is personal, I did C for quite some years now (about 14, but I'm 23yo,
so that's quite a lot for me).


I think, Obj-C is needed (I mean over C) exactly for what Apple uses it,
Application development.


Things like Notification center, autorelease pool, key value coding and key
value coding observation, nib files... Are juse in need of that language. Of
course, you could have made it simpler. But now I'm on 10.5 (yea, legally),
and even if I can't speak about it, I can say I'm amazed. I've been playing
with computers since I was 4yo (I did some super paint on an SE 30 back
then, nothing fancy like many of you who are far more experienced than me,
but I still remember it), I tested gazillion of user interfaces and I'm
amazed. Apple job on the UI is incredible. Many things just works (like drag
and drop of nearly everything everywhere)...


I realize the logic needed to make it work. And to make it maintainable by
human beings like us, you need a tool, and Obj-C is that tool. It's a bit
like lua in my game, it's to maintain the UI, use it's functions...


I know many of you are mad at Apple deprecating things like they do. But
it's legitimate. Of course, I agree it should continue working and just
issue a warning.


I encourage the change. Yea, I know I'm young and I hope I can still live
quite some time and it might be more than some of you. I have a really high
respect for the work you did and will do, you helped me a great lot in my
life, and I know you will continue. Your wisdom in coding is great and it's
an honor to have learned from many of you, even if you don't know you helped
me. (I speak to a wider audience than just that mailing list)


It's fun, I started many sentences with I and they as they are aligned, it's
a fancy effect:)




We all know that there is nothing more frustrating than a change we didn't
want. But that's what make use move forward. There are good and bad changes,
but they all put our adaptation capabilities under stress, and this is what
makes us evolve. At least, this is what I think. I know I sound like a
crumpled newspaper or some idiot on the TV, I wish I did not but I know I
do.


Apple is doing great things, nobody can deny it, I agree with Zack and other
that it's at a cost which is too great sometimes. But I did the move
to 10.5and I was really happy to see I had to do nothing except
hitting build to
have all my apps working. Ok, there is no carbon apps in the lot, there are
some really old C code, of course, the game (nearly 1mio of C code if you
count the math libs which is quite big because of ASM for multiple
platforms) and a couple of Cocoa apps. I spent 1h putting my cross compiler
for windows back on line and there we go.


I know the problem is really about Carbon, but Apple stated, you'll have to
move to Cocoa. Again, as a young person, I took the move, and I recoded all
my apps from Carbon to Cocoa as soon as I had my first Mac OS X CD. It was a
pain, it was frustrating, sometimes, I just started from scratch, my libs
would not compile... But I had time for it, I was discovering something new.


Now, many of you are older and "made" the computers as they are now. Again,
your work is incredible, it's with all of you that we are were we are now.
All the games you did, all of this.


But it's not because the game don't work anymore that it has been a lack of
time. I truly think all things should come an go, this includes myself. Now
it's time for Cocoa and OpenGL games. I encourage you to created new games
using those technologies. You can, as Zack did for dark castle, revamp the
game. I will feel immensely happy when the new dark castle comes out. I know
the old one passed away, and I keep it's good memories with me.




I'm a bit sorry for this message, it was a pain to read, my english is far
from perfect and I'm very bad at explaining things. I'm the kind of person
overwhelmed by it's feeling and I could write a book to explain all of it.


As a final note, I encourage all of you to continue the hard work. I really
hope we will all be together in the train and nobody will be left behind, I
know it's utopic, but if I stopped being utopic, I would die right away.


I wish you the best to all of you.


From a little rookie.

-- 
Kuon

"Don't press that button."
http://goyman.com/
Blog: http://kuon.goyman.com/

Other related posts: