Which style of programming do you guys think is best
Math and Algorithm problems seem to be best left
to simple procedural or functional styles
On the other hand, I've always had the best results personally
with OOP for AI problems. Because AI problems for me atleast
tend to be hairy enough to need the OO.
In fact I usually start with simple function and procedure
oriented programming with logical packages, and move to OOP
as the project progresses. Because I always hope that it will
not get that complex.
The advantage of perl in this situation is that it is rather
easy to move a program from procedural to OOP without too many
changes at all. This is because any type can be blessed into
Another big issue for me and AI is the debugging.
Most AI programs have so many more steps in execution
that they can be tricky to debug...
I find the 'x $variable_name' perl -d option to be very handy
for exploring datastructures. And the 'b condition' to be handy
for finding buggy situations.
The perl profiler strangely enough is also a great debugging tool
for such programs, because often when you see the execution tree,
you realize that there are whole branches that are screwy or too big.