Which programming language?

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

Previous topic - Next topic

shbaz

My instructors all shrugged off J# and C# as petty attempts to control programming standards and OS compatibility. Am I missing something?
Once I killed a man. His name was Mario, I think. His brother Luigi was upset at first, but adamant to continue on the adventure that they started together.

MillsJROSS

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

shbaz

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).
Once I killed a man. His name was Mario, I think. His brother Luigi was upset at first, but adamant to continue on the adventure that they started together.

Babar

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.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

MillsJROSS

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

Snarky

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++.

MrColossal

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...
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Ghormak

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.
Achtung Franz! The comic

Pumaman

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.

shbaz

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?
Once I killed a man. His name was Mario, I think. His brother Luigi was upset at first, but adamant to continue on the adventure that they started together.

stuh505

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.

LGM

Well... Let us not forget the BEST language to learn:

Brainf*ck
You. Me. Denny's.

Traveler

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.

auhsor

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.

Scanmaster_K

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

Pumaman

#35
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.

BlackMan890

#36
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, 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, go to Beginner. Good luck :)
Jonatan Nilsson
860 Iceland

Please go to www.simnet.is/elinnils52 and download my non ags/adventure game :)

monkey0506

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...

Dowland

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 (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. 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 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 is one of them, and it's very close to the real McCoy (VS.NET) ... but it only works on Windows. MonoDevelop, 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 (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).

Pumaman

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.


SMF spam blocked by CleanTalk