Have we met before C#, in another life perhaps?
Reading time: 1 minToday I delved into the world of C# and I have to honestly say it felt like I had once visited this particular world before. Having a background in Java made using C# seem familiar but not quite. There were many times where my assumptions were proven correctly. For example, when going through the Roman Numerals kata, in order to generalised the following code.
I figured in Java I would most likely use a mutable string that I could then easily then append to. I thought to myself, "I wonder if C# has a class like StringBuilder", lo and behold... it does !! and it's called "StringBuilder".
The similarities don't stop there, here are class declarations in Java and C#
okay that's not a typo, class declarations are identical.
Or how about method declarations?
again... no typo but there's a difference... the method declaration at the top is C#, the bottom declaration is Java. So the difference is the "String" text, one being uppercase and the other lowercase.
Seeing little difference between the two languages, I decided to go full steam ahead with assumptions and so far I have only hit a few roadblocks, most of which were to do with the two languages have a different keyword for a similar functionality. e.g. "using" in C# and "import" in Java.
Which language do I prefer? too little of a difference to tell at the moment, perhaps once I complete the Tic tac toe project in C#, I'll be in a better position to give a well formed opinion.