Object Oriented, Garbage collecting ect.

Content and general development discussion, including maps, quests, and server code from the development team.
User avatar
nym
Novice
Novice
Posts: 116
Joined: 18 Aug 2004, 11:01
Contact:

Post by nym » 15 Dec 2004, 08:22

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
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 15 Dec 2004, 13:21

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
Peon
Peon
Posts: 96
Joined: 15 Jun 2004, 02:36

Post by Shura » 15 Dec 2004, 14:23

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
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 15 Dec 2004, 15:22

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 » 22 Dec 2004, 17:35

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, 11:01
Contact:

Post by nym » 23 Dec 2004, 01:58

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
TMW Adviser
TMW Adviser
Posts: 1430
Joined: 09 Dec 2004, 19:50
Location: North Rhine-Westphalia, Germany
Contact:

Post by Bjørn » 23 Dec 2004, 14:27

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
Peon
Peon
Posts: 96
Joined: 15 Jun 2004, 02:36

Post by Shura » 23 Dec 2004, 21:21

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
Peon
Peon
Posts: 52
Joined: 13 Nov 2004, 23:07
Location: Calgary AB. Canada

Post by MathGeek » 30 Dec 2004, 21:43

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
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 02 Jan 2005, 16:06

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

Post by VCL » 23 Jan 2005, 00:17

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