RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
Self-made scripting vs. lua, javascript, etc.
 
Post new topic Reply to topic Goto page Previous  1, 2, 3  Next 
View previous topic - View next topic  
Author Message
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Sun Aug 10, 2008 6:22 pm    Post subject: [quote]

valderman wrote:
I strongly disagree with just about everything in this post. C++ is definitely not very distanced from low-level programming, the speed of development with it is glacial compared to high level languages such as C#, Java, Python, etc. and its performance is close to that of C if you know how to use it more or less properly. The only point where we agree seems to be that it is a bit of a tangled mess.

Fear not, opinions are opinions. I find C++ to be very abstract. It's not a high level language yet it's not a low level language either. C is a low level language, though some might argue that it isn't (mainly the assembly freaks who insist that anything not assembly is high-level). I find that C++ removes a lot of the "minor headaches" of C by introducing more standard libraries to handle the menial tasks of C, but most of the time this takes it into the abstract. Again though, I don't intend to start a "language war", but like religion, people generally defend their chosen language to the death if someone says something that they don't agree with...
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
Mattias Gustavsson
Mage


Joined: 10 Nov 2007
Posts: 457
Location: Royal Leamington Spa, UK

PostPosted: Sun Aug 10, 2008 6:40 pm    Post subject: [quote]

Personally, I don't like C++. It's quite outdated, and impractical in many ways.

I'm also not aware of any real alternatives. Which is a shame...
_________________
www.mattiasgustavsson.com - My blog
www.rivtind.com - My Fantasy world and isometric RPG engine
www.pixieuniversity.com - Software 2D Game Engine
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Sun Aug 10, 2008 8:21 pm    Post subject: [quote]

Well, there's always D...
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Mon Aug 11, 2008 1:26 am    Post subject: [quote]

Mattias Gustavsson wrote:
Personally, I don't like C++. It's quite outdated, and impractical in many ways.

I'm also not aware of any real alternatives. Which is a shame...
Don't worry, C++0x is just around the corner, with even more complexity than before, and perhaps even solutions to some of its shortcomings. At least now we won't need to debate wether 0 or NULL is the correct way to define an unused pointer...

Quote:
Java programs are more robust, overall Java has less ways to make mistakes than C++ has (at least for me).
Ah, but what is life without manual memory management? Less exciting, that's what it is!
_________________
http://www.weeaboo.se
Back to top  
Rainer Deyke
Demon Hunter


Joined: 05 Jun 2002
Posts: 672

PostPosted: Mon Aug 11, 2008 3:07 am    Post subject: [quote]

With RAII, well-written C++ has less manual resource management than Java. In Java, you need to dispose of file handles and other non-memory resources by hand. In C++, it all disappears when it goes out of scope.
Back to top  
RedSlash
Mage


Joined: 12 May 2005
Posts: 331

PostPosted: Mon Aug 11, 2008 3:37 am    Post subject: [quote]

D seems like a good language. But I'd give it a couple years to see where it goes and whether people will adopt it as a serious replacement for C++.

Quote:

With RAII, well-written C++ has less manual resource management than Java. In Java, you need to dispose of file handles and other non-memory resources by hand. In C++, it all disappears when it goes out of scope.

I use RAII extensively and have never had to worry about resources not getting freed. I implement reference counted pointers in which resources are deleted automatically once the last reference goes out of scope. The nice thing about RAII is that it avoids the try.. catch.. finally.. mess that Java has.
Back to top  
Mattias Gustavsson
Mage


Joined: 10 Nov 2007
Posts: 457
Location: Royal Leamington Spa, UK

PostPosted: Mon Aug 11, 2008 12:14 pm    Post subject: [quote]

so, what would you guys consider good language features?

There's many things I dislike about C++, and the way I'm using it, I tend to stay away from a lot of its features, using a rather strict subset (don't use templates, don't use the STL, don't use operator overloading, don't use namespaces, don't use RTTI, don't use exceptions etc,etc) so I guess what I'm using is more "C with objects". The mess some programmers can cause when trying to use all the "cool" C++ features is truly astounding.

Automatic memory management is really nice, and sometimes I miss that in C++. Typeless languages can be nice, but I think strongly typed stuff is useful too.

What things makes you guys like your language of choice?
_________________
www.mattiasgustavsson.com - My blog
www.rivtind.com - My Fantasy world and isometric RPG engine
www.pixieuniversity.com - Software 2D Game Engine
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Mon Aug 11, 2008 1:32 pm    Post subject: [quote]

I have two languages of choice: BASIC and C. I like BASIC because it isn't terribly picky about many things...I can often just code-and-go without having to do too much planning. Great for prototyping. Also, freeBASIC makes it easy to make a program that's just as powerful as any C/C++ program. I like C because it's a universal language; I can code pretty much the same way on any platform of my choice and the rules never change very much. I recently made a conversion of Fatal Relations for the PC Engine, then decided I wanted to make the same conversion for the Nintendo DS. So I copied the non-system-specific code to the DS source file and cut out a huge chunk of time. The only things I had to change were the function prototypes, plus I had to create a header for the DS version.

