Adventure Game Studio

Community => General Discussion => Topic started by: Babar on Tue 26/04/2005 13:44:07

Title: Which programming language?
Post by: Babar on Tue 26/04/2005 13:44:07
The summer holidays are coming up, and I decided to make it my project to learn a programming language as well as I can in the time I will have.
The only programming language I know is Basic, but I think I know that reasonabely well. I've used it to make "games" like pong, tic tac toe, 2 player chess, simon says, a targeting game, and even a 1 screen birds-eye view action game. I've also made stuff like a tile drawing program, a mini banking-system, a personality generator, etc.

The point is, that I think I've got the best I can out of Qbasic. I mean, I've seen programs on the net that have doom-like 3D (raytracing? raycasting?), use of mouse, etc. but either they are too mathematically complicated, or they use assembly.

Can anyone give me advice on what programing language to learn? I am hoping that Basic will give me a nice starting point so that I don't have to relearn the ENTIRE language all over again. I've got a free compiler of C on the PC, and even have a 2nd hand tutorial book, but I could not find anything about graphics in that. Does that require a seperate library? I want to be able to make nice (flashy  ;D ) games, so I want there to be something with graphics, but I am not ONLY going to make games.

Or should I try something completely different, and have a go at object oriented programming? I know next to nothing about this, though. How does it work? Will I be able to make stuff like I was doing before?

Thanks in advance.
Title: Re: Which programming language?
Post by: 2ma2 on Tue 26/04/2005 13:52:33
I think C++ is the way to go. Not that I have any particular programming experience, but C is the base of every much all other systems out there.

..oh, and Qbasic RULES!
Title: Re: Which programming language?
Post by: scotch on Tue 26/04/2005 13:57:34
I'd recommend starting with C, it teaches you the syntax that is used in a lot of the most popular languages and also requires you to think about what you are doing when programming, having to deal with memory management and things by yourself, so you'll end up a less sloppy coder. Ã, Yes, you'd want a library to do graphics, one very popular (2d) graphics library made in C is SDL (http://www.libsdl.org/), it's probably used in most cross platform 2d games and emulators and is quite easy to use. Ã, Once you understand C fairly well you can get into OO by learning C++, which is essentially C with object oriented features. Ã, Worth doing because game engines are almost exlusively made in C++ these days.
At first it'll probably be quite confusing and some things might not make sense or seem useless, but after a month or two everything falls into place. Ã, If you are experienced with basic and AGS scripting you have a head start.
Title: Re: Which programming language?
Post by: jetxl on Tue 26/04/2005 14:07:49
I HATE Object-Oriented programming!
Ã,  Ã,  Ã, (http://img78.photobucket.com/albums/v297/Dycent/weblog/moppersmurf.gif)
http://www.geocities.com/tablizer/oopbad.htm
Title: Re: Which programming language?
Post by: stuh505 on Tue 26/04/2005 14:17:20
I recommend C++.  It's really just an extension of C (so I've heard, I've never tried plain old C), with more stuff added.  The basics in C++ are REALLY easy.  After that, you can learn more and more, and things may get more complicated...but it's really a choice how far you push yourself.  The wonderful thing about C++ is that anything that's anything uses C++, it's not only used to program most things, but it's the most common thing you'll use to write your own plugins etc for things, and there are so many other languages inspired by it that it will help you to learn other things as well. 

Annother possibility is C#, which is inspired by C++. but it is in many ways much easier to pick up than C++, and you can do more complicated things generally easier.  C# comes automatically with all Windows XP machines, but you can only use it on XP Machines too.

Object Oriented programming is really the only way to get any substantial amount of work done without killing your brain.
Title: Re: Which programming language?
Post by: Kweepa on Tue 26/04/2005 14:37:14
I recommend C++ too.

I started out with games programming learning C and did that for several years - I built up a big internal resistance to C++, which was a bad thing. Writing games code in C gets very ugly and ends up half-faking a lot of C++ features.

As for C#, it's great for tools and I think eventually it will be at a games-writing level, but right now there's no games library support (eg Allegro, OpenGL, etc). Admittedly C++ and C# are callable from each other but sometimes you have to jump through hoops to get it working.

C# is certainly not free with WinXP either. I think it costs about $1000 for Visual Studio .net. macs come with a free C++ and Objective C development environment, XCode - and XCode 2 is shipping with new macs when Tiger is released on Friday. That's meant to be pretty good.

I don't think there are any PC tools that in any way come close to Visual Studio. Bloodshed's is the closest I've seen, and it's a toy by comparison. But I haven't looked into that too much, so I'd love to be corrected...

Err, in conclusion, learn C++.
It's relatively easy if you know some AGS 2.7 scripting.
Good luck!
Title: Re: Which programming language?
Post by: on Tue 26/04/2005 14:47:48
I too must reccomend C++. Find a book somewhere that comes with a student edition of Visual Studio or sumin.. It's well worth it.

I am taking a class on C++ right now, and it's much easier than I thought it would be. It teaches you great programming habits because you have to account for memory management (like scotch said), well-organized code, and much more. BASIC is nice for making things quick and easy, but anything made in it is a memory hog (compared to a C++ program) and is sloppy.

I don't really know anything about OOP, because I'm still learning the C part of C++

Good luck, though. You should have fun with this.
Title: Re: Which programming language?
Post by: Abisso on Tue 26/04/2005 14:55:48
You could also try Java. It's not so different from C, but easier, from what I know. (I know Java basics, but I've got just some infos on C).
Title: Re: Which programming language?
Post by: Snarky on Tue 26/04/2005 15:29:58
C++ is really a bit of a mess as far as languages goes. A bastardization of C which violates the object oriented paradigm it supposedly belongs to by throwing in incredibly low-level concepts.

