Which programming language?

Started by Babar, Tue 26/04/2005 13:44:07

Previous topic - Next topic

Pumaman

Oh believe me, I started out using events and delegates, but it turned out to be too cumbersome for what I wanted to achieve. Events are great if you've only got one or two things to set up a handler for, but when there are 15 different events, it's much easier to just inherit a default implementation.

Anyway, this isn't a programming forum so discussing it further will only bore people, but suffice it to say when it comes to code there are several different ways that you could do any given thing, and you could go on forever saying "I'd have done this bit this way" or "That bit would be better done that way" because you'll never get everyone agreeing on what is and isn't the best way to do things.

Dowland

That's either not what I was saying, or I (really) don't understand what *you* are saying ... I could show you what I mean ... but alright, let's leave it at that.

scotch

I forgot to say, thanks, your compiler options work, and I can compile on linux now (even though it doesn't seem to have a problem running .net binaries compiled on windows, which is nice).  I'll look into delegates and stuff, although I think we'll be fine with interfaces and inheritance, the code doesn't look ugly to me.  If you want to see what we end up doing with it (and you use subversion) the source is available from svn://217.172.186.14/roger
Nothing much has changed yet, but we have plans.

Dowland

I once installed Turtoise something for SVN ... those were the dark ages, and I felt like I was invaded by this prog, that installed itself all over my Explorer ...

Can I edit the source?

scotch

If you want to, use the username: anon and the password: cowudder to commit changes but we really haven't decided properly what we're going to do with the IrcBot part, basically we want to make a fixed and tidied clone of the Roger #ags bot that we have already, plus a working user authing system for messages etc.  TortoiseSVN does invade explorer a bit, it's slightly nicer than using the command line though.

Dowland

A delegate is just a function pointer, BTW. Event structures allows you to have an event pointing to several delegates.

Einoo

Is it possible to obtain some of the programs you've made with Basic? They sound pretty cool. Of course, it's your decision as to whether anyone else can have them or not, but they sound SO COOL! [/offtopic]
Now let's find out if gasoline is flammable!

Babar

Sorry for dragging this topic up from the depths of the forums. I have a related question now:

HOW DO YOU SWITCH LANGUAGES?2??!!11

It is so aggravating to have to go through ALL the stuff I learnt in basic ALL over again. Stuff that is as simple as "Hello World" needs all that pre-program defining, stating, and that aggravating main() thing.
Another problem is that once I solved a particular problem in Basic to my satisfaction, I left it. And I solved A LOT of problems. To have to do the SAME exact things again, in a different way is aggravating.

Another problem. Scotch, I haven't been able to get SDL to work for C. It seems to be for C++. Is it not for C, or am I just not reading it well enough?

Einoo, sorry, I never noticed your request. You can check out some programs that I made (and some that I didn't) at these websites:

www.geocities.com/babarkemal
www.babar.squarespace.com

If you are REAALLY interested in stuff that is not there, I could upload some more for you.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

scotch

SDL is written in C and doesn't have a C++ interface at all, so yeah, you must be.

You need to define an entry point in most programming languages, in standard C that's the main() function, it does make "Hello World" a little larger than you'd expect... actually the whole setting things up and compiler/linker settings is what gave me the most trouble when learning C... the language is not very complicated.

What compiler/IDE are you using? Perhaps I can explain how to set it up.

Babar

#69
I am using a lil ol program called Turbo C.
I know mostly what I gotta do... before the main () thing I have to #include <blah.h> to get in the library, and #define PI 3.14 and all that.

But can you help me set up the SDL thing? I was under the impression that I would just have to copy some file to the library directory of the compiler and then do an #include <graphics.h> command in my programs to be able to use graphics. It doesn't seem to be so.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

scotch

Turbo C is an ancient DOS compiler, which may well be why SDL won't work for you... DOS isn't on the list of supported platforms, SDL was created relatively recently so it just supports modern platforms.

What I'd recommend is getting a windows C/C++ compiler and IDE, there are two options, one is getting MS Visual Studio which comes with the MS compiler.  That's probably the nicest way to develop on windows.  The other option is a GCC based compiler and IDE, dev-cpp is a freeware one that comes with everything you'll need.

If you have either of those setting SDL up is fairly easy, there are even percompiled libraries you can use.

Babar

Ok then....freeware? download link? Or do I have to buy it (isn't really a problem, just tell me)?
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

SMF spam blocked by CleanTalk