One comment on “StringCalculator Kata in F# – revision 1

  1. This code is not beautiful but you did it in 15 minutes, very fast. Good job🙂

    If you want to refactor it and make much simpler, here are some of my advice:
    1. Consider the text characters that you have to skip while parsing. Do you have to search for a specific character to be omitted or maybe you can just check the range (more generic way)?
    2. Use smaller functions. Name them to make the code more readable.
    3. Try to not use indexes at all.
    4. Try to process the text at onces.
    5. Try to think about text as a list of characters. Maybe it will help you to approach in a different way to solve the problem.
    6. Fold function (aka reduce or aggregate) is very powerful weapon in functional languages. Use it🙂

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Log Out / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Log Out / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Log Out / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Log Out / Zmień )

Connecting to %s