Java is a very nice language, and you can get everything you need for free (including an excellent editor, Eclipse). The latest version adds long-requested features like enums and "templates" (generics), which means it now has pretty much everything C++ and C# have, and more. The only drawback is that it's not ideal for "flashy games", though it's quite possible to use it to make them (with Java 3D and JOGL). (Apparently the Law & Order games were written in Java.)

C# is pretty much interchangeable with Java, except it's made by Microsoft. It is NOT true that it only runs on XP. You only need the .NET framework to run C# programs, which is included with XP but which you can also get for other versions of Windows, for free. In order to make C# programs, you do however need Visual Studio .NET, which can be expensive. I'd say there's no real benefit to using C# over Java.

C is also a pretty nice language, and the one used to write most commercial games. However, it's low-level compared to Java, which means you'll have to handle a lot of "irrelevant details" yourself. It also doesn't include many powerful modern features which are well worth learning. If you decide to use C, you should also get a toolkit like for instance Qt, which will make your life a lot easier (a powerful string data type instead of char arrays, just for starters).

So I would recommend C or Java. Both are relatively well-designed, elegant languages that should be easy to get into. Java is more extensive than C, and might seem daunting at first. On the other hand, C is lower-level and more closely tied to the hardware, so you will need a deeper understanding of what's going on in order to use it well. Also, to take full advantage of C you will need a bunch of libraries and toolkits that can be just as overwhelming as Java. C is oldskool, Java is more modern. Java is arguably better for general purpose programming, C is still preferred for games programming. You can get better speed with C, but only if you know how to use it well.

In the end, both C and Java would be a good choice. C++, however, I'm not so sure about.
Title: Re: Which programming language?
Post by: scotch on Tue 26/04/2005 16:50:59
If C++ violates pure OO I think that is why it is useful, C++ is C++... it's not Java or C# (which I do like to code in, but not for anything that requires great performance, such as games), it's not purely object oriented like those languages, and this is a good thing for games/speed.  For me it is like C but tidier, you can do anything low level that you could do in C, with the same low level access and performance, however with classes and inheritance and namespaces etc you can build much more elegant programs, Steve said "Writing games code in C gets very ugly and ends up half-faking a lot of C++ features.", I think that is largely true, I have much less trouble managing my C++ code, you can hide a lot of low level and confusing C code behind clean OO interfaces.  It isn't true to say that most game engines are written in C these days, C++ has been the game industry's language of choice for years, as far as I can tell, I think the last big game engine I remember being in C was Quake 3 (and I'm not entirely certain that was completely, the modding part was).  In any case the biggest few game engines around at the moment are all C++.

I learned C/C++ last year, and started fiddling with Java after that (working on the #ags IRC bot, Roger), the transition to Java/C# from C++ is very easy, I could start coding right away, and it's been a lot of fun.  C++ has most of the concepts you use in those languages.  I think if I started with a garbage collected and very high level language like java or C#, then was confronted with the pointers, memory allocation and low level stuff of C/C++ would have been tougher.

By the way, if anyone is working in C++ and wants to do 3d graphics (and see an example of some pretty good C++ code), I'd recommend OGRE (http://www.ogre3d.org), I've used it for nearly a year now, it's so nice to work with and supports cutting edge graphics features that not even the commercial games out these days do.  There's also a C# port called Axiom, I think.
Title: Re: Which programming language?
Post by: Kweepa on Tue 26/04/2005 17:06:43
Well said sir.
Ogre looks awesome. And with Novodex bindings? Woo! Good stuff.
Title: Re: Which programming language?
Post by: Pumaman on Tue 26/04/2005 17:55:19
I would recommend learning C#, as it's a very clean and nice object-oriented language. The command-line compiler is free (it's part of the .NET Framework).

On the other hand, as others have said, .NET isn't really fast enough for games, so if you're wanting to get into game programming then C or C++ is the better bet -- but be warned, they're much more complicated languages and it's much easier to make mistakes!
Title: Re: Which programming language?
Post by: stuh505 on Tue 26/04/2005 18:41:04
QuoteC# is certainly not free with WinXP either. I think it costs about $1000 for Visual Studio .net.

QuoteIn order to make C# programs, you do however need Visual Studio .NET, which can be expensive. I'd say there's no real benefit to using C# over Java.

Both of these statements are just plain wrong!

Last summer as part of my internship I learned C# and did a LOT of coding in it, I wrote an application that was used by my local hospital very successfully...and I used Notepad + the free command line compiler that comes with XP.  I have used it on many other XP computers also and there's never a hidden fee.  I found the command line compiler to be really good.

however, for C++, I like to use Microsoft Visual Studio .NET 2003, which is actually more like $2500...luckily I'm a college student so I don't have to pay that.  That said, there are many free C++ compilers, they just aren't as nice in my opinion.
Title: Re: Which programming language?
Post by: Kweepa on Tue 26/04/2005 18:51:04
Oops, my apologies. I didn't know the command line compiler was free with the .net distro.

However, I wouldn't recommend starting programming on a command line. It's a huge barrier to productivity. No autocompletion, no visual organisation of projects, no F1 for help, no "go to definition". Really, I wonder how I ever got anything done before all that stuff. Maybe I'm just lazy, but I prefer to put my efforts into creating, not looking information up and managing make files.

Cheers.
Title: Re: Which programming language?
Post by: stuh505 on Tue 26/04/2005 22:55:51
Steve, I have to disagree with your general statement about command line compilers there.

The difficulty with command line compilers arises from wanting to do complicated things, for which the command line arguments become necessary, and increasingly complicated.

Some command line compilers also do not give good warning messages.

I think the visual suites are more suited for dealing with complicated projects that might require a lot of linking, and special parameters.

However, his first programs will not involve complicated linking or arguments, and he will really only need to do "csc filename" and that's it.

The csc compiler gives really good error messages and is easy for a total beginner to start using.

Now compare this to some of the large applications...they have lots of settings, and even figuring out how to set up your project could take a beginner a long time or get them so confused that they stop trying.  for instance, in visual studio you need to turn of precompiled headers in the settings or you'll get an error when you first try to compile.  I've learned codeWarrior but after taking a lapse, I spent a few hours and couldnt for the life of me get a simple prog to compile.  Using a command line compiler you dont have to go through any "setting up the project" bullshit...so I'd recommend that for a beginner first.
Title: Re: Which programming language?
Post by: Traveler on Wed 27/04/2005 00:02:42
If I were you, I'd go with C# or C++. C++ gives you much more power and control over the computer (although most of them are possible even in C#, but with a lot of extra work.) C# is simpler (mostly because of automatic memory management and the extensive framework library) but performance of the .Net framework is waaay below the performance of C++.

There are several free C++ compilers and the .Net framework comes with a command-line C# compiler. (If you plan to do any serious programming work, command line is your friend, learn to use it.  ;) )
Title: Re: Which programming language?
Post by: Snarky on Wed 27/04/2005 01:02:52
The drawbacks of command-line compilers are only partly with the compiler itself. The bigger issue is that a text editor (whether Notepad or something like emacs) is nowhere near as good for writing programs as a proper IDE. Features like syntax highlighting, auto-complete, auto-creation of stubs, bracket matching, pop-up help and options, refactoring, outlines, hiding sections and integrated documentation makes your life so much easier that once you get used to them, you'll never want to work without. And that's not even talking about the debugger, which is a programmer's best friend.

I do think it would be a mistake to go with C#, specifically. It's not a bad language (I've actually beeen working in C# all day today), but to put it bluntly, Java is better. You can run a Java program on a Mac and on a Linux machine (and on a cell phone, with J2ME), while C# only runs on Windows. The only IDE for C# (as far as I know) is Visual Studio, which is expensive, while there are several excellent free IDEs for Java.

As for C++, I personally dislike OO violations. The power of abstractions comes partly from the fact that you can rely on them, and if you start monkeying around beneath the abstraction layer, you can never be confident that your abstractions are sound. And then you're in debugging hell. I also don't think much of the speed argument. On a modern computer, Java runs fast enough that you can do very nice-looking games indeed, especially if you take advantage of some of the special libraries.
Title: Re: Which programming language?
Post by: edmundito on Wed 27/04/2005 01:40:48
These should be your priorities:
1) Learn to program
2) Worry about making game after 1 is complete

I used to like C++, but not as much anymore because... well, some people have talked about it in some of the replies.

If you want to learn a real programming language, start out with C. Then, I guess learn Java since that's what they teach at schools now days and it's much better at OOP than C++, IMO. The problem with C++ is that you can skip the OOP, or patially use it which means you can do some weird half-assed attempts that won't teach you anything.

Now, if you want to make games, I recomend Adventure Game Studio. ;)

And about command line compiling... I could do everything that way if I wasn't such a lazy bastard. It's good to learn that stuff, though! Don't ever take cute little programs for granted.
Title: Re: Which programming language?
Post by: LGM on Wed 27/04/2005 03:06:20
Anyone know about J#?
Title: Re: Which programming language?
Post by: stuh505 on Wed 27/04/2005 03:24:54
By the way people, www.MSDN.com/library (http://www.msdn.com/library) is your BEST FRIEND.Ã,  It covers every aspect of C# that exists known to man, as well as J# and VBA, the Windows API...a fair bit of C++ and C...and so much more.Ã,  Seriously, you'll find more examples and specifications than any textbook...and any error code you get from a Microsoft compiler, you can just look it up there for a more detailed explanation and examples of code that will cause that error.
Title: Re: Which programming language?
Post by: shbaz on Wed 27/04/2005 05:18:41
My instructors all shrugged off J# and C# as petty attempts to control programming standards and OS compatibility. Am I missing something?
Title: Re: Which programming language?
Post by: MillsJROSS on Wed 27/04/2005 05:52:29
I'd go through a quick runthrough of C, learn how to structure your code so it's not sloppy, Program control, Functions, Arrays, Pointers, Characters, Strings, etc... Many of the things you learn from C will be a launchpad. You said you already have a C compiler, so why not use it? It won't get you making those games right away, but it might facilitate a better understanding of programing, and therefore help allow you to make better games.

It seems most University's will be teaching you C first anyway. After that, look at other languages and choose one that fits your needs and one that you are confortable with.

-MillsJROSS
Title: Re: Which programming language?
Post by: shbaz on Wed 27/04/2005 06:24:00
Quote from: MillsJROSS on Wed 27/04/2005 05:52:29
It seems most University's will be teaching you C first anyway.

Not true - in order to force object-oriented programming but not get too easy like Basic most use Java (including mine).
Title: Re: Which programming language?
Post by: Babar on Wed 27/04/2005 11:53:49
Thanks for all the help. Now that I've found a library for graphics (thanks scotch!), I'll look into it. Iif I ever feel restricted by C...heheh....I'll decide what to go onto.
Title: Re: Which programming language?
Post by: MillsJROSS on Wed 27/04/2005 14:02:09
QuoteNot true - in order to force object-oriented programming but not get too easy like Basic most use Java (including mine).

Unless we can find some statistics to back up either of our statements, I don't think either one of us will be able to argue our points validly. I firmly believe that most college/university computer science programs will stress that C be used first. This belief comes mainly from the chairman of my computer science department, which I have no valid reason to think he made it up, who told us just that. However, I'm not about to search for any statistics on it, so I'll just concede that some university's stress C and others Java as a first language.

-MillsJROSS
Title: Re: Which programming language?
Post by: Snarky on Wed 27/04/2005 14:12:33
Quote from: shbazjinkens on Wed 27/04/2005 06:24:00
Quote from: MillsJROSS on Wed 27/04/2005 05:52:29
It seems most University's will be teaching you C first anyway.

Not true - in order to force object-oriented programming but not get too easy like Basic most use Java (including mine).

Where I work we've been interviewing for an open position recently, and the general trend among our applicants seems to be that Computer Scientists are primarily taught Java (for an imperative language, usually along with some functional and logical languages), while Computer Engineers are taught C/C++.
Title: Re: Which programming language?
Post by: MrColossal on Wed 27/04/2005 18:13:31
Guys seriously

We all know what programming language you have to learn first and foremost

MrC++

Do to it's time distorting nature as soon as you open the editor your script is already written, the only draw back is if you don't eventually get around to writing the script you'll start a chain reaction that will destroy the universe... But a small price to pay really...
Title: Re: Which programming language?
Post by: Ghormak on Wed 27/04/2005 18:44:49
My university teaches Java in its programming courses.

I can sort of see why, it's quite easy to get into... but I'd rather have started with C++ instead, since I already had a bit of programming experience before the courses.
Title: Re: Which programming language?
Post by: Pumaman on Wed 27/04/2005 19:41:35
Quote from: Snarky on Wed 27/04/2005 01:02:52
I do think it would be a mistake to go with C#, specifically. It's not a bad language (I've actually beeen working in C# all day today), but to put it bluntly, Java is better. You can run a Java program on a Mac and on a Linux machine (and on a cell phone, with J2ME), while C# only runs on Windows. The only IDE for C# (as far as I know) is Visual Studio, which is expensive, while there are several excellent free IDEs for Java.

Having used both Java and C#, I have to disagree. C# has several advantages, such as generating an exe file rather then a load of class files, not forcing you to handle every single exception that could be thrown, "override" vs "virtual" keywords, plus other neat facilities like events and delegates that Java doesn't handle as elegantly, if I remember correctly.

C# is not constrained to Windows either nowadays, since there are open-source .NET frameworks for linux such as Mono.
Title: Re: Which programming language?
Post by: shbaz on Wed 27/04/2005 21:41:34
Quote from: Pumaman on Wed 27/04/2005 19:41:35
C# is not constrained to Windows either nowadays, since there are open-source .NET frameworks for linux such as Mono.

Interesting, anything for OSX?
Title: Re: Which programming language?
Post by: stuh505 on Wed 27/04/2005 21:58:55
Using C# it's very easy to create windows forms too.  I've only used Java a LITTLE but from my memory, C# was significantly easier to use.

And for the statistics, my college teaches using mainly C++ and Java.
Title: Re: Which programming language?
Post by: LGM on Thu 28/04/2005 02:51:05
Well... Let us not forget the BEST language to learn:

Brainf*ck (http://esoteric.sange.fi/brainfuck/bf-source/prog/99botles.bf)
Title: Re: Which programming language?
Post by: Traveler on Thu 28/04/2005 03:01:12
Also, C# (and the .Net Framework) lets you combine multiple languages. I'm not sure, how simple would that be with Java, but I suspect not very simple.

I'm working on a project where we have roughly 5000 classes (the build output is about 1200 DLLs), where about 1/3 of the code is C#, 1/3 is C++ and the remaining 1/3 is VB6. I believe it'd be quite an undertaking to do something like this in Java, but I never liked Java in the first place, so I don't really know.

C# has a lot of flexibility and the syntax is very close to C/C++. It's only problem is performance, but that's an even bigger problem for Java  :P  . (Although I was very pleasantly suprised by Firefox, I must admit.)

I'd still recommend C++, though, for one simple reason: using C++ you'll be forced to understand the hardware (at least to some extent.) That understanding is crucial to design and write good programs - if that's what you have in mind. If you just want to mess around, C# is good.
Title: Re: Which programming language?
Post by: auhsor on Thu 28/04/2005 06:37:14
I'm currently learning C, C++ and Java at uni doing Computer Science. Last year was pretty much devoted to learning the basics of C++ and all that algorithm theory stuff. This year it's been pretty full on.

C++ is nice, I like it, but that might be because I've spent the most time with it. Learning C after C++ is annoying really. The reason they teach us it is because in the real world many programs are written in C, and we will have to understand them.

Now the interesting thing here is that this year they have just made the Java subject no compulsory. I decided to take the subject as I thought it would be helpful. My experience with Java is that it's nice, and does alot of stuff good, it should only be used if you want to develop multiplatform, because thats what its designed for.

Anyways... I better get back to programming this assignment.

Oh and btw, we are using command line compilers here for all the subjects. Quite anoying, but once you get used to it, it's fine I think.
Title: Re: Which programming language?
Post by: on Thu 28/04/2005 10:44:48
Im going to say to you what my teacher said to me.
It is about the architecture of the game, not what language you use. When you know the architecture then the syntax is just words put together to make it all happens, and these words can be found everywhere, on the net and books and so on.

Of course you must use a language while learning the architecture and here is what many say, learn this, it is a good starting language. Well I don't believe in starting languages. c++ is world standard and you will probably learn alot of languages to cover all your needs.

So if you are not sure what language to pick at first then pick c++, you don't need an easier starting language as long as you work hard.


Good luck
Scanmaster_K
perVision.net
Title: Re: Which programming language?
Post by: Pumaman on Thu 05/05/2005 18:40:32
Quote from: Scanmaster_K on Thu 28/04/2005 10:44:48
So if you are not sure what language to pick at first then pick c++, you don't need an easier starting language as long as you work hard.

I beg to differ -- that's like saying there's no point learning to drive a car before driving a lorry. Sure, an HGV is more powerful than a car, but most people don't need the complexity of changing through 35 gears just to make the thing go, so the car is the much easier option.

It's much easier to make mistakes in C++ without even realising it, than it is in languages like C#. The amount of production C/C++ code I've seen with memory leaks, bad pointers and uninitialized variable accesses is quite frightening, so if you're startin off with programming, unless you have a really good reason to use it, I'd steer clear.
Title: Re: Which programming language?
Post by: BlackMan890 on Fri 06/05/2005 00:19:54
i recomennd C#
it's very easy and powerfull :)

there is a free C# compiler on the net which is very much like Visual Studio
it's called SharpDevelop (http://sourceforge.net/projects/sharpdevelop), this compiler is created with C#!! it's true and it is open source and has a very user friendly GUI :o :)

C# is very good and powerfull, you can create graphical games in C#, even 3D!!!!

If you want to program a 3d engine (in C#), you must learn DirectX, if you want to program a firewall you must learn WinSock, if you want to program sound applications, you must learn about the sound APIs.

so why dont you whip off and learn c# and create AGS-3D engine ;D


EDIT

here you can find many articles about C# programming (http://csharp-home.com/index/tiki-page.php?pageName=Categories), go to Beginner. Good luck :)
Title: Re: Which programming language?
Post by: monkey0506 on Tue 24/05/2005 22:09:15
I just searched for C# (C-Sharp?  WTH?  I thought it was C-Number.  It's an even dumber name than I thought), and I don't think I'll be rushing off to use it.  I've learned enough about C++ to know how to handle myself just fine in it.  I can't write an Windows Apps ATM cause the crappy book I'm using doesn't cover them (it's too old) but it's fine.  And I must say, IMO, compiled languages are much easier to use than interpreted languages (in regard to Java (which is interpreted isn't it?  otherwise why doesn't it produce an executable file?)).  True, I admit, interpreted languages are easier to port, but egads...
Title: C#, the facts
Post by: Dowland on Thu 26/05/2005 15:41:38
I'm pretty biased when it comes to C# ... so perhaps take this post with a grain of salt.

C# is an programming language created by Microsoft to counter the popularity of Java (which is copyrighted by Sun). To make sure it would be likewise popular, and to avoid the “Microsoft is taking over” syndrome, Microsoft released the full specification as ECMA 334 (http://www.ecma-international.org/publications/standards/Ecma-334.htm) (for instance, JavaScript also was standardized as an ECMA specification).

Furthermore, Microsoft released the entire source code to its framework (well, to the core framework), everything that was a part of the C# language (source code of the compiler). This was called the Shared Source CLI (for Common Language Interface), codenamed Rotor (http://123aspx.com/rotor/). The code is available at several places on the Internet, and it is basically the source code of ALL the base classes of the .Net framework.

This uncharacteristic generosity (which was motivated, of course, by the desire to make C# more successful than Java) spurred several open source, clone implementations of the .Net framework. I know of two definite ones, and the most popular is of course Mono which is a surprisingly GREAT port.

Mono (http://www.go-mono.com/) supports everything of the current implementation of C# (1.2), and of the Forms namespace (using gtk# on Linux) and is available on (to name a few): Linux, Windows, OSX, BSD, Solaris. This means you can write one application, and just port it by compiling it with Mono (without applying any change whatsoever).

I've written an IRC application which I was able to compile on a Linux remote 100 MBit server without any problem at all (I have only tested Mono on Windows and Linux though).

In the way of documentation, you can't beat the MSDN.

For IDE, you have several choices. SharpDevelop (http://sourceforge.net/projects/sharpdevelop) is one of them, and it's very close to the real McCoy (VS.NET) ... but it only works on Windows. MonoDevelop (http://www.monodevelop.com/), while it does not the Form Designing extravagant tool of SharpDevelop, has (almost) full syntax completion, and works on all operating systems where Mono works.

Those are the main two. For a complete list of all available free C# IDEs (http://csharp-source.net/open-source/ides) (three others are available there).


Finally, we get to the core subject. The language itself.


C# is a powerful language that is getting increasingly powerful (with the advent of definition-less delegatesâ€"which are the C# equivalent of function pointersâ€"and GENERICSâ€"which is literally the dream of a lot of programmers).

It's main advantage is that it is very elegant and coherent (you don't have to guess whether a word is uppercase or not, etc.) ... it has a consistent style, and doesn't feel as makeshift as Java.

It's power lies in the fact that unlike most other languages, it is *very* strict. This makes error fewer (because it won't compile if you do something it knows is going to fuck up your program). Also, it's garbage collection is very powerful (and some very rare times, a nuisance), and it will make sure you never have to worry about freeing up memory or correct pointers. (Though pointers aren't gone, they just are much more efficiently managed).

The .NET framework (of which, again, you can see the source code) is also a very powerful tool. Unlike Java, where you never know if the size of an Array-type object is "Count" or "count" or "size" or "Size", "length" or "len", here everything is object-oriented and coherent.

All classes are built from the base Object class. Then all container classes are built using interfaces. All classes have a base class (for instance, there's the base Stream object and then FileStream, NetworkStream, NullStream, MemoryStream, etc. which all inherit from Stream).

In short, it makes code so much easier to maintain. I haven't had any big projects in some time, but a year ago, a 80000+ lines of code (the source code totalled to 7 MB, which, to me, is a great pride!) were, I find, much more manageable than the same thing in C++ or Java.


Finally, for your SPEED and EFFICIENCY troubles ...

... I have to admit that .Net applications are usually undeniably slower than C/C++ applications. However, if you use bad algorithms for stuff like pathfinding, it won't matter what language you use.

That, and another thing ... computers tend to be INCREASINGLY efficient and fast everyday ... the reason Microsoft is betting on .Net and returning to CLI-type programming is because it won't be long before it doesn't matter (which is why 1/7th of WinXP is written in a light form of the framework).

Also, you can most likely get speed increases by A) writing uncluttered code (which is facilitated by C#), B) using a profiler, C) jitting your programs before distribution (transform the bytecode into native code using jit).





That is, what programming language to use if you want to do something ... honestly, if you just want to get bases, I suggest C. You can to USACO.org, for instance, to participate in (easy) contests, and develop your sense for algorithmic programming (what really matters in the long run).
Title: Re: Which programming language?
Post by: Pumaman on Thu 26/05/2005 22:49:24
I agree with much of what you just said.

When .NET first came along, I was quite hostile to it, seeing it as a cheap tactic by Microsoft to try and get rid of Java.

But having used C# for a while, I've come to appreciate just how good it is as a language, along with the .NET framework as a library. The one major missing thing is templates (generics), which will be fixed in VS 2005, and I have to say they've done a really good job so far.

The one thing that does bug me is the whole .NET DLL versioning stuff, which was touted as the solution to all COM's problems, but in fact ends up having loads of issues of its own. That aside though, it's a great language.

Title: Re: Which programming language?
Post by: LGM on Fri 27/05/2005 02:47:15
I'm deciding if I want to stick with C++, learn C# or Java. I would like to create open-source programs in the future that could be ported easily to other platforms...
Title: Re: Which programming language?
Post by: scotch on Fri 27/05/2005 10:14:22
I'd learn C++ first, once you know that you pretty much know all you'll need for a smooth transition into Java and C# (the opposite is not so true, imo), took me a few days to get used to Java after coding C++ for a year because it's basically C++ minus the complicated parts, with a very nice and easy to understand standard library (And Java to C# is even easier).  Out of C# and Java I'd say Java is best for cross platform development, there's a JRE for basically any platform you'd want to develop for, and you don't even need to recompile your code to run it on another platform.  I'm currently trying to get a C# app working on a linux server, and I can't even work out how mono (open source .net implementation) works on windows, can't compile a thing so far, at least once I've worked that out it does seem to be quite mature from the documentation, it does require at least a recompile of your programs though.
You won't want to know just one language, which ones you end up using will depend what you are doing, different languages are useful for different purposes, an IRC bot is something that Java would be perfect for, C# is a well designed language, good for tidy development of windows GUI apps, C++ is great for game engine development, C is perfect for writing a cross platform codec library in, assembly is nice for putting inline into your C++ code for fast hand optimised loops, I'm not particularly attached to any one of them, they're all useful languages.  Once you know one it takes very little time to learn another.
Title: Re: Which programming language?
Post by: Dowland on Fri 27/05/2005 11:35:11
I discourage anybody from starting programmation with C++. It is true taht once you have mastered C++, going to most other languages is pretty easy ... but in essence, the contrary is also mostly true (what you learn, is how to think in the terms of the computer, then learning new keywords is run of the mill).

However, I believe C++ to be the hardest to get something out of. It's not hard per se, but it is hard to do something tangible. It's FAAAAAAAAR (Pluto<->Sun distance far-like) from being rewarding in the short term, and I am almost sure, that if you plan this as a summer project (2 months?) you'll most likely become disgusted by the difficulty.

Again, C# will easily allow you to make GUI applications, with some you can touch, and feel.

Or if you want to start with a non-interpreted language, C is the way to go. C introduces you to all the problems of memory, pointers, and the habit of syntax, while not going overboard with all the OO stuff (C++'s operators can be endlessly confusing, between ., ::, ->, etc.)

If you want to learn C, look for ALGORITHMIC tutorials. Why? Because they don't require you to learn the fancy pansy stuff that requires a library. You can do algorithmic programming with just the standard library and the most simple, most BASIC programmation keywords.
Title: Re: Which programming language?
Post by: LGM on Sat 28/05/2005 05:19:52
Well, I'm already learning the basics of C++, and I started with VB so don't worry about that.

I just was wondering if I should learn Java or C# first. I'm an advocate for cross-platform programs, so it sounds like Java would be easier to do that with
Title: Re: Which programming language?
Post by: Dowland on Sat 28/05/2005 06:50:41
For C#, recompiling on any platform with Mono is a matter of "mcs mysourcefile.cs" ... I think you'll handle it fine.  ;)
Title: Re: Which programming language?
Post by: juncmodule on Sat 28/05/2005 08:41:51
So, I've been "trying" to learn C++ for about 5 years now. I understand a great deal of the concepts but haven't really been able to put anything to any kind of use. I just lack an understanding of enough to really do anything with it.

After reading this thread I got a C# book from the library and downloaded SharpDevelop. I must say, I'm pretty impressed with the layout of the program and the layout of the language. It appears to be enough like C++ that what I have learned so far is not wasted. I like the idea of it being very strict syntax. I really do hope it is an easier language to learn.

I guess my biggest problem with learning to program is that I only want to do it as a hobby. I have no intrest to do it as a living. I also don't have anything practical to work on. Sure, I would love to build my own software synths, samplers, write super programs to help people make games, and even write games themselves. That is all way above what a begining programer can do. So, what the heck are you guys doing with all of this? I mean, what is your immediate goal with the language? Or are you just learning it for fun or just to learn it. Those of you that know some languages, where did you start? I've read that Tetris and pacman are good games to start with (practice with collision and AI). But what if games isn't all I really want to do? Any suggestions?

So, Chris, is your job where you are getting the exposure to C# or are you rewriting AGS in it? Sorry, been out of the loop if this is already well known.

By the way. In regards to starting programming. AGS really taught me a lot about programming. I felt like I could see results much more quickly too. I wish there was a similar environment to learn other languages in. With the recent changes to AGS I'm really excited to get back into things and learn it all over again.

later,
-junc
Title: Re: Which programming language?
Post by: Dowland on Sat 28/05/2005 14:25:57
Ah yes!

The “goal” is a big problem of hobbyist programmers.

I find that when you don't have a goal, you just rot.

Also I find that when you don't have a well defined, you tend to drift, and get easily frustrated.

In addition, I discovered that when you have a clear, focused idea of what you want to do (and that idea isn't a general “I want to make a program to solve world hunger”, but rather, “I want a program that can lookup cheapes prices for food through Google”) ... it's a lot easier.

I've been working on network programming for years. At the beginning, it was very amateur. But soon, I had kept wondering how to control the packet flow, how to establish serverless connections, etc. And then I got to analyzing protocols, and reverse engineering them (that's how you learn how to write Telnet, etc.) And then you discover RFCs and then you eventually need to write one.

Since a short period of time, my goal was to write some project on IRC for file sharing ... and I just started writing. Because I had a clear idea of what I wanted to do, I built my classes in a very structured way. Because of the way C# is, building over and over and over is very easy, and my project just keeps getting bigger and bigger (and there are no bugs along the way).

But I don't think I would ever have gone this far without a project (and it wouldn't have been as much fun).
Title: Re: Which programming language?
Post by: LGM on Sat 28/05/2005 17:30:59
So C# it is, eh?
Title: Re: Which programming language?
Post by: scotch on Sat 28/05/2005 17:47:55
It really doesn't matter, imo, they're virtually identical as far as I'm concerned, if you can code one you can code the other.  Someone will probably post with a huge list of differences, but honestly I didn't have to read a thing when starting to mess with C#, I just do a quick google now when something unfamiliar pops up.  C# seems a slightly nicer language, possibly, they're about the same as far as ease of learning goes.
Title: Re: Which programming language?
Post by: Dowland on Sat 28/05/2005 18:06:03
lgm, I use C#, and I've had to use Java. A few reasons why I don't like the latter have nothing to do with the speed or quality of the libraries, etc.

1) C#'s syntax and keywords, and .NET framework classes' properties and methods have been streamlined. In Java they are not. Java gave me the impression that a whole bunch of programmers had different ideas of what the syntax should be, and just put all their ideas together. As I said before, let's take the "size" for example (in Arrays, Hashtables, Dictionaries, FileStreams, etc.)

While in Java the keyword is sometimes a property named "count", sometimes a property named "length", "len", or "size", ... or even perhaps it could be "getLength", in C# the property to access a size of a dynamic object if always "Count". (And this make it easier).

In a nutshell, I find C# prettier to write and to look at (and for me, that's a big criterion).

2) Java's compiler errors are a *lot* less helpful I find (Microsoft made a special effort to make their errors and warnings very descript), and sometimes make no sense at all (for example, Java requires to catch errors if they MIGHT occur) ...

3) Java wants you to create a new source file for every class, and that the filename of your source code must be exactly the name of the class it defines ... which while it might make sense, isn't practical (it's too artificial a convention to be really helpful, and it turns out to be annoying).

4) While Java doesn't require a recompile, the compilation, as I said, isn't much effort. I also feel like the .NET CLI is faster on Windows, and that this is due to get even more true as time passes (because Microsoft is dead set on supporting this baby, and tinkering it to death to make it more efficient than the Java VM).

5) Whereas Java's windows feel very much like Java, the Mono ports of the Windows namespace uses gtk to give the programs a better feel under Linux (as well as Windows).



BTW, what scotch says is absolutely true. Knowing how to code C#, is knowing how to code Java, and vice-versa (though I find C#, from the naming conventions I talked about above, to be a bit easier).


Also, something I learned only after starting to use C# ... but it's VERY useful to have Rotor under hand, to check for some free code snippets.
Title: Re: Which programming language?
Post by: LGM on Sat 28/05/2005 18:23:44
I'm sold! You've been very helpful, dowland (scotch, you smell ^_^). When I need help I'm coming to you.

Thanks for your input (even though I didn't even start this thread.)
Title: Re: Which programming language?
Post by: scotch on Sat 28/05/2005 18:31:17
Could you tell me how to compile something on mono then? I have an ircbot framework (intended to replace the old AGS Roger bot code) which CJ developed in Visual Studio, and I can't for the life of me work out how to get it to compile on mono.Ã,  There is no documentation anywhere.Ã,  I'm almost ready to port it back to Java (I disagree with most of your criticism, actually, I think it's just a case of which one you're more familiar with, most stuff you don't like in Java makes perfect sense to me, just like Java looks prettier to me.  Not really interested in arguing over which languages are best though, they're all so similar.)
There's a VS project to makefile converter, but how I use the makefile that comes out, I have no idea.Ã,  Compiling the .cs files one by one with mcs doesn't seem to work at all.
http://www.adventuregamestudio.co.uk/ircbot.zip code here, if you feel like taking a look...
Title: Re: Which programming language?
Post by: Dowland on Sat 28/05/2005 19:05:33
You want to compile this on Windows or Linux?



EDIT: "C# .NET IRC Framework v0.1 by Chris Jones"

Hey! I didn't know good old CJ (somehow I can't help think of the press secretary nowadays) was tinkering in C#. Boy was I gone a long time.


