Object Oriented, Garbage collecting ect.

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
nym
Novice
Novice
Posts: 116
Joined: 18 Aug 2004, 10:01
Contact:

Post by nym »

woo, i logged on, and checked the forums... but i am too tired to write a decent reply. But OOP can making coding alot easier. (so convincing)

If you want i have templatized singly linked list and binary search trees which i programmed a while ago, if anyone wants, talk to me on IRC. :)
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

I think I have the code in one of the mail you sent me? I should add it, it's only a matter of time :wink:
User avatar
Shura
Novice
Novice
Posts: 96
Joined: 15 Jun 2004, 01:36

Post by Shura »

Elven Programmer wrote:Eheh Alex is always a bit rude, anyway I'm studying UML these days and I think it can be a quite useful tool for big projects (Alex: you never studied software engeneering right?).
right, i didn't but i'm in bussiness for the past 6 years always working together closely with others. most death marches were caused by stupidity or false management not b/c missing UML or whatever.
Elven Programmer wrote:About OOP, I'm familiar with it since I studied Java (Please don't try to say Java is not OO) and I think sometimes it can be really useful (for instance in the beings code). The problem is I'm not so familiar with C++, but if someone wants to convert some parts of the code to C++ is welcome.
alright, java is OO. well... that was a lie. it simply is a programming language like just any outer out there. isn't it the concepts that make up OOP?
Don't argue with idiots. They drag you down to their level and beat you with experience.
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

Ok ok I won't argue with idiots :lol:

Just kidding, but it's hard to have a discussion with you, you always says I'm not right :cry:
Guest

Post by Guest »

MathGeek wrote:I'm fairly experienced with C++ OO Programming, so I think I'll try and start something. I'm going to start with a Doubly linked list, and Binary Tree. I'll try and post an example of it's use, and if people like it then we'll go from there.

The only thing I need to know is how I get the code on the CVS, or who I give it to so they can review it.
... those are things already in the STL!!!! any experienced C++ coder would be quite ashamed *not* to use that until specific needs dictate otherwise.
User avatar
nym
Novice
Novice
Posts: 116
Joined: 18 Aug 2004, 10:01
Contact:

Post by nym »

Hello guest, writing your own structures is educational and helps the writer to understand the concepts behind that structure better. In any important project (if needed) STL, or C++ Boost, would be used due to their portability (ANSI C++) and the ammount of testing done on those structures included in the library.

One other thing, most of us are not "experienced" C++ programmers.. Many here are self-taught, amature programmers which program as a hobby (like me :)).

:)
User avatar
Bjørn
Manasource
Manasource
Posts: 1438
Joined: 09 Dec 2004, 18:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn »

That's all well and all, but there's limits to how far you can go with making this a project to gain experience. In my opinion we would be out of our mind when implementing STL functionality ourselves. If one still needs to play around with templates or data structure concepts then I would kindly ask this person to please do so in a little more private environment.
User avatar
Shura
Novice
Novice
Posts: 96
Joined: 15 Jun 2004, 01:36

Post by Shura »

Bjørn wrote:That's all well and all, but there's limits to how far you can go with making this a project to gain experience. In my opinion we would be out of our mind when implementing STL functionality ourselves. If one still needs to play around with templates or data structure concepts then I would kindly ask this person to please do so in a little more private environment.
my thoughts exactly! just because we do not know otherwise yet we should not try to reinvent the wheel for everything but C/C++ itself, eh?
question: everyone - especially those who tought programming to themselves - should know where to nab information from. google and other serach engines may be the most powerful tools here. of course sorting out trash is useful as well.
knowing something is not worth as much as to know how to look for it. ;)
Don't argue with idiots. They drag you down to their level and beat you with experience.
MathGeek
Novice
Novice
Posts: 52
Joined: 13 Nov 2004, 22:07
Location: Calgary AB. Canada

Post by MathGeek »

Thanks for pointing me towards STL. I've spent weeks going through everything I could find on using it, and haven't been around any in that time

I'm developing some storage classes to speed up the game, which I think I mentioned earlier. I should be more active from now on.
User avatar
ElvenProgrammer
Founder
Founder
Posts: 2526
Joined: 13 Apr 2004, 19:11
Location: Italy
Contact:

Post by ElvenProgrammer »

It would be great :D
VCL
Peon
Peon
Posts: 4
Joined: 25 Sep 2004, 17:04

Post by VCL »

I've had experience with OO since around 1998, and I'm fairly familiar with Java and C++.

Guys, you can write object oriented code in C. Yes you read that right. C code can be object oriented, although the language doesn't natively supports it. GTK+ is a good example of an object oriented C library.

For middle to large programs, OO is generally a good idea, because it modularizes your code and makes it easier to understand, if done correctly. The last thing anyone would want is something like grfio.c in the eathena source code (try reading it, but you'll get nightmares).
But don't overdo it. Too much abstraction distracts the reader.

Garbage collection can improve productivity - a lot. For many applications, on today's computers, manually handling memory just isn't worth it. The speed gains are minimal and probably not noticable at all, while productivity is decreased. It's also a common source of bugs.

As for Java: don't use it for games. Don't use it for desktop applications. Server software, maybe. Requiring the user to install a 15 MB JVM is nuts, and it hogs memory.
java is always slower, whatever you do b/c of the fact that the bytecode needs to be interpreted !again! even though cou compiled it previously!
Java is JIT-compiled. Bytecode is compiled to native CPU instructions at runtime, meaning it can run just as fast as a C/C++ program. But Java apps still use a lot more memory.

And yeah, it's non-free, unless you count the GNU Java Compiler. But the GNU implementation of the standard library is a lot slower than Sun's.
Please don't try to say Java is not OO
I'd say Java is too OO. Everything is an object. References? Pointers? What's that?
... those are things already in the STL!!!! any experienced C++ coder would be quite ashamed *not* to use that until specific needs dictate otherwise.
I agree, but only if you don't support broken compilers with broken STL implementations. Standardizing on gcc is good.
Post Reply