Programming

MajorGeneral2

Just happy to be here
Joined
Jan 21, 2002
Messages
612
Location
Dixie
I'm interested in programming. My reason is entirely just for my own entertainment. I have some knowledge as to how programming languages work. Any suggestions? I seem unable to find anything that does what I need. That is, accept user input, and simple animations, music, sound effects, and be FREE. Preferably including a manual or tutorial so I could actually learn the thing :rolleyes:
Thanks.
 
I'm still a little unclear what you're trying to do, but if you want to learn programming, I'd start with a language that is readily usable. Here is one that is free: MS Visual Basic 6. The books like "Sam's Teach yourself Visual Basic 6 in 24 hours" include a the MS VB program on CD for free (subject to a certain limitaion or two). C++ is another one. But I'm more of a practical person; there may be other "simple" starter languages, but I just don't use or know about them. :)
 
PM CornMaster, he is a VB programmer. I have heard that VB is a pretty easy language to start with.
 
Yes, I agree.... VB is easy to learn, esp. with taking it in simple steps, as guided by books like the Sam's series. Also, Cornmaster is really good at VB and can help a lot. The still visits this BBS, but he has a tech forum set up at Gamecatcher and presumably would see a post there right away. :)
 
And instead of those "languages", I´d suggest Java or C++ to start. They probably have the most potential and the broadest and best documention everywhere around.
You can solve almost any problem without going too deep into real programming. Many interfaces and classes are already freely distributed, so it´s not too big of a problem to create a great program.
And you will be using a REAL programming language.
:D
 
I mostly agree with Lucky (not about the ++ thingy, though ;) ).

My 2 cents... I suggest you start programming using DOS tools. Normally, I would suggest MS QBasic to start with, since you probably have it if you use Windows, but your age suggests that you could start off with Pascal. Most people I know (that have started at your age) started with Pascal and then (not necessarily) made a transition to C.
 
Thanks, everyone. Essentially, my purpose is to make games. My main question is "What is a good Freeware language and where can I get it?" C++ is out, because, IIRC, it costs money, I can't find a good site offering Pascal, and other languages either cost money to get the compiler, or don't offer the functions I need. But, then, perhaps the difficulty just comes out of a bad search engine. ;)
 
C++, the language itself, is free. What you see people charging for are the compliers and editors and debuggers. If you live near any Office Depots, Office Max, or Staples go into the store and look in there computer programs section. A lot of times they carry some old MS Visual C++ (like 4 or 5 and maybe even 6 soon) programs for $25-$40. I have also seen Visual Basic sold for cheap also. They were in yellow boxes but I cannot remember what company was selling them (it wasn't MS).

The are also free compliers and editors online. Do a search on "Free C++ Complier" that should give you a few hits. Unfortunately they aren't as user friendly as the non-fre products.

Also, you could always type a program in wordpad or notepad. You would still need to debug it and compile it though.
 
http://www.delorie.com/djgpp is a freeware C/C++ compiler. It is a port of the Linux GCC. It also includes an IDE (Integrated Developement Environment, you can call it an "editor") called RHIDE which is buggy, but will run properly under Win9x systems. I personally do not use the IDE, but write in an editor (joe) and compile from the command line.

http://www.freepascal.org/ is a freeware Pascal compiler available both for Windows and Linux systems. It also includes its own IDE, which is even buggier than RHIDE, but still usable under some systems. When in need of Pascal, I also program using an ordinary editor and the compile the program from the command line.

Both of these are "new-generation", free 32-bit compilers and used very widely.
 
You can get the GNU C/C++ compiler for free. It's available for both Linux and Windows (as well as a host of other platforms)

The Simple Direct Media Layer (SDL) is a free, cross platform toolkit for writing games using C/C++.

If you want to try something easier, try the language Python. It's free, easy to use, and a *great* language to boot. It has a free library called PyGame, which can be used to write games in. Python also integrates very well with C and C++, so you can write the speed-critical parts in those languages.

I would certainly NOT recommend books by Sams publishing on C++. Get a real book, like The C++ Primer by Lippman, or The C++ Programming Language by Stroustrup.
 
For games programming, C++ and Java should be the main choices. :yeah:

The Java runtimes can be downloaded from http://java.sun.com .
For free! And free software like editors and development kits are also available everywhere.

My tip for a free C++ development kit is Bloodshed DevC++.
Download at http://www.bloodshed.net/devcpp.html .
They also have other free compilers, including Pascal. :goodjob:

Concerning documentation, there are really great ones floating around the net. But also many great books, especially for Java.
Most of those documentation are also listed somewhere on the sites above.
:D
 
I am yet to see a serious game written in Java.

Further, I think that the Java language is badly mis-designed. Its type system is stuffed up very badly, and it is simply lacking in the powerful features that makes C++ great. Its one redeeming feature is static exception specification checking; but that's not near good enough to bring it in line with C++.
 
Oh goodie, a programming language fight!! *jumps up and down with glee*

Eh.. ok, for real now .. :)

For learning programming, including OO concepts and to in general get the hang of what "programming is like", I would recommend Java. It has the benefit of being a "real language", and besides I do consider it to be the most elegant general purpose language around... in this, I would strongly disagree with Sirp. Of course, Lisp is THE language, but it's not really something you'd use for everything you do...

C++ is something I touch only when I must. That is, when I need to do platform-specific, really, really quick code. They say that C++ gives you all the rope you need to hang yourself, and they're so right. C++ is powerful for sure, but in elegance and having a good core set of features, Java wins hands down.

I think the only thing Java could have that it doesn't is templates, but I'm not sure...

Btw, I don't want to be a spoilsport, but "I want to make games" is what most programming newbies say... and then they realize that games programming is one of the most demanding fields in software development... it's not something you just start to do as your first thing, unless the games you have in mind are something akin to Minesweeper or Tetris.