... Brrrgg ... this code is ugly. No wonder you prefer Java! You're not taking advantage of C#'s extras!!!
Title: Re: Which programming language?
Post by: scotch on Sat 28/05/2005 19:27:08
Linux (or both, would be nice), we can compile on Windows with Visual Studio, but we have a linux server to run it on.
Title: Re: Which programming language?
Post by: Dowland on Sat 28/05/2005 20:00:55
Well the tough part is to manage to install Mono, because it needs packages which are sometimes not pre-installed on most "dedicated servers".

I do not have a Linux system under hand ATM, but this works fine on Windows:

mcs /target:winexe /out:CJBot.exe /nowarn:168 /nowarn:169 AssemblyInfo.cs Form1.cs Core\DefSinkImpl.cs Core\EventSinkProxy.cs Core\HelperFunctions.cs Core\Interfaces.cs Core\IrcClient.cs Core\UserAdmin.cs Plugins\ChannelControl.cs Plugins\FactStorer.cs Plugins\GenericResponder.cs Plugins\Googler.cs Plugins\Peak.cs Plugins\TellMessages.cs Plugins\WorldTime.cs -lib:"C:\Program Files\Mono-1.1.7\lib\mono\1.0" -reference:mscorlib.dll -reference:System.dll -reference:System.Windows.Forms.dll -reference:System.Drawing.dll -reference:System.Data.dll -reference:System.XML.dll


