|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
Java and AI-programming
I'm interested in AI, especially now that the www is a gigantic knowledge pool. I thought I'll learn C in order to experiment with getting "knowledge" from the internet and use it in a program. However, someone told me to take a higher level language like Java, because C is for system programming. Java is very good in accessing the internet, html processing,... all things I will need. In C I will have to program everything myself. Even a string in C is actually just an array of chars (ints)...
However, as soon as I began learning Java, I had the feeling Java is too bloated. Just simply testing 2 objects for equality, forces you to write an error-prone equals method. Input and output is organized in a tremendous amount of classes: Digest Outputstream, Deflater OutputStream, Checked OutputStream, Buffered OutputStream,.... I think I won't be able to memorize the language, it's just too big. On the other hand C is smaller, but you have to write everything yourself. What's your opinion about this? Is C suited for AI-programming? Is Java better? I'm a hobbyist, not a professional, if that's relevant. |
|
|||
It is. Because you need to find something that feels/seems natural to your sense of logic such that you stick with moving forward. What we often see is people with a great deal of exuberance at the beginning fade due to a lack of a clear goal which propels them through the hills & valleys of the learning curve they need to surmount. So if C seems more natural to what you want, use it. If not, use a different language.
Java isn't the only alternative. I would suggest Python because it is devoid of a lot of syntactic clutter that bogs a number of people down. You should also consider Perl because it has a mature third-party library where some modules specifically target Web spidering. Quote:
Quote:
http://cpan.org/ |
|
|||
It depends on what you want to do with AI. There is a big difference between AI intended for scientific purposes than AI intended for games. I have more experience in game AI than traditional AI, so I will speak on that.
As for AI for games, the majority of game development is done currently in C++. You can use any language (some are certainly less ideal, though), including Java or C (two popular alternate choices for game AI). Is C suited for game AI? It is for more traditional games, like board games. For example, in my game AI class I wrote a good checkers game in C. If you are more comfortable in Java, there is no problem learning game AI in Java. The big thing is to learn the AI algorithms, with the actual language you use to implement them of secondary importance -- as it is in computer programming in general.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14) |
|
||||
I would have to second the Perl / Python bit; they are both excellent languages for dealing with the Internet and processing data. Perl is arguably one of the most expressive languages ever made (if there is anything more expressive for general programming, it would probably have to be ASM or LISP). Python can often be used to produce maintainable code that also gets the job done painlessly, although the maintainability part depends on the monkey.
Perl is however a huge language syntactically, and Python has many standard modules to choose from. Java is a very simple language to learn IMHO, but like virtually every major language -- it pays to have a "stdlib" reference on hand. With C, the UNIX manual pages serve the purpose well enough (and a few Richard Stevens books won't hurt). Python & Perl provides pydoc and perldoc respective, both with great online docs. Java is also documented online -- use the parts you need, don't worry about memorizing java.foo.bar; C is a very small language, and I know of nothing smaller... unless you want to start comparing some instruction sets & assemblers with it. If you want to study AI, rather then just explore on your own; you'll probably need to learn some Lisp sooner or later. A good way to pick up a little lisp would be to grab a copy of the Scheme standard and SICP. C often boils down to write your own or find code written by someone else; there are many great libraries (and many not so great ones) for most common tasks. The C-Strings for example, very simple and very useful, complete with many common functions0; but they are also a pain in the ass occasionally. C++'s std::string, Javas String, and Pythons str can often be more expedient -- in Perl, look for regular expressions. Every language is like that, just pick what batteries you need and learn them. Quote:
Some love C, some love QBASIC, whatever works ;-).
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Hi guys,
I think I'll follow the Python advice. Amazing how one can fetch the content of a web-page in 3 lines: Code:
import urllib fp = urllib.urlopen("http://www.google.be") s = fp.read() THANKS for the advice! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
c programming - Modules | corey_james | Programming | 3 | 6th November 2008 08:49 PM |
Learning Programming | Crypt | Programming | 35 | 27th October 2008 04:54 PM |
GUI Programming | bsdnewbie999 | Programming | 6 | 17th August 2008 12:19 AM |
C programming - Lint | corey_james | Programming | 14 | 16th May 2008 11:05 PM |
Java socket programming question | 18Googol2 | Programming | 3 | 3rd May 2008 11:50 AM |