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 🙂



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


Komentujesz korzystając z konta Wyloguj / Zmień )

Zdjęcie z Twittera

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

Zdjęcie na Facebooku

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

Zdjęcie na Google+

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

Connecting to %s