Quote Originally Posted by SilverWarior View Post
So why don't we alow him first to prove himself solving a real problem in practise and only then judge him.
I will present problem below (the problem can be easily solved using OOP aproach) and I hope Jimmy would be so kind to take some of his time to show us how he would solve it. Maybe we will even learn something from him. Isn't that the purpose of our comunity - to learn.
Now Jimmy if for some rason you don't want to publicly participate in this I still hope that you take some time and send me solution for the problem below using your approach. I would realy like to see how it can be done in procedural way becouse I cant imagine how myself. Maybe I will learn something.

The problem is as folows:
Lets say you are creating a strategy game. In this game there are several different unit types. Your goal is to write a code wich will define these unit types as specified below.
For the sake of simplicity lets say that the gameworld is respresented with two dimensional array (tiles). These are defined like so:
0 for unpasable terrain
1 for land terrain
2 water terrain
3 for deep water terrain

Unit types are like this:
1. Land unit capable of atacking other land units
2. Land unit capable of atacking air units
3. Air unit capable of atacking other air units
4. Air unit capable of atacking land units
5. Air units capable of atacking submersible units
6. Naval units capable of atacking other naval units
7. Naval units capable of atacking submersible units
8. Submersible units capable of atacking other submersible units
9. Submersible units capable of atacking naval units
10. Submersible units capable of atacking land units.

Your code also need to make sure that these units can move properly (prevent ilegal moves)
1. Land units can move only on land
2. Naval units can move only on water
3. Submersible units can only move in deep water when submerged
4. Air units can move anywhere

Naturally each units have his health so this should also be covered in your code.

If you wish I will show you all how I would solve this problem myself using OOP aproach. I could also try to explain the benefits of using OOP in this case.
I think this is a wonderful idea!

Actually, I recently proposed a slighly similar student project, although geared towards comparing languages. Same idea, stop bickering and get down to the facts, write some solid code for each case and compare, as objectively as possible (pun not intended). But your description goes a good step closer, by specifying pretty well what it should be, I like that. Maybe we should make a common base of graphics and sounds? And map? Same size, same data.

The big question is whether this is the right problem, but maybe it is. A few rules are missing though: Can there only be one unit in each space? Do you attack by moving into an occupied space? Are there hit points, strengths? What odds should there be? Winning conditions? Game menus, save files (should be mandatory or forbidden, no optionals)?

Of course, one of the biggest arguments in favor of procedural programming is performance, and we will get no difference for this case. We would need a problem with high complexity and large data sets for that.

I am tempted to write one or even two approaches to the problem. I think you need several. There is more than procedural-vs-OOP, there are several approaches in each, and it is perfectly possibly to write lousy code for both cases.

One more thing: The evaluation should preferably be positive and open-minded. That isn't very easy to do. It is so easy to flame the way that isn't "my own", but I think it is better to speak about advantages than pinning down what we think is bad. Objective, and absolutely avoid getting personal. But the way you state your intentions, I think you are on the right track already.

So what do you say, is the "tile-based naval game" idea the right one to try? I'm in if you want, just let's get a bit more exact on the rules so we write the same game.