DEV Community

Discussion on: Breeding Attack Squirrels in F#

Collapse
 
vasar007 profile image
Vasily Vasilyev

Thanks a lot for your work and this series about F#! It was great, it was really exciting. There're many interesting things and tricks that I've learned from you.

But there's always a but. I really like your content, that's why I'd like to criticize you. I'd like to emphasize that I don't mean to offend you or anything. I will try to convey my thoughts briefly and clearly.

First of all, you've written many great articles on clean code and best practices. So, why don't you always use these methods, for example, in this project? I understand that the ideal is difficult to achieve and programming is very time consuming thing but you said that this is your personal project. Isn't it worth writing the best code in personal projects where you can apply any patterns, any language features and any approaches?

Then let's look at your repository. There're a lot of unused projects in solution. In simple terms, it's a code mess. If someone tries to find something that you missed or didn't cover in one of the article, he will spend a lot of time.

More than that, I consider that many methods and classes (or modules in F#) can be divided into separate parts according to the SRP (Single Responsability Principle). In addition, you once wrote that you prefer small functions but there're some really big functions (e.g. moveActor from Simulator.fs). Why do you violate your approaches?

Besides, I believe that it's a bad practice to use domain models in the UI area without conversion. I mean conversion of F# records to C# classes. It's hard to improve and extend domain library without this conversion because we have to change all the places where we use F# models.

Finally, I can write a lot more about some other issues but they are controversial and not as important as I think, so I just mention them: the flexibility of changing the game control from the user to the AI and vice-versa, the ability to configure AI strategy, eliminating magic strings and numbers, and so on.

Again, I don't mean to offend you or anything. I just hope that my words can help you become even better and even cooler. Therefore, I wish you success in your work, in your personal projects and in writing articles. I look forward to reading your new articles. Thanks in advance!

Collapse
 
integerman profile image
Matt Eland

So, if you look at my starting articles in the series, you'll pretty clearly see that I didn't know how to F# as of the start of the series.

In fact, I view this series as my way of learning F# by doing, and writing about it in the process.

And yes, I'm not thrilled with the resulting code either.

As far as the F# -> C# conversion, I agree, which is why I'm looking at Elmish.WPF at the moment.

No offense taken. Thanks for the passion to write this response.