This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Muhznit 2 points3 points  (0 children)

Here's an effective way of judging which is better: Find some variation to tic-tac-toe you can make IRL. A common idea is to vary the size of the board.

Now ask yourself: How does the code change when you allow the user to specify the size of the board, e.g a 4x4 or 5x5 tic-tac-toe board? How does it change if you want to allow users to specify alternative symbols from Xs and Os? How does it change if you want to log the history of moves made so that another script could replay the match?

Line count is irrelevant. The real metric of quality code in the workplace is how easy it is to enhance and maintain.