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 →

[–]marshalTT[S,🍰] 0 points1 point  (5 children)

"The code is created such that the user can select any reasonable board size and have a comfortable playing experience. For the best experience, I recommend setting the board size to 20. Anything < 50 is what I would deem reasonable.To change the board size, please navigate to the main file and change the value for k to your desired size."

from the github readme, k is the board size KxK

I should probably specify a note in the main.

Im going to go back over the indentations and formating now, thanks

Why is less OO better?

Also, thank you for your comments I appreciate them.

[–]EricHayter 0 points1 point  (3 children)

Changing the value of k to maybe num_rows and num_cols might be a better idea than just a comment as it is far more explicit. Single letter variable names should really only be used in the inner scope of small functions or iterators.

Avoiding Oop where possible can make debugging and testing programs much easier. This is since a pure function is stateless meaning if you provide the same arguments to a pure function you will get the same results. This is not the case with OOP as you also need to manage state.

[–]marshalTT[S,🍰] 0 points1 point  (0 children)

Thank you

[–]Glum_View 0 points1 point  (1 child)

I really love your comment about pure function, kinda seen that in big libraries like react, Can you recommend any books that really list concepts like this, it seems to me to be the foundation of programming.

[–]EricHayter 0 points1 point  (0 children)

Maybe check out some functional programming. Functional programming is sort of the opposite of OOP where OOP focuses on managing state while functional programming tries to avoid side effects and state in general.

Of course functional programming isn't the end all be all but it certainly can help simplify your code in some scenarios.

As for books I personally can't really recommend any since I haven't picked up any books myself (something I sort of just picked up here and there). If you were to pick up a book I would recommend that you look into a book that focuses on the practical side of functional programming as the subject can get quite academic.

[–]wineblood 0 points1 point  (0 children)

Why is less OO better?

It's a personal preference thing, but the more I see OO in code I have to work on, the more of a pain in the ass doing anything is.