Run that from the Mono Command Prompt.

(Of course, you'd change the path of -lib)


... and do you really need a form?
Title: Re: Which programming language?
Post by: scotch on Sat 28/05/2005 20:23:16
No, we were going to remove the form.  CJ put it in but we'd be administering it through the console remotely anyway.  Thanks, I'll try it :)
Title: Re: Which programming language?
Post by: Dowland on Sun 29/05/2005 15:35:26
@ scotch : Well, I was telling you about the Form, because it's just adding links you don't want to have unless their necessary (Windows.Forms namespace, etc.) Furthermore, at this point, GUIs are the only thing that can potentially cause a bit of trouble when cross-platform compiling so ...

How about adding a Telnet interface?


I hope you'll let me know how it goes.


@ lgm : Glad I brought you to the dark side  ;D ... be sure to ask for help if you need it (also CodeProject http://www.codeproject.com/csharp/ is a very helpful site).
Title: Re: Which programming language?
Post by: Dowland on Sun 29/05/2005 20:54:19
Quote from: Pumaman on Tue 26/04/2005 17:55:19
I would recommend learning C#, as it's a very clean and nice object-oriented language.

Ooh ... I didn't see that someone had summarized my thoughts in a line (*sigh*  :o My thoughts can be summarized in one line?!!!)
Title: Re: Which programming language?
Post by: Pumaman on Mon 30/05/2005 15:20:50
Quote from: Dowland on Sat 28/05/2005 19:05:33
... Brrrgg ... this code is ugly.

...ergo the reason why AGS is not open source :D
Title: Re: Which programming language?
Post by: Dowland on Mon 30/05/2005 17:59:13
I mean, it looks like C written in C# : scotch (or CJâ€"I didn't quite understand *who* wrote that bot) doesn't take advantage of any of the “features” of C# sturdy syntax and OO model. Where are the Events? the Delegates, the Properties (with Getter and Setter) ? where's the hierarchy (I mean, OK, the sink thing ... but it could've done so much better with delegates) ?

I wonder what AGS would be in C# ... probably much easier to maintain (for instance, the text script could be ipso facto implemented, thanks to the internal compiler classes).
Title: Re: Which programming language?
Post by: Pumaman on Mon 30/05/2005 19:11:22
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.
Title: Re: Which programming language?
Post by: Dowland on Mon 30/05/2005 19:45:25
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.
Title: Re: Which programming language?
Post by: scotch on Mon 30/05/2005 20:28:16
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.
Title: Re: Which programming language?
Post by: Dowland on Mon 30/05/2005 21:46:54
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?
Title: Re: Which programming language?
Post by: scotch on Mon 30/05/2005 21:54:28
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.
Title: Re: Which programming language?
Post by: Dowland on Mon 30/05/2005 22:00:48
A delegate is just a function pointer, BTW. Event structures allows you to have an event pointing to several delegates.
Title: Re: Which programming language?
Post by: Einoo on Mon 30/05/2005 22:14:24
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]
Title: Re: Which programming language?
Post by: Babar on Wed 13/07/2005 21:53:03
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.
Title: Re: Which programming language?
Post by: scotch on Thu 14/07/2005 11:18:26
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.
Title: Re: Which programming language?
Post by: Babar on Thu 14/07/2005 11:48:02
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.
Title: Re: Which programming language?
Post by: scotch on Thu 14/07/2005 15:38:16
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.
Title: Re: Which programming language?
Post by: Babar on Thu 14/07/2005 21:38:51
Ok then....freeware? download link? Or do I have to buy it (isn't really a problem, just tell me)?