Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Reasons to like or hate Java, C# and C++

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Reasons to like or hate Java, C# and C++
nonnus29
Member #2,606
August 2002
avatar

How about everyone post why they like language X and not say anthing bad about other languages?

Reasons I like Java because: I like gc, I like it's huge library that has everything and the kitchen sink, it's suitable for the level of games I am likely to write, and it runs anywhere (mostly).

Reasons I like c#: N/A haven't used it.

Reasons I like c++: I haven't used c++ in a long time and don't imagine I will in the future either. But when I did write c++ I used a java like subset of the language :P

Izual
Member #2,756
September 2002
avatar

I like C/C++ because it has everything i need and it has Allegro ;D . So there is no reason for me now to learn any other language, since i have programing as hobby. :) And as IDE i use CodeBlocks with Mingw.

CGamesPlay
Member #2,559
July 2002
avatar

I like C# because it has a huge standard library. This is the same reason I like ruby, but C# has a JIT. I haven't used Java extensively.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Dennis
Member #1,090
July 2003
avatar

I like C++, because I'm used to it. I'm likely to learn C# and Java in the future for portability and lazyness reasons.(If they do indeed have huge standard libraries for all and everything, that means less coding work for me.)
I'd only use C# and Java for utilities and for work though. For games, I'll stick to C++ and Allegro, because I'm highly unlikely to ever write anything else than simple 2D game(s).

Epsi
Member #5,731
April 2005
avatar

I like C++ because Java ran off with my girlfriend :'(
(after killing my dog)

___________________________________

piccolo: "soon all new 2d alegro games will be better. after i finsh my MMRPG. my game will serve as a code reference. so you can understand and grab code from."
piccolo: "just wait until my invetion comes out its going to take the wii to the next leave of game play. it will run sony and microsoft out of busness if i dont let them use it aswell."

Archon
Member #4,195
January 2004
avatar

OK. It looks like my interests in C# game programming are gone -- Tao wouldn't work properly. cry cry

CGamesPlay
Member #2,559
July 2002
avatar

Bah, you just gave up too easily :P

The problem he had was that we couldn't get a working libglfw.so on his AMD 64 system.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

Quote:

Bah, you just gave up too easily :P

Really? I thought that my misunderstandings were making you hit your head on the desk in frustration and that you'd want me to quit :o

Quote:

The problem he had was that we couldn't get a working libglfw.so on his AMD 64 system.

Well you should explain to me why GCC wanted me to "-fPIC" a package that was already "-fPIC"ed!

Frankly, if it doesn't work 'out of the box', I wouldn't think that anyone would have the determination to go through that to install Tao just to play a game -- they already complain about installing .NET!

Also note that it wasn't 100% working in .NET either. :-/

Again 'also', SDL.NET wont work for me either - there's something buggered with it and AMD64...

Qué unfortuna!

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

I thought that my misunderstandings were making you hit your head on the desk in frustration and that you'd want me to quit

This is what programming is about, and more importantly, what learning is about.

Quote:

Well you should explain to me why GCC wanted me to "-fPIC" a package that was already "-fPIC"ed!

What, you think I know what -fPIC does? :P

Quote:

Frankly, if it doesn't work 'out of the box', I wouldn't think that anyone would have the determination to go through that to install Tao just to play a game -- they already complain about installing .NET!

Right, I intend to distribute x86 binaries...

Quote:

Also note that it wasn't 100% working in .NET either.

You can't really say that, because then you have to say Allegro isn't 100% C, because it compiles to machine code. I mean, what is ".NET"? If it's the CLR, well then this application is using the CLR to do platform invokes on the shared objects.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

Quote:

What, you think I know what -fPIC does? :P

Hmmmmmmmmmmmm.... Yeah. I think you do.

Quote:

You can't really say that, because then you have to say Allegro isn't 100% C, because it compiles to machine code. I mean, what is ".NET"? If it's the CLR, well then this application is using the CLR to do platform invokes on the shared objects.

Meh! I just meant that I tried running some of the examples as is, but they give me errors that made it close down - I was more concerned with getting the Linux side working because it's usually where all the problems come from.

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

Yeah. I think you do.

Heh, I appreciate your confidence in me :)

Quote:

I just meant that I tried running some of the examples as is, but they give me errors that made it close down - I was more concerned with getting the Linux side working because it's usually where all the problems come from.

Right, this is where all the problems were. Because of binary compatibility under windows, everything works nicely out-of-the-box. But because under Linux there is less binary compatibility, they can't just distribute the glfw dlls like they do for Windows. And because portage ships libglfw as a static library, we have to do the tie-up ourselves.

If you don't mind, I woul dlike to keep in touch with you as the project matures. Perhaps I can make an ebuild to build libglfw shared, or something.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

Quote:

If you don't mind, I woul dlike to keep in touch with you as the project matures. Perhaps I can make an ebuild to build libglfw shared, or something.

If you want to. The ebuild is just called 'glfw' (you kept saying 'libglfw')

It'd be nice if Allegro.NET was .NET 1.1 because then Mono could run it (at the moment) but if I wanted to, I might have to use SDL.NET to continue (and wait for it to be fixed on Linux)...

No one wants to throw in any more ideas?

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

It'd be nice if Allegro.NET was .NET 1.1 because then Mono could run it (at the moment)

