Even better, a chess board has 64 squares, so you can use a single 64-bit integer to store, say, the position of all white pawns, and repeat this for all the kinds of pieces. Then, you have a compact and fast data representation for your chess engine.
The important part is - the way you represent the data matters a lot, and almost any representation will make more sense than bunch of "objects" scattered around.
Comments
Even better, a chess board has 64 squares, so you can use a single 64-bit integer to store, say, the position of all white pawns, and repeat this for all the kinds of pieces. Then, you have a compact and fast data representation for your chess engine.
The important part is - the way you represent the data matters a lot, and almost any representation will make more sense than bunch of "objects" scattered around.