Author Topic: Which language and library to use  (Read 35045 times)

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Which language and library to use
« Reply #15 on: July 02, 2014, 09:36:15 AM »
And with Python you might get the program up and running faster too (shorter development cycle).

What actually makes python faster in development? In my mind it's just another language. I've seen many examples (text book examples without any context to real development) of short code that would require bla bla blaa lines of code in C++, but really, it's not the point at all. The actual lines of code has very small role in what game development is.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Which language and library to use
« Reply #16 on: July 02, 2014, 09:46:50 AM »
And with Python you might get the program up and running faster too (shorter development cycle).

What actually makes python faster in development? In my mind it's just another language. I've seen many examples (text book examples without any context to real development) of short code that would require bla bla blaa lines of code in C++, but really, it's not the point at all. The actual lines of code has very small role in what game development is.

Big part of it comes from the syntax that requires less ceremonies than some other languages. Another part comes from the ability to run code interactively, which allows you to get the feel of the problem you're solving easier. Lot of this of course depends on the person writing the code. If one absolutely wants to have a language where compiler checks for used types, then Python most likely is wrong choice. A big thing to me currently is the fact that functions are first class citizens and I can construct them run time. Again nothing that regular OO wouldn't be able to solve elegantly, but again, it needs a bit more work.

But you're definitely correct, it's just another language. It isn't perfect and it isn't correct solution to everything.
Everyone you will ever meet knows something you don't.
 - Bill Nye

reaver

  • Rogueliker
  • ***
  • Posts: 207
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #17 on: July 02, 2014, 09:51:18 AM »
A big thing to me currently is the fact that functions are first class citizens and I can construct them run time.

Try C++11, if you are familiar with C++ you're gonna love std::function :)

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Which language and library to use
« Reply #18 on: July 02, 2014, 10:06:18 AM »
A big thing to me currently is the fact that functions are first class citizens and I can construct them run time.

Try C++11, if you are familiar with C++ you're gonna love std::function :)

C++ is one of those languages that I'm not really comfortable with writing :) I wrote a shoot-em up long time ago with C++ and that convinced me that I should learn something else. But that's just a personal preference really and I find it really great that the language is being developed and updated with new features.
Everyone you will ever meet knows something you don't.
 - Bill Nye

QubeNub

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
    • Email
Re: Which language and library to use
« Reply #19 on: July 03, 2014, 09:37:24 AM »
Thank you all for your responses and advice!

I've chosen for Python with Libtcod since I haven't written much in higher level languages yet.
I also see these kind of projects as an excuse to learn something new.

I am currently most proficient with Java, C# and those kind of languages (also did a lot in C but didn't really like the super low level programming to build games) so something 'new' like Python would be a welcome asset to my skills.

Thanks again and I will post something when I have something playable!

QubeNub

Kevin Granade

  • Rogueliker
  • ***
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #20 on: July 04, 2014, 02:53:25 AM »
The major reason to use Python or similar (Lua w/LuaJIT for example) is it allows you to quickly get a working prototype and test your ideas.

Python has been quoted as extremely great language yet where are all roguelikes written in python?
Legacy systems, if I were to start a roguelike or similar from scratch, the core would be either Python or Lua.

For example, if you want other people to contribute much, you'll probably avoid really complex languages that not very many people can code in.
This can not be overstated, if you start your project in a non-mainstream language, you're pretty much going to be doomed to be the only developer.
If it weren't for this, my split of language choices would be between Python, Lisp, and Perl instead of Python and Lua.
If you want to make an Android game, you'll probably write in Java.
Never Java, not even once.  The Android NDK exists, you can write for that with C++.
The basic error here is thinking that it makes a huge difference what programming language you use. Guys, they're all Turing equivalent and they're all built to perform roughly the same kinds of tasks
I agree with the rest of your post, but language choice can have orders-of-magnitude impact on your game's performance, your development velocity, and your ability to attract other developers, it absolutely makes a huge difference.
Try C++11, if you are familiar with C++ you're gonna love std::function :)
DDA made the jump to C++11 recently, and there's so much awesome available now.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #21 on: July 04, 2014, 05:23:16 AM »
Why not Java?
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

Kevin Granade

  • Rogueliker
  • ***
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #22 on: July 04, 2014, 06:16:52 AM »
Because it's an utterly terrible language that delivers on none of the things it promises.
"really truly object oriented" - has magic objects that programmers cannot replicate, such as magic handling for enum.
Terribly broken inheritance model that the *language author* has acknowledged was a mistake.
"totally portable" - only if you don't talk to your OS, which is exactly the issue every other language has, but Java gets in your way when you try to address it.
"easy concurrency" - only using Java versions of threads, meaning they are crippled in many key ways.  No ability to fork whatsoever.
I find it to require even more verbose constructs and boilerplate than its main competition, c++, which is one of the main things that make me avoid c++ for everything.
Totally ridiculous GC performance for any serious program.  Second-long pauses for garbage collection that the language explicitly prevents you from managing in any way are unacceptable.
Ludicrous memory bloat.
VM tuning, this should simply not be something you have to do to make your program performant.
Requiring users to install and maintain a really massive runtime in order to play my game.

It has good libraries and good documentation, those are the only positives that stand out.  As of C++11 the std libraries are on par for my uses.  (Java's libraries are better in enterprise settings, but I really just want the data structures and algorithmic stuff, not glue layers for databases and such)

chooseusername

  • Rogueliker
  • ***
  • Posts: 329
  • Karma: +0/-0
    • View Profile
    • Email
Re: Which language and library to use
« Reply #23 on: July 04, 2014, 07:50:23 AM »
Because it's an utterly terrible language that delivers on none of the things it promises.
And yet, people have made great games in both it, and tonnes of arguably worse languages.  Got a languages you wouldn't wish on your worst enemy?  People have more than likely written games other people have enjoyed in it.

Just pick one and start working.  Those who can, do, those who can't, just talk about it.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Which language and library to use
« Reply #24 on: July 04, 2014, 08:22:59 AM »
"really truly object oriented" - has magic objects that programmers cannot replicate, such as magic handling for enum.
Terribly broken inheritance model that the *language author* has acknowledged was a mistake.

Could you provide more details on these two? Not that I want to advocate Java, which is insanely slow, limits programmer's every step, and of course "portability" of Java code is  a huge bullshit. However, I have no idea what is wrong with Java's enums and I have never heard such comments about the inheritance model (at least not from the language authors, a link is welcome!).
Fame (Untitled) - my game. Everything is a roguelike.

Omnivore

  • Rogueliker
  • ***
  • Posts: 154
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #25 on: July 04, 2014, 08:27:03 AM »
For anyone who considered using Go but gave up due to lack of generics:
https://github.com/clipperhouse/gen

Ok, its not by the Go dev team, but.. its generics for Go. 

There is also a minimal replacement for curses available in Go, termbox-go.  A few libraries exist as well with a graphs library in the works that looks very promising for pathfinding and related tasks.

Have to admit, though I really like Python, I find it tempting!

Hope this helps,
Omnivore

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: Which language and library to use
« Reply #26 on: July 04, 2014, 09:12:40 AM »
Because it's an utterly terrible language that delivers on none of the things it promises.
Wow, that's a strong opinion. I've worked on huge projects in Java, and highly regard it, even though I'm mostly a C++ developer. In fact, after two years of working with Java I probably wouldn't touch C++ again if not for the C++11 standard. Still, in many ways Java is light years ahead of C++.

What's your experience working with Java?
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Which language and library to use
« Reply #27 on: July 04, 2014, 09:48:02 AM »
Isn't Java just a C++ without pointers and multiple inheritance? I remember it something like that.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Which language and library to use
« Reply #28 on: July 04, 2014, 10:47:21 AM »
Isn't Java just a C++ without pointers and multiple inheritance? I remember it something like that.

"No pointers" in Java is just another broken promise of that language. The error you'll encounter most of the time is "null pointer exception", just like in C++. However, in C++  (as you know) you are able to debug and fix such errors very quickly. In Java you cannot, as Java hides the details from you.
Fame (Untitled) - my game. Everything is a roguelike.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Which language and library to use
« Reply #29 on: July 04, 2014, 11:27:28 AM »
Isn't Java just a C++ without pointers and multiple inheritance? I remember it something like that.

"No pointers" in Java is just another broken promise of that language. The error you'll encounter most of the time is "null pointer exception", just like in C++. However, in C++  (as you know) you are able to debug and fix such errors very quickly. In Java you cannot, as Java hides the details from you.

Java doesn't have pointers, but references. There's a nice and simple explanation how they differ from C pointers at http://programmers.stackexchange.com/questions/141834/how-is-a-java-reference-different-from-a-c-pointer

The best thing (in my opinion) about Java is the run time environment, which allows new languages to leverage old libraries.
Everyone you will ever meet knows something you don't.
 - Bill Nye