EDIT: *nngh*, sorry for responding to a year-old thread, didn't look at the dates...
 
That's okay: a year later Java still sucks :-)

When I programmed in Java, it just made it incredibly irritating to do all the things you typically want to do in a program. Say you want to store a whole heap of integers, in a long list, populating the list and then perhaps performing operations on it. To create the list, in Java, you go,

ArrayList mynumbers = new ArrayList() ;

In C++, for instance, it's,

vector<int> mynumbers;

Not so bad either way. To add the number '5' to the end of the list, in Java it's,

mynumbers.add(new Integer(5)) ;

Which is starting to look a little awkward. This is due to the inelegance of primitive types not being treatable as objects, so it has to be 'wrapped' in this Integer type.

In C++ it's as easy as one could expect:

mynumbers.push_back(5) ;

C++ also has better type checking here. In the Java version you could accidentally add something which isn't a number to your list of numbers, and then later on, boom. The C++ compiler will guarantee that you really do add an integer to the list of numbers.

Then we come to the real killer when you want to get, say, the 3rd number back out of the list again, in Java it's,

((Integer)mynumbers.get(2)).intValue()

While in C++ it's,

mynumbers[2]

You call a language which requires the above construction just to get a number out of a container 'elegant'?

Of course to make your code truly robust in Java, you are going to have to catch the bad cast exception that could occur if the object in the container isn't really an Integer. (Of course, you can just write your code asserting that your container always has only Integers in it, however either way, it's more burden on the programmer). C++ will guarantee that the container only ever contains ints.

This kind of horrible casting everywhere is the anti-thesis of 'elegance', and was horribly irritating when I had to program in Java, and is horribly irritating to me now that I have to program in C# (which is very similiar to Java, but worse, because it leaves out Java's only mildly redemptive feature).

Then there's the way Java (mis)uses exceptions. It's a nice feature that Java has well-defined behavior on an array-out-of-bounds error. The problem is what that behavior is: anytime I make such a programming error, I want to get an immediate assertion failure of some type, hopefully with a nice stack trace. Instead Java throws an exception.

Why would someone want to throw an exception on a programming error? Exceptions are useful if you are going to handle an error and perhaps recover from it. If your own program has a bug in it, there's no way you can gracefully handle it or recover from it. Exceptions are useful if your database fails, or if your network connection dies, or the system runs out of memory, or the user enters bad input. They are not useful if your program has a bug in it. Why the Java designers think they would be is beyond me...

Further, making your program exception-safe in Java is a nightmare. I have frequently had to have nested try...catch...finally blocks to do it, and verifying that all possible code paths will satisfy your desire exception-safety requirements is very difficult. Further, since so many things can throw exceptions in Java, guaranteeing transactional exception safety semantics (i.e. if a function throws an exception then it will leave the program state otherwise untouched) can be very difficult.

As an example, suppose you have a function which is going to call three operations: op1(), op2(), and op3(). Each of these operations will throw an exception if the operation fails. If an operation fails, you want to ensure that your function exits with none of the operations having completed. You have the functions op1Rollback(), op2Rollback(), and op3Rollback() which can rollback an operation that has been done. Doing this in Java requires nested try...finally blocks. It can be implemented in C++ without any try blocks at all, and with lots less headaches for the programmer.

That's not to say C++ is the greatest programming language either. It has issues, big issues. Its difficulty to learn being the most prominent. Its undefined behavior and inconsistent implementations also being severe problems. It is elegant in some parts, but ugly in others.

The only truly 'elegant' languages I have used aren't used nearly enough in practice - languages like Haskell and Lisp.

-Sirp.
 
Originally posted by HuckFinn
Btw, I don't want to be a spoilsport, but "I want to make games" is what most programming newbies say... and then they realize that games programming is one of the most demanding fields in software development... it's not something you just start to do as your first thing, unless the games you have in mind are something akin to Minesweeper or Tetris.

EDIT: *nngh*, sorry for responding to a year-old thread, didn't look at the dates...

Dates oversight forgiven;). You're right about newbie programmers, but let me mention that I'd made text adventures before when I posted, and have moved on to a graphical interface.
 
I think if you want to program games, it's a good way to get started in programming. Programming tedious things will get you very bored of programming very quickly.

Shameless plug: Try the game I've written (yes in C++) - http://wesnoth.whitevine.net

-Sirp.
 
About this kind of thing:

Originally posted by Sirp
the list, in Java, you go,

ArrayList mynumbers = new ArrayList() ;

In C++, for instance, it's,

vector<int> mynumbers;

Not so bad either way. To add the number '5' to the end of the list, in Java it's,

mynumbers.add(new Integer(5)) ;

Which is starting to look a little awkward. This is due to the inelegance of primitive types not being treatable as objects, so it has to be 'wrapped' in this Integer type.
-Sirp. [/B]

You might want to check out the new features of Java 1.5 (Tiger) which is in the making now. It has auto-boxing/unboxing features and much more.
 
I don't want to sound cynical, but I have long refused to discuss or compare the features of the 'next version' of languages. Every language advocate can talk about how in the 'next version' or 'in development' there are the latest and greatest cool features which solve all of a language's problems.

I could go on and on about how cool the latest features in Boost are that are set to be standardized in the next revision of the C++ standard. Java has had talk of addition of almost every feature that is in C++ for years now. Perl 6 sounds like it'll be very cool when it comes out. Microsoft is talking about adding generics to C#/.Net.

Who really cares? I will talk about languages when they are done, and when I have had a chance to use them and see how good they are. I refuse to talk about features that are 'coming soon' to a language. Every language has the latest and greatest features coming to it soon...

-Sirp.
 
Back
Top Bottom