Search found 80 matches

by quarn
Mon Nov 01, 2004 12:15 pm
Forum: Programming Discussion
Topic: java function: hard to read, but is it sound?
Replies: 2
Views: 198

If LL1 is null, trying to access LL1.value will give you a null pointer exception.
by quarn
Sun Oct 31, 2004 10:10 am
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

BlackAura, allright, I believe that we now are understanding eachother. The question left to ask is: do you consider programming the dreamcast with KOS to be low level? I don't.. About the controller example, I meant controllers as in "With this game you will be able to controll the player with...
by quarn
Sun Oct 31, 2004 4:25 am
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

good design is not the same as easy to extend and maintain. Modern programming languages are object oriented because its easier, not necessarily better. Then we use different definitions. For me, easier is better as it cuts down development time. For me, good design means easy to extend and maintai...
by quarn
Sun Oct 31, 2004 2:57 am
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

Acctually, Ex-cyber summarized it pretty well. Though I am not trying to convert people to C++, just trying to make them understand the benifits that OOP brings. Since I felt I was argumented against with invalid arguments, I guess I did tell a C-programmer to reeducate. For me, it started when quza...
by quarn
Sat Oct 30, 2004 5:21 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

c99koder, I wasn't suggesting that update() must be the only pointer in the struct either. Did you get my point about not being able to implement two interfaces or have multiple levels of inheritance though? All ive been saying is that C++ isnt always the answer, not that C always is... And I keep a...
by quarn
Sat Oct 30, 2004 4:48 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

As for doing OOP, DCBlap's engine is written in C. It's got a linked list, with a few pointers to functions. so for example, a paddle's ->update(); would point to paddle_update(); and the ball's ->update(); points to ball_update(); Yeah, that's what I meant with simulating OOP in one of my posts at...
by quarn
Sat Oct 30, 2004 1:58 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

I agree with Kamjin that different languages have different purposes. I don't use a hammer for my screws, and I assume you don't either. Though I have yet to see a concrete example from quzar where OOP makes the code harder. I'm not saying that there aren't such situations, I just can't visualize it...
by quarn
Sat Oct 30, 2004 11:10 am
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

It seems that you are not open to any sort of argument however reasonable for using C over C++. So I'm not even gonna try anymore. Tell me again, what was your argument? That one should use printf instead of cout? That's not an argument, that's a matter of personal preference. I thought we agreed o...
by quarn
Sat Oct 30, 2004 3:42 am
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

quzar, ofcourse one shouldn't create lots of objects just because you want to use OOP. If you program is as small as that you can fit it all in the main-function in either C or C++. If you are reading at a university or equal, I would suggest that you take a course about code design and design patte...
by quarn
Fri Oct 29, 2004 3:43 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

I agree that C vs C++ is an issue of personal preference. While I have been stating that design patterns and object orientation is the main reason for why I choose C++ over C any day, I have not yet seen a concrete example for why people choose C over C++. quzar said that using C is better for small...
by quarn
Fri Oct 29, 2004 2:55 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

About the switch statement, I assumed you meant something like this to know which function to use: getKeys() { switch (controllertype) { case MOUSE: mouse_getKeys(); break; case KEYBOARD: kbd_getKeys(); break; ... You dont really need all those functions for new keys... you could simply call somethi...
by quarn
Fri Oct 29, 2004 2:18 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

You are totally missing my point though :) If you have read about design you have probably heard that one should try to get low coupling and high cohesion in your code. This will drasticly improve the maintainability in your code. Having it all in one function will break cohesion so rather use multi...
by quarn
Fri Oct 29, 2004 1:45 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

I don't see your point, but maybe we are looking in different directions. Take the example of using different kinds of controllers on the dreamcast. Then maybe you have an interface that all controller classes use and in your application you just use that interface and don't care if it's a regular c...
by quarn
Fri Oct 29, 2004 1:24 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

Your projects don't need to be large to benefit from using OOP. Though the larger the project, the larger the benefit.
by quarn
Fri Oct 29, 2004 1:07 pm
Forum: Programming Discussion
Topic: Question
Replies: 61
Views: 3366

Note - I have some bias against C++. I just don't like it much. It takes all the worst features of a low-level language like C, and adds higher-level abstractions, while still requiring you to manage low-level resources. To me, that seems insane, which is why I generally prefer C, or much higher le...
by quarn
Sun Jul 25, 2004 12:49 pm
Forum: Programming Discussion
Topic: problems using vector
Replies: 20
Views: 755

quzar wrote:Yea, it dosnt work for me, still just gives me like. blah dosnt exist.
That's not really usefull info if you want help. What is the exact error message you get?

If you are not already using version 3.4.x how about upgrading and trying again?
by quarn
Sun Jul 25, 2004 11:47 am
Forum: Programming Discussion
Topic: problems using vector
Replies: 20
Views: 755

Ian, yeah. I believe that compiler flag was implemented in gcc 3.2 so it is no surprise that it does not work for your gcc version.
by quarn
Sun Jul 25, 2004 8:39 am
Forum: Programming Discussion
Topic: problems using vector
Replies: 20
Views: 755

Kos 1.3.x (svn) and GCC 3.4.0 yes. Though I have had vectors working with version 3.2.2 and I am pretty sure (though not 100%) that I've had them working with version 3.0.x also. Here is another example using std::string and std::map: #include <kos.h> #include <map> #include <string> using namespace...
by quarn
Sun Jul 25, 2004 8:16 am
Forum: Programming Discussion
Topic: problems using vector
Replies: 20
Views: 755

I just wrote a simple vector test and I didn't have to link to neither lstdc++, lstdsup++ nor lc to get it to work. For some reason I can't connect to my university website so I can't upload binaries there, but I'll give you the file here instead then: // example.cpp #include <kos.h> #include <vecto...
by quarn
Sun Jul 25, 2004 7:33 am
Forum: Programming Discussion
Topic: problems using vector
Replies: 20
Views: 755

GCC's built-in one is in sh-elf/include/g++-v3. If you add that to the list of include directories (add "-I /path/to/sh-ekf-include-g++-v3" to your CFLAGS) it might work. Chances are there will be some errors, but it's worth a try. It looks like it should work. Hmm.. those should be in th...