Example:
Code:
/* PCE version: */
my_function(arg1, arg2, arg3)
char arg1, arg2, arg3;
{
  /* stuff */
}

// DS version:
void my_function(char arg1, char arg2, char arg3)
{
  // stuff
}

That was about the extent of changes I had to do. Can't say that with most other languages, not even BASIC converts so readily to other platforms because of differences in the dialects. So yeah...that's why I use C, and I use it more than anything else these days.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Mon Aug 11, 2008 3:44 pm    Post subject: [quote]

Lang waaaaaaaaaaaaaaaaaaaaaaaaaaaar!
Lang war everybody!
It's going down! Shit is going down!
Back to top  
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Mon Aug 11, 2008 9:45 pm    Post subject: [quote]

Mattias Gustavsson wrote:
so, what would you guys consider good language features?

There's many things I dislike about C++, and the way I'm using it, I tend to stay away from a lot of its features, using a rather strict subset (don't use templates, don't use the STL, don't use operator overloading, don't use namespaces, don't use RTTI, don't use exceptions etc,etc) so I guess what I'm using is more "C with objects". The mess some programmers can cause when trying to use all the "cool" C++ features is truly astounding.

Automatic memory management is really nice, and sometimes I miss that in C++. Typeless languages can be nice, but I think strongly typed stuff is useful too.

What things makes you guys like your language of choice?
What makes a good feature really depends on what I'm going to use the language for. Manual memory management can be an asset sometimes, but most of the time it's more of a bother. With refcounted pointers, you can have both. Kind of.
Operator overloading is actually a nice thing to have when writing, for example, a vector class, but used improperly it will cause horrors beyond words. Basic data structures, such as the list, map and vector found in the STL, are essential. Templates are also very useful for certain things (generic data structures, for example.) I prefer strict typing, mainly because trying to do OOP in PHP is very, VERY painful, and proper string handling woule be very nice to have.

For scripting languages, the priorities are different. There I'd have to say that simplicity, good bindings to other languages, dynamic typing and good string handling (again) are the most desirable traits.

But as I said, it really depends on the job. I wouldn't want to write complex, performance critical software in Lua, just as I'd never use a C++-ish behemoth for scripting or system administration.
_________________
http://www.weeaboo.se
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Mon Aug 11, 2008 10:48 pm    Post subject: [quote]

Ninkazu wrote:
Lang waaaaaaaaaaaaaaaaaaaaaaaaaaaar!
Lang war everybody!
It's going down! Shit is going down!

Heheh. Nah, if this turns into a lang war, I have both the ability and authority to nip it in the bud. :)
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Tue Aug 12, 2008 12:00 am    Post subject: [quote]

Quote:
I like C because it's a universal language; I can code pretty much the same way on any platform of my choice and the rules never change very much.
Sorry, but this is simply not true. Of all languages in common use today, C is by far the one most susceptible to interesting behaviour on different platforms, simply because it's not very far removed from the platform. Byte ordering? Endianness? Struct padding? Memory alignment? Even the size of the basic data types cannot be guaranteed between architectures, operating systems or even compiler versions. Dereferencing a NULL pointer? Undefined. Array index out of bounds? Undefined. Integer overflow? Undefined. Accessing memory after it's been free()'d, or objects that have gone out of scope? Undefined. Even bit shifting may easily result in undefined behavior on certain platforms.

Try searching the C99 specification for "undefined" and you'll see.

C might seem pretty universal because almost every platform in existence has a C compiler. However, the pitfalls and differences between platforms that must be taken into account are staggering if you take a closer look.
_________________
http://www.weeaboo.se
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Tue Aug 12, 2008 1:39 am    Post subject: [quote]

Well, I'll let you have that opinion, though I know better.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
RedSlash
Mage


Joined: 12 May 2005
Posts: 331

PostPosted: Tue Aug 12, 2008 2:33 am    Post subject: [quote]

Quote:
Dereferencing a NULL pointer? Undefined. Array index out of bounds? Undefined. Integer overflow? Undefined. Accessing memory after it's been free()'d, or objects that have gone out of scope? Undefined.

This seems consistent across all platforms. :)
Back to top  
valderman
Mage


Joined: 29 Aug 2002
Posts: 334
Location: Gothenburg, Sweden

PostPosted: Tue Aug 12, 2008 7:44 am    Post subject: [quote]

RedSlash wrote:
Quote:
Dereferencing a NULL pointer? Undefined. Array index out of bounds? Undefined. Integer overflow? Undefined. Accessing memory after it's been free()'d, or objects that have gone out of scope? Undefined.

This seems consistent across all platforms. :)
Yes, well, at least you can rely on those behaviors being undefined.

Quote:
Well, I'll let you have that opinion, though I know better.
Could you then please explain to me how the issues I listed are consistent with your claim that C is highly portable?
_________________
http://www.weeaboo.se
Back to top  
Post new topic Reply to topic Page 2 of 3 All times are GMT
Goto page Previous  1, 2, 3  Next 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum