Day 42

There isn’t too much other than continuing to get all the Python Katas translated over to C#.  I was able to get a few more done today and then a few more done tonight.

I did learn that Code Wars is using C# 6.0 which means that it is utilizing .NET 4.6 and I am running Linux with .NET Core and when I get the version of C# I am currently using, it shows 4.0.3xxxx

This came to light, when I was trying to do this Kata and the following code wasn’t working:

public bool IsDigit(string s)
    return double.TryParse(s, out double n);
This was working on my machine but not within Code Wars’ site.  I had to declare the out variable outside of the TryParse like this:
public bool IsDigit(string s)
    double n;
    return double.TryParse(s, out n);
It took some Google-fu and a decent amount of time to figure this one out.  Something so simple took too long for my liking.  This just proves that I still have a lot to learn with this language and nuances between versions.  I briefly read that declaring in this way, didn’t make it going forward.
Just wanted to share the hiccup today.
Happy Coding!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s