Allegro.NET is, no offense to the developer, a very bad library. It renames all of the symbols in allegro, which is just an annoyance. Then, even more annoyingly, it uses a Capital_underscore_lowercase naming scheme (or was it Capital_Underscore_Capital? Both are annoying...).

Quote:

If you want to. The ebuild is just called 'glfw' (you kept saying 'libglfw')

Sorry. I got confused because the library name is libglfw :)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

Quote:

Allegro.NET is, no offense to the developer, a very bad library.

How long does it take to provide a <language> interface to a C library assuming it'll be 'plugged in' the same way?

Steve++
Member #1,816
January 2002

I've just started playing with PHP. Now I know why it has been an overnight success.

I just made a simple online shop that uses PayPal's instant payment notification to run a script on my server that verifies the payment, generates a unique code (md5-style), logs that code in the database with the transaction details, then makes a download url using that code and emails that url to the customer. The download url is a php script with the unique code as a variable's value. The URL expires after a certain time. Although the URL's type is php, the script sends a pdf file with a different name and this is handles gracefully on the client side. This whole system is to sell ebooks. I did all that and a week ago I didn't know any php or anything about PayPal integration. I'm not trying to blow my trumpet; just pointing out how useful PHP is as a language.

PS. If anyone wants me to setup something like this for them, my rates are reasonable. ;D

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

How long does it take to provide a <language> interface to a C library assuming it'll be 'plugged in' the same way?

In C# it involves:

[DllImport(Module="alleg42.dll",Symbol="set_gfx_mode")]
public static Int32 set_gfx_mode(Int32 mode, Int32 w, Int32 h, Int32 vw, Int32 vh);

The paramters the the DllImportAttribute aren't right, but they look like that.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Archon
Member #4,195
January 2004
avatar

AllegPHP?

Steve++
Member #1,816
January 2002

I'm not sure how fast PHP is though. All I know is that it's good on the server side.

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

In C# it involves: ...

But won't that result in unsafe code? The best way to use Allegro with a language other than C/C++ is to use it in a fashion native to the language.

I've got PHP/Allegro bindings about 50% done, but I have no idea what the speed is because I'm using NX to connect to KDE running on a 500Mhz Via chip... (My guess is that it will be pretty bad.) My first pass is simply a 1:1 mapping with memory managment:

1<?php
2 allegro_init();
3 install_keyboard();
4 set_gfx_mode(GFX_AUTODETECT, 640,480);
5 $screen = get_allegro_var('screen'); // Don't know if there's any way to sync PHP/Allegro vars...
6 $font = get_allegro_var('font');
7 
8 $buffer = create_bitmap(640, 480);
9 
10 textout_ex($buffer, $font, "Hello World", 8,8, makecol(255,255,255), -1);
11 
12 unset($buffer); // or $buffer = NULL; equivelent to: destroy_bitmap($buffer);
13 
14 allegro_exit();
15?>

Obviously certain portions won't be available (eg, Unicode & Config) because PHP has native implementations. Also, other portions are limited (eg, Timers & GUI) because it's impossible to provide an exact replication. For example, Timers might simply be:

<?php
  set_tick_variable($ticker, 60 /* BPS */);

  while ($playing_game)
  {
    while ($ticker)
    {
      $ticker--;
    }
  }
?>

In other words, only a few new timer functions to take care of common tasks would be available.

The only practical uses of PHP/Allegro are probably to 1) test ideas and 2) use the graphics portion to process image data on a web server.

The demo running in PHP:
{"name":"589739","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/6\/466700d36387dec3b0cf5fff78d1be2d.png","w":529,"h":427,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/6\/466700d36387dec3b0cf5fff78d1be2d"}589739

James Stanley
Member #7,275
May 2006
avatar

BAF, I know it's a bit late to reply now, but on the first page you said .NET's got everything. It sounds like it's too bloated to me, or does it only compile the bits you use?

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

But won't that result in unsafe code? The best way to use Allegro with a language other than C/C++ is to use it in a fashion native to the language.

No, DllImport doesn't require the unsafe keyword/flag. And this is the fashion native to C#. Platform invoke was designed for this purpose.

[append]
James: The bits you don't use are compiled, of course, because they are part of the library. They aren't loaded into memory unless you use them, though. Each subsystem is in its own DLL.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

No, DllImport doesn't require the unsafe keyword/flag.

But how do you deal with this?:

public myCSharpFunction() 
{
  BITMAP *bmp = create_bitmap(640,480); // (what would this line really look like?)
  // memory leak...
}

Having to explicitly call destroy_bitmap() goes against the philosophy of memory managed languages.

Marcello
Member #1,860
January 2002
avatar

If it's anything like Java, you would make it a Java class, with a destructor that frees the underlying memory.

Marcello

CGamesPlay
Member #2,559
July 2002
avatar

Yeah, one should really do what Marcello said.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Steve++
Member #1,816
January 2002

ML said:

$screen = get_allegro_var('screen'); // Don't know if there's any way to sync PHP/Allegro vars...

I'm not php expert, but wouldn't you do something like this?

function allegro_init()
{
   global $screen;
   // ...
   $screen = get_allegro_var('screen');
   // ...
}

 1   2   3   4 